Stable Diffusion CLI Tools
Generation Examples
api-txt2img.py: text-to-image generationapi-img2img.py: image-to-image generationapi-control.py: generation with control interfaceapi-faceid.py: generation with Face ID flowapi-pulid.js: generation with PuLID flowapi-grid.py: text-to-image generation with X/Y parameter variation for grid output
Information and Status
api-progress.py: check job progressapi-info.py: read image metadataapi-history.py: query generation history
Other API Examples
api-upscale.py: image upscalingapi-detect.py: face detection in imagesapi-json.py: send raw JSON to any API endpointapi-mask.py: image masking with advanced optionsapi-preprocess.py: image preprocessingapi-vqa.py: visual question answeringapi-caption.py: image captioningapi-checkpoint.py: checkpoint operationsapi-enhance.py: image enhancement flowapi-samplers.py: sampler listing and sampler-related callsapi-xyz.py: X/Y/Z plotting helperapi-xyzenum.py: X/Y/Z parameter enumeration helper
JavaScript API Examples
api-txt2img.js: text-to-image generationapi-model.js: model loading
Benchmark and Processing
run-benchmark.py: benchmark testsprocess.py: processing helper scriptprocess_options.py: processing options helper
Utility Scripts
nvidia-smi.py: GPU informationimage-grid.py: create image gridsimage-exif.py: extract EXIF metadataimage-encode.py: image encoding helperimage-search.py: image search helperimage-palette.py: extract color palette from imagesimage-watermark.py: create invisible image watermarkgen-styles.py: generate styles from lines in a text filemodel-metadata.py: model metadata inspectionmodel-keys.py: model key inspectionload-unet.py: load and inspect UNet-related artifactsdownload-file.py: file download helpergit-clone.py: repository clone helperhf-info.py: Hugging Face model info helperhf-search.py: Hugging Face model search helpersearch-docs.py: docs search helpercivitai-search.py: CivitAI search helpertags-fetch.py: tags fetch helpertags-manifest.py: tags manifest helpertags-prune.py: tags prune helpervideo-extract.py: extract video framesinstall-stablefast.py: install Stable-Fast supportzluda-python.py: install ZLUDA Python components
API Helper Module
SDAPI
sdapi.py is a helper module for async communication with Automatic API endpoints.
It can be used to run commands manually. Requires SD API.
python cli/sdapi.py progress
python cli/sdapi.py interrupt
python cli/sdapi.py shutdown