Welcome to dgenerate’s documentation!
This is the library documentation for dgenerate.
dgenerate is a scriptable command line tool for generating images and animation sequences
using stable diffusion and related techniques, with an accompanying UI scripting environment.
For library usage examples see the Library Usage Examples folder under the examples folder in the github repository.
For command line usage documentation see the Command Line Manual or the Examples Folder in the github repository.
Library Documentation
- dgenerate module
BatchProcessErrorDgenerateHelpExceptionDgenerateUsageErrorFrameStartOutOfBoundsImageProcessorArgumentErrorImageProcessorErrorImageProcessorImageModeErrorImageProcessorNotFoundErrorImageSeedErrorInvalidModelFileErrorInvalidModelUriErrorInvalidSchedulerNameErrorMediaIdentificationErrorModelNotFoundErrorModelUriLoadErrorModuleFileNotFoundErrorNonHFModelDownloadErrorOutOfMemoryErrorPluginArgumentErrorPluginNotFoundErrorPromptWeightingUnsupportedRenderLoopConfigErrorUnknownMimetypeErrorUnsupportedPipelineConfigErrorAnimationETAEventAnimationFileFinishedEventAnimationFinishedEventConfigRunnerConfigRunnerPluginConfigRunnerPluginLoaderDataTypeDgenerateArgumentsImageFileSavedEventImageGeneratedEventModelTypePipelineTypePromptRenderLoopRenderLoopConfigRenderLoopSchedulerSetStartingAnimationEventStartingAnimationFileEventStartingGenerationStepEventdefault_device()format_image_seed_uri()gen_seeds()invoke_dgenerate()invoke_dgenerate_events()main()parse_args()
- dgenerate submodules
- dgenerate.arguments module
- dgenerate.batchprocess module
- dgenerate.filecache module
- dgenerate.filelock module
- dgenerate.files module
- dgenerate.image module
- dgenerate.image_process module
- dgenerate.imageprocessors module
- dgenerate.invoker module
- dgenerate.mediainput module
- dgenerate.mediaoutput module
- dgenerate.memoize module
- dgenerate.memory module
- dgenerate.messages module
- dgenerate.pipelinewrapper module
- dgenerate.plugin module
- dgenerate.prompt module
- dgenerate.promptweighters module
- dgenerate.pygments module
- dgenerate.renderloop module
- dgenerate.textprocessing module
- dgenerate.types module
- dgenerate.webcache module
Diffusion Model Feature Support Table
--model-type torch(SD 1.5 - SD 2.*)
--model-type torch-pix2pix(SD 1.5 - SD 2.* - Pix2Pix)
--model-type torch-sdxl(Stable Diffusion XL)
--model-type torch-if(Deep Floyd Stage 1)
--model-type torch-ifs(Deep Floyd Stage 2)
--model-type torch-if-img2img(Deep Floyd Stage 2 - Img2Img)
--model-type torch-sdxl-pix2pix(Stable Diffusion XL - Pix2Pix)
--model-type torch-upscaler-x2(Stable Diffusion x2 Upscaler)
--model-type torch-upscaler-x4(Stable Diffusion x4 Upscaler)
--model-type torch-s-cascade(Stable Cascade)
--model-type torch-sd3(Stable Diffusion 3 and 3.5)
--model-type torch-flux(Flux.1)
Model Type |
Txt2Img |
Img2Img |
Inpainting |
LoRA |
Textual Inversions |
ControlNet |
T2I Adapter |
IP Adapter |
Perturbed Attention Guidance (PAG) |
sd-embed Prompt Weighting |
compel Prompt Weighting |
|---|---|---|---|---|---|---|---|---|---|---|---|
|
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
|
❌ |
✅ |
❌ |
✅ |
✅ |
❌ |
❌ |
✅ |
❌ |
✅ |
✅ |
|
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
|
✅ |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
|
❌ |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
|
❌ |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
|
❌ |
✅ |
❌ |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
✅ |
✅ |
|
❌ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
|
❌ |
✅ |
❌ |
❌ |
✅ |
❌ |
❌ |
❌ |
❌ |
✅ |
✅ |
|
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
✅ |
✅ |
|
✅ |
✅ |
✅ |
✅ |
❌ |
✅ |
❌ |
❌ |
✅ |
✅ |
❌ |
|
✅ |
✅ |
✅ |
✅ |
❌ |
✅ |
❌ |
❌ |
❌ |
✅ |
❌ |
PAG Support Caveats
PAG is supported for txt2img in all cases, but there are some edge cases in which PAG is not supported.
There is no support for using T2I Adapters with PAG.
Stable Diffusion 3 does not currently support PAG in img2img mode, or with Control Nets at all.
Stable Diffusion XL does not support PAG in (inpaint + Control Nets) mode.
Stable Diffusion 1.5 - 2.* does not support PAG in img2img, inpaint, or (img2img + Control Nets) mode. It does however support PAG in (inpaint + Control Nets) mode.
Command Line Manual
- Overview
- Help Output
- Windows Install
- Linux or WSL Install
- Linux with ROCm (AMD Cards)
- MacOS Install (Apple Silicon Only)
- Google Colab Install
- Basic Usage
- Negative Prompt
- Multiple Prompts
- Image Seeds
- Inpainting
- Per Image Seed Resizing
- Animated Output
- Animation Slicing
- Inpainting Animations
- Deterministic Output
- Specifying a specific GPU for CUDA
- Specifying a Scheduler (sampler)
- Specifying a VAE
- VAE Tiling and Slicing
- Specifying a UNet
- Specifying a Transformer (SD3 and Flux)
- Specifying an SDXL Refiner
- Specifying a Stable Cascade Decoder
- Specifying LoRAs
- Specifying Textual Inversions (embeddings)
- Specifying Control Nets
- Specifying T2I Adapters
- Specifying IP Adapters
- Specifying Text Encoders
- Prompt Weighting and Enhancement
- Utilizing CivitAI links and Other Hosted Models
- Specifying Generation Batch Size
- Batching Input Images and Inpaint Masks
- Image Processors
- Sub Commands
- Upscaling
- Writing and Running Configs
- Basic config syntax
- Built in template variables and functions
- Directives, and applying templating
- Setting template variables, in depth
- Setting environmental variables, in depth
- Globbing and path manipulation
- The \print and \echo directive
- The \image_process directive
- The \exec directive
- The \download directive
- The download() template function
- The \exit directive
- Running configs from the command line
- Config argument injection
- Console UI
- Writing Plugins
- File Cache Control