An Unofficial ComfyUI custom node package that integrates a/Diffusion Self-Distillation (DSD) for zero-shot customized image generation.
DSD is a model for subject-preserving image generation that allows you to create images of a specific subject in novel contexts without per-instance tuning.
An Unofficial ComfyUI custom node package that integrates Diffusion Self-Distillation (DSD) for zero-shot customized image generation.
DSD is a model for subject-preserving image generation that allows you to create images of a specific subject in novel contexts without per-instance tuning.
Features
Subject-preserving image generation using DSD model
Gemini API prompt enhancement
Direct model download from Hugging Face
Fine-grained control over generation parameters
Multiple image resizing options
Installation
Clone this repository into your ComfyUI custom_nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/irreveloper/ComfyUI-DSD.git
Install the required dependencies:
pip install -r requirements.txt
Get the model files (two options):
Option 1: Use the DSD Model Downloader node in ComfyUI to automatically download the model
Memory optimization options for different hardware configurations
DSD Model Selector: Helps select models from local directories
Automatically finds models in the default ComfyUI model paths
Verifies model existence and provides appropriate warnings
DSD Gemini Prompt Enhancer: Uses Google's Gemini API to enhance prompts for better image generation results
The API key can be provided in two ways:
As an input parameter to the node (not recommended for sharing workflows)
Through the GEMINI_API_KEY environment variable (strongly recommended)
Analyzes both the input image and text prompt to generate improved prompts
Note: To use the enhanced prompts, connect this node's output to the DSD Image Generator's prompt input and enable the use_gemini_prompt option. If no API key is provided, the original prompt will be used.
DSD Image Generator: Generates images with the DSD model
Supports detailed parameter control:
Guidance scale (overall, image-specific, and text-specific)
Inference steps
Resolution control
Seed control (0 for random seed)
Returns both the generated image and the reference image
Displays progress during generation
DSD Resize Selector: Provides flexible image resizing options for the DSD Image Generator:
resize_and_center_crop: Resizes and center crops the image (default behavior)
center_crop: Simple center crop and resize
pad: Preserves aspect ratio and adds padding to reach target size
fit: Resizes to target dimensions without preserving aspect ratio