|
--- |
|
license: mit |
|
base_model: |
|
- HiDream-ai/HiDream-I1-Full |
|
- MiaoshouAI/Florence-2-large-PromptGen-v2.0 |
|
pipeline_tag: image-to-image |
|
--- |
|
|
|
<div align="center"> |
|
|
|
# ๐ HiDream Img2Img ComfyUI Workflow |
|
|
|
[](https://opensource.org/licenses/MIT) |
|
[](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI) |
|
[](https://replicate.com/goodguy1963/hidream-l1-full-img2img) |
|
|
|
#### Advanced image-to-image generation with HiDream model suite and Florence-2 prompt generator |
|
</div> |
|
|
|
## ๐ Overview |
|
|
|
This workflow combines the power of HiDream diffusion models with Florence-2 captioning for enhanced image-to-image generation in ComfyUI: |
|
|
|
- โจ **Image-to-image generation** with the state-of-the-art HiDream diffusion model |
|
- ๐ฎ **Optional Florence-2** intelligent prompt generation and image captioning |
|
- ๐ผ๏ธ **VAE encoding/decoding** and advanced CLIP-based text encoding |
|
- ๐ซ **Customizable negative prompts** for artifact reduction |
|
- ๐ป **Low VRAM mode** available for systems with limited resources |
|
|
|
## ๐ Try It Now! |
|
|
|
You can test this workflow directly on Replicate: |
|
[โถ๏ธ Run on Replicate](https://replicate.com/goodguy1963/hidream-l1-full-img2img) |
|
|
|
## ๐ฅ Required Models & Setup |
|
|
|
### ๐จ Diffusion Model |
|
|
|
The workflow supports two HiDream model variants: |
|
|
|
#### Full Model (Default) |
|
- **`hidream_i1_full_fp16.safetensors`** |
|
๐ Place in: `ComfyUI/models/diffusion_models` |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/diffusion_models/hidream_i1_full_fp16.safetensors) |
|
|
|
#### Dev Model (Alternative) |
|
- **`hidream_i1_dev_bf16.safetensors`** |
|
๐ Place in: `ComfyUI/models/diffusion_models` |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/diffusion_models/hidream_i1_dev_bf16.safetensors) |
|
|
|
> **Credit:** [HiDream.ai](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI) |
|
|
|
### ๐ Text Encoders |
|
|
|
๐ Place all in: `ComfyUI/models/text_encoders` |
|
|
|
- **`clip_g_hidream.safetensors`** |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_g_hidream.safetensors) |
|
|
|
- **`clip_l_hidream.safetensors`** |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_l_hidream.safetensors) |
|
|
|
- **`llama_3.1_8b_instruct_fp8_scaled.safetensors`** |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/llama_3.1_8b_instruct_fp8_scaled.safetensors) |
|
|
|
- **`t5xxl_fp8_e4m3fn_scaled.safetensors`** |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/t5xxl_fp8_e4m3fn_scaled.safetensors) |
|
|
|
### ๐ผ๏ธ VAE |
|
|
|
- **`ae.safetensors`** |
|
๐ Place in: `ComfyUI/models/vae` |
|
๐ฆ [Download](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/vae/ae.safetensors) |
|
|
|
### ๐ Florence-2 Prompt Generator |
|
|
|
- **Florence-2-large** |
|
โก Automatic download at runtime |
|
๐ฆ [Microsoft Florence-2](https://huggingface.co/microsoft/Florence-2-large) |
|
|
|
> **Credit:** [MiaoshouAI](https://huggingface.co/MiaoshouAI/Florence-2-large-PromptGen-v2.0) for the optimized implementation |
|
|
|
## ๐ก Usage Guide |
|
|
|
1. Download all required models and place them in the correct directories as listed above |
|
2. Import the workflow into ComfyUI |
|
3. Load your input image, adjust settings as needed |
|
4. Choose whether to use Florence-2 automatic captioning: |
|
- **With Florence-2**: Provide a brief prefix that will be combined with the AI-generated caption |
|
- **Without Florence-2**: Enter your complete custom prompt directly |
|
5. Customize the negative prompt to avoid unwanted elements |
|
6. Generate new images with enhanced quality |
|
|
|
## ๐ป Low VRAM Mode (< 24GB VRAM) |
|
|
|
<div align="center"> |
|
<img src="https://img.shields.io/badge/Memory-Efficient-brightgreen" alt="Memory Efficient"/> |
|
</div> |
|
|
|
For systems with limited VRAM, use this alternative setup: |
|
|
|
1. Install [city96/ComfyUI-GGUF](https://github.com/city96/ComfyUI-GGUF) custom node |
|
2. Replace the standard Diffusion Model Loader with the **Unet LOADER** node |
|
3. Download the optimized HiDream-I1 Full or DEV GGUF model: |
|
- ๐ฆ [HiDream-I1-Full-gguf](https://huggingface.co/city96/HiDream-I1-Full-gguf/tree/main) |
|
- ๐ฆ [HiDream-I1-DEV-gguf](https://huggingface.co/city96/HiDream-I1-Dev-gguf) |
|
- ๐ Place in: `ComfyUI/models/unet` |
|
|
|
## ๐ Workflow Diagram |
|
|
|
<div align="center"> |
|
<img src="https://huggingface.co/hofixD/comfyui-hidream-l1-full-img2img/resolve/main/WORKFLOW-HIDREAM-IMG2IMG.png" alt="HiDream Workflow Diagram" width="85%"/> |
|
</div> |
|
|
|
## ๐ Acknowledgements |
|
|
|
- **HiDream.ai** for the remarkable diffusion model and encoders |
|
- **Microsoft** for the Florence-2 vision-language model |
|
- **MiaoshouAI** for the Florence-2 prompt generator implementation |
|
- **ComfyUI** team for the intuitive workflow engine |
|
- **city96** for the GGUF optimization for low VRAM systems |
|
|
|
--- |
|
|
|
<div align="center"> |
|
<p>โญ If you find this workflow useful, please consider starring the repository! โญ</p> |
|
</div> |