Skip to content

Stable Diffusion CLI Tools

Generation Examples

  • api-txt2img.py: text-to-image generation
  • api-img2img.py: image-to-image generation
  • api-control.py: generation with control interface
  • api-faceid.py: generation with Face ID flow
  • api-pulid.js: generation with PuLID flow
  • api-grid.py: text-to-image generation with X/Y parameter variation for grid output

Information and Status

  • api-progress.py: check job progress
  • api-info.py: read image metadata
  • api-history.py: query generation history

Other API Examples

  • api-upscale.py: image upscaling
  • api-detect.py: face detection in images
  • api-json.py: send raw JSON to any API endpoint
  • api-mask.py: image masking with advanced options
  • api-preprocess.py: image preprocessing
  • api-vqa.py: visual question answering
  • api-caption.py: image captioning
  • api-checkpoint.py: checkpoint operations
  • api-enhance.py: image enhancement flow
  • api-samplers.py: sampler listing and sampler-related calls
  • api-xyz.py: X/Y/Z plotting helper
  • api-xyzenum.py: X/Y/Z parameter enumeration helper

JavaScript API Examples

  • api-txt2img.js: text-to-image generation
  • api-model.js: model loading

Benchmark and Processing

  • run-benchmark.py: benchmark tests
  • process.py: processing helper script
  • process_options.py: processing options helper

Utility Scripts

  • nvidia-smi.py: GPU information
  • image-grid.py: create image grids
  • image-exif.py: extract EXIF metadata
  • image-encode.py: image encoding helper
  • image-search.py: image search helper
  • image-palette.py: extract color palette from images
  • image-watermark.py: create invisible image watermark
  • gen-styles.py: generate styles from lines in a text file
  • model-metadata.py: model metadata inspection
  • model-keys.py: model key inspection
  • load-unet.py: load and inspect UNet-related artifacts
  • download-file.py: file download helper
  • git-clone.py: repository clone helper
  • hf-info.py: Hugging Face model info helper
  • hf-search.py: Hugging Face model search helper
  • search-docs.py: docs search helper
  • civitai-search.py: CivitAI search helper
  • tags-fetch.py: tags fetch helper
  • tags-manifest.py: tags manifest helper
  • tags-prune.py: tags prune helper
  • video-extract.py: extract video frames
  • install-stablefast.py: install Stable-Fast support
  • zluda-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