ComfyUI Extension: ComfyUI-DreamFit
Garment-centric human generation nodes for ComfyUI using DreamFit with Flux. DreamFit is a powerful adapter system that enhances Flux models with garment-aware generation capabilities, enabling high-quality fashion and clothing generation.
Custom Nodes (0)
README
ComfyUI-DreamFit
Garment-centric human generation nodes for ComfyUI using DreamFit with Flux.
DreamFit is a powerful adapter system that enhances Flux models with garment-aware generation capabilities, enabling high-quality fashion and clothing generation.
Features
- 🎨 Garment-Centric Generation: Generate humans wearing specific garments with high fidelity
- 👗 Virtual Try-On: Try different garments on models
- 🎠Pose Control: Generate with specific poses while maintaining garment details
- 🔧 Flux Integration: Seamlessly works with Flux models in ComfyUI
- âš¡ Adaptive Attention: Smart injection of garment features into the generation process
- 🎯 LoRA Adaptation: Efficient model adaptation without full fine-tuning
Installation
Prerequisites
- ComfyUI installed and working
- Python 3.8 or higher
- Git (for installation method 1)
Method 1: Git Clone (Recommended)
# Navigate to your ComfyUI custom nodes directory
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/skayka/ComfyUI-DreamFit.git
# Navigate to the installed directory
cd ComfyUI-DreamFit
# Install Python dependencies
pip install -r requirements.txt
# Optional: Download models (do this after restarting ComfyUI)
python download_models.py
Method 2: ComfyUI Manager
If you have ComfyUI Manager installed:
- Open ComfyUI Manager
- Search for "DreamFit"
- Click Install
- Restart ComfyUI
Method 3: Manual Installation
- Download the repository as ZIP
- Extract to
ComfyUI/custom_nodes/ComfyUI-DreamFit
- Open a terminal in the extracted directory
- Install requirements:
pip install -r requirements.txt
Download Models
After installation, download the required DreamFit models:
# Navigate to the ComfyUI-DreamFit directory
cd ComfyUI/custom_nodes/ComfyUI-DreamFit
# Download all models (855MB total)
python download_models.py
# Or download specific models
python download_models.py --model flux_i2i
python download_models.py --model flux_tryon
# List available models
python download_models.py --list
# Verify downloaded models
python download_models.py --verify
The models will be automatically downloaded to:
- If inside ComfyUI:
ComfyUI/models/dreamfit/
- Otherwise:
./dreamfit_models/
Troubleshooting Installation
"No module named 'folder_paths'" during install
This is normal! The installation will complete successfully. This error only appears because the installer tries to verify the installation outside of ComfyUI.
Models not found
- Make sure you've downloaded the models using
python download_models.py
- Check that models are in
ComfyUI/models/dreamfit/
- Restart ComfyUI after downloading models
Import errors in ComfyUI
- Make sure you've installed requirements:
pip install -r requirements.txt
- Restart ComfyUI after installation
- Check the ComfyUI console for specific error messages
Available Nodes
1. DreamFit Checkpoint Loader
Loads DreamFit model checkpoints and initializes the Anything-Dressing Encoder.
Inputs:
model_name
: Choose from available DreamFit modelsdevice
: Processing device (cuda/cpu)dtype
: Model precision (fp16/bf16/fp32)
Outputs:
DREAMFIT_MODEL
: The loaded model configurationDREAMFIT_ENCODER
: The Anything-Dressing EncoderDREAMFIT_CONFIG
: Model configuration
2. DreamFit Encode
Encodes garment images and text prompts into conditioning for generation.
Inputs:
encoder
: From checkpoint loadergarment_image
: The garment to generatepositive_prompt
: Description of desired outputnegative_prompt
: What to avoid in generationmodel_image
(optional): Reference pose/modelgarment_description
: Brief garment descriptiongarment_category
: Type of garment (casual/formal/sportswear/traditional)enhance_prompt
: Auto-enhance promptsuse_model_parse
: Parse model image for better resultsinjection_strength
: Control garment influence (0.1-2.0)
Outputs:
conditioning
: DreamFit conditioning for samplingenhanced_prompt
: Improved positive promptenhanced_negative
: Improved negative prompt
3. DreamFit Flux Adapter V2
Applies DreamFit adaptation to a Flux model with CLIP integration.
Inputs:
model
: Your Flux modelclip
: CLIP model for text encodingdreamfit_conditioning
: From encode nodepositive
: Enhanced positive promptnegative
: Enhanced negative promptlora_strength
: LoRA adaptation strength (0.0-2.0)injection_strength
: Feature injection strength (0.0-2.0)lora_merge_mode
: How to merge LoRA weightsinjection_mode
: Attention injection strategyattention_mode
: Which attention layers to modifyuse_cached_embeddings
: Speed optimization
Outputs:
model
: Flux model with DreamFit adaptationpositive
: Positive conditioningnegative
: Negative conditioning
4. DreamFit K-Sampler
Custom sampler optimized for DreamFit generation.
Inputs:
- Standard KSampler inputs (model, seed, steps, cfg, etc.)
dreamfit_conditioning
: From encode node
Outputs:
LATENT
: Generated image latent
5. DreamFit Unified
Complete DreamFit integration in a single node.
Inputs:
model
: Flux diffusion model (from UNETLoader)positive/negative
: Pre-encoded conditioning from CLIPgarment_image
: Garment to processdreamfit_model
: Select model typestrength
: Overall adaptation strengthmodel_image
(optional): Reference pose for try-oninjection_strength
: Garment feature strengthinjection_mode
: Feature injection strategy
Outputs:
model
: Enhanced Flux modelpositive/negative
: Enhanced conditioningdebug_garment
: Processed garment (224x224) for debugging
6. DreamFit Simple
All-in-one node for easy DreamFit generation.
Inputs:
model
: Flux modelclip
: CLIP modelvae
: VAE modeldreamfit_model
: Select DreamFit modelgarment_image
: Garment to generatepositive/negative
: Text promptsseed
,steps
,cfg
,denoise
: Standard generation parametersmodel_image
(optional): Reference model/pose
Outputs:
samples
: Generated latent image
6. DreamFit Sampler Advanced
Advanced sampler with additional controls.
Features:
- Noise modes: default, garment_aware, structured
- Injection schedules: constant, linear, cosine, step
- Step control for multi-stage generation
Workflow Examples
Four example workflows are included in the workflows/
directory:
1. Simple Workflow (dreamfit_simple_workflow.json
)
- Uses the all-in-one DreamFit Simple node
- Minimal setup required
- Best for quick testing and basic generation
2. Basic Workflow (dreamfit_basic_workflow.json
)
- Full node setup with individual components
- More control over the generation process
- Good balance of simplicity and flexibility
3. Advanced Workflow (dreamfit_advanced_workflow.json
)
- Complete setup with all advanced features
- Virtual try-on with model images
- Advanced sampling strategies
- Maximum control and customization
Loading Workflows
- Open ComfyUI
- Click "Load" in the menu
- Navigate to
ComfyUI/custom_nodes/ComfyUI-DreamFit/workflows/
- Select the desired workflow JSON file
4. Unified Workflow (dreamfit_unified_workflow.json
)
- Uses the new DreamFit Unified node
- Proper Flux model loading (UNETLoader, DualCLIPLoader, VAELoader)
- Shows debug output of processed garment
- Best for understanding the complete pipeline
Tips for Best Results
- Image Quality: Use high-quality garment images with clean backgrounds
- Prompts: Be specific about the desired style and context
- Injection Strength: Start with 0.5 and adjust based on results
- Sampling Steps: 20-30 steps usually sufficient
- CFG Scale: 7-8 works well for most cases
Model Information
| Model | Size | Description | Best For | |-------|------|-------------|----------| | flux_i2i | 284MB | Basic garment generation | General fashion images | | flux_i2i_with_pose | 284MB | Pose-controlled generation | Specific poses/positions | | flux_tryon | 287MB | Virtual try-on | Trying clothes on models |
Troubleshooting
"No module named 'dreamfit_core'"
- Ensure you're in the correct directory when installing
- Try
python -m pip install -e .
from the ComfyUI-DreamFit directory
Models not downloading
- Check internet connection
- Try running with specific model:
python download_models.py --model flux_i2i
- Manually download from HuggingFace and place in
ComfyUI/models/dreamfit/
Out of memory errors
- Reduce batch size to 1
- Use CPU offloading in ComfyUI settings
- Try the fp16 versions of models
Technical Details
DreamFit uses:
- Anything-Dressing Encoder: 83.4M parameter encoder for garment features
- Adaptive Attention Injection: Injects garment features into Flux attention layers
- LoRA Adaptation: Efficient 16-rank LoRA for model adaptation
Credits
- Original DreamFit: ByteDance Research
- ComfyUI: comfyanonymous
License
This project follows the same license as the original DreamFit implementation.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
Support
- Report issues on GitHub Issues
- Join the discussion in ComfyUI Discord