Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 91 additions & 50 deletions tutorials/image/hidream/hidream-e1.mdx
Original file line number Diff line number Diff line change
@@ -1,74 +1,53 @@
---
title: "ComfyUI Native HiDream-e1 Workflow Example"
title: "ComfyUI Native HiDream-e1 e1.1 Workflow Example"
sidebarTitle: "HiDream-e1"
description: "This guide will help you understand and complete the ComfyUI native HiDream-I1 text-to-image workflow example"
---

import UpdateReminder from '/snippets/tutorials/update-reminder.mdx'

![HiDream-E1 Demo](https://raw.githubusercontent.com/HiDream-ai/HiDream-E1/refs/heads/main/assets/demo.jpg)

HiDream-E1 is an interactive image editing large model officially open-sourced by HiDream-ai on April 28, 2025, built based on HiDream-I1.
HiDream-E1 is an interactive image editing large model officially open-sourced by HiDream-ai, built based on HiDream-I1.

It allows you to edit images using natural language. The model is released under the [MIT License](https://github.com/HiDream-ai/HiDream-E1?tab=MIT-1-ov-file), supporting use in personal projects, scientific research, and commercial applications.
In combination with the previously released [hidream-i1](/tutorials/image/hidream/hidream-i1), it enables **creative capabilities from image generation to editing**.

**ComfyUI now natively supports HiDream E1**. In this guide, we will help you complete the workflow example of using HiDream E1 in ComfyUI.

<Note>
For reference, this workflow takes about 500s for the first run and 370s for the second run with 28 sampling steps on Google Colab L4 with 22.5GB VRAM.
</Note>

### HiDream-E1 Information
| Name | Update Date | Inference Steps | Resolution | HuggingFace Repository |
|-------------------|-------------------|-----------------|------------------------|-------------------------------|
| HiDream-E1-Full | 2025-4-28 | 28 | 768x768 | 🤗 [HiDream-E1-Full](https://huggingface.co/HiDream-ai/HiDream-E1-Full) |
| HiDream-E1.1 | 2025-7-16 | 28 | Dynamic (1 Megapixel) | 🤗 [HiDream-E1.1](https://huggingface.co/HiDream-ai/HiDream-E1-1) |

**HiDream-E1 Model Download**
Currently, HiDream provides a full version. Here is the model information:
[HiDream E1 - Github](https://github.com/HiDream-ai/HiDream-E1)

| Name | Inference Steps | Resolution | HuggingFace Repository |
|-----------------|----------------|------------|------------------------------------------------------------------------|
| HiDream-E1-Full | 28 | 768x768 | [🤗 HiDream-E1-Full](https://huggingface.co/HiDream-ai/HiDream-E1-Full) |
<UpdateReminder/>

## HiDream E1 and E1.1 Workflow Related Models

-[Github](https://github.com/HiDream-ai/HiDream-E1)
All the models involved in this guide can be found [here](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/tree/main/split_files). Except for the Diffusion model, E1 and E1.1 use the same models.
The corresponding workflow files also include the relevant model information. You can choose to manually download and save the models, or follow the workflow prompts to download them after loading the workflow. It is recommended to use E1.1.

## ComfyUI Native HiDream-e1 Workflow Example

<Tip>
Please upgrade your ComfyUI to the latest version (latest commit) before starting to ensure your ComfyUI has the relevant support.
</Tip>

### 1. Download HiDream-e1 Workflow and Related Files

#### 1.1 Download Workflow File

Please download the image below and drag it into ComfyUI. The workflow already contains model download information, and after loading, it will prompt you to download the corresponding models.

![ComfyUI Native HiDream-e1 Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/hidream_e1/hidream_e1_full.png)
This model requires a large amount of VRAM to run. Please refer to the relevant sections for specific VRAM requirements.

#### 1.2 Download Input Image
**Diffusion Model**

Please download the image below, which we will use as input
You do not need to download both models. Since E1.1 is an iterative version based on E1, our tests show that its quality and performance are significantly improved compared to E1.
- [hidream_e1_1_bf16.safetensors (Recommended)](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/diffusion_models/hidream_e1_1_bf16.safetensors) 34.2GB
- [hidream_e1_full_bf16.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/diffusion_models/hidream_e1_full_bf16.safetensors) 34.2GB

![ComfyUI Native HiDream-e1 Workflow Input Image](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/hidream_e1/input.webp)
**Text Encoder**:

### 2. Manual Model Installation for HiDream-e1 Related Models

All models mentioned in this guide can be found [here](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/tree/main/split_files). Please download the corresponding files and save them to the appropriate folders.

The following model files are shared models that we will use. Please click the corresponding links to download and save according to the model file storage location. We will guide you to download the corresponding **diffusion models** in the workflow.

**text_encoders**:

- [clip_l_hidream.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_l_hidream.safetensors)
- [clip_g_hidream.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_g_hidream.safetensors)
- [t5xxl_fp8_e4m3fn_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/t5xxl_fp8_e4m3fn_scaled.safetensors) This model has been used in many workflows, you may have already downloaded this file.
- [llama_3.1_8b_instruct_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/llama_3.1_8b_instruct_fp8_scaled.safetensors)
- [clip_l_hidream.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_l_hidream.safetensors) 236.12MB
- [clip_g_hidream.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/clip_g_hidream.safetensors) 1.29GB
- [t5xxl_fp8_e4m3fn_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/t5xxl_fp8_e4m3fn_scaled.safetensors) 4.8GB
- [llama_3.1_8b_instruct_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/text_encoders/llama_3.1_8b_instruct_fp8_scaled.safetensors) 8.46GB

**VAE**
- [ae.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/vae/ae.safetensors) This is Flux's VAE model. If you have used Flux workflows before, you may have already downloaded this file.
- [ae.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/blob/main/split_files/vae/ae.safetensors) 319.77MB
> This is the VAE model for Flux. If you have used the Flux workflow before, you may have already downloaded this file.

**diffusion models**
- [hidream_e1_full_bf16.safetensors](https://huggingface.co/Comfy-Org/HiDream-I1_ComfyUI/resolve/main/split_files/diffusion_models/hidream_e1_full_bf16.safetensors)
Model Save Location

Model file storage location
```
📂 ComfyUI/
├── 📂 models/
Expand All @@ -80,9 +59,72 @@ Model file storage location
│ └── 📂 vae/
│ │ └── ae.safetensors
│ └── 📂 diffusion_models/
│ └── hidream_e1_full_bf16.safetensors
│ ├── hidream_e1_1_bf16.safetensors
│ └── hidream_e1_full_bf16.safetensors
```
### 3. Complete the HiDream-e1 Workflow Step by Step


## HiDream E1.1 ComfyUI Native Workflow Example

E1.1 is an updated version released on July 16, 2025. This version supports dynamic 1-megapixel resolution, and the workflow uses the `Scale Image to Total Pixels` node to dynamically adjust the input image to 1 million pixels.

<Tip>
Here are the VRAM usage references during testing:
1. A100 40GB (VRAM usage 95%): First generation: 211s, second generation: 73s

2. 4090D 24GB (VRAM usage 98%)
- Full version: Out of memory
- FP8_e4m3fn_fast (VRAM 98%) First generation: 120s, second generation: 91s
</Tip>

### 1. HiDream E1.1 Workflow and Related Materials

Download the image below and drag it into ComfyUI with the corresponding workflow and models loaded:
![HiDream E1.1 Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/image/hidream/e1.1/hidream_e1_1.png)

Download the image below as input:
![HiDream E1.1 Workflow Input](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/image/hidream/e1.1/input.webp)

### 2. Step-by-step Guide to Running the HiDream-e1 Workflow
![hidream_e1_1_guide](/images/tutorial/image/hidream/hidream-e1-1-guide.jpg)

Follow these steps to run the workflow:
1. Make sure the `Load Diffusion Model` node loads the `hidream_e1_1_bf16.safetensors` model.
2. Make sure the four corresponding text encoders in `QuadrupleCLIPLoader` are loaded correctly:
- clip_l_hidream.safetensors
- clip_g_hidream.safetensors
- t5xxl_fp8_e4m3fn_scaled.safetensors
- llama_3.1_8b_instruct_fp8_scaled.safetensors
3. Make sure the `Load VAE` node uses the `ae.safetensors` file.
4. In the `Load Image` node, load the provided input or your desired image.
5. In the `Empty Text Encoder(Positive)` node, enter **the modifications you want to make to the image**.
6. In the `Empty Text Encoder(Negative)` node, enter **the content you do not want to appear in the image**.
7. Click the `Run` button, or use the shortcut `Ctrl(cmd) + Enter` to execute image generation.

### 3. Additional Notes on the Workflow

- Since HiDream E1.1 supports dynamic input with a total of 1 million pixels, the workflow uses `Scale Image to Total Pixels` to process and convert all input images, which may cause the aspect ratio to differ from the original input image.
- When using the fp16 version of the model, in actual tests, the full version ran out of memory on both A100 40GB and 4090D 24GB, so the workflow is set by default to use `fp8_e4m3fn_fast` for inference.


## HiDream E1 ComfyUI Native Workflow Example

E1 is a model released on April 28, 2025. This model only supports 768*768 resolution.

<Tip>
For reference, this workflow takes about 500s for the first run and 370s for the second run with 28 sampling steps on Google Colab L4 with 22.5GB VRAM.
</Tip>

### 1. HiDream-e1 workflow

Please download the image below and drag it into ComfyUI. The workflow already contains model download information, and after loading, it will prompt you to download the corresponding models.

![ComfyUI Native HiDream-e1 Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/hidream_e1/hidream_e1_full.png)

Download this image below as input:
![ComfyUI Native HiDream-e1 Workflow Input](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/hidream_e1/input.webp)

### 2. Complete the HiDream-e1 Workflow Step by Step

![hidream_e1_full_step_guide](/images/tutorial/advanced/hidream/hidream_e1_full_step_guide.jpg)

Expand All @@ -98,7 +140,6 @@ Follow these steps to complete the workflow:
5. (Important) Enter **the prompt for how you want to modify the image** in the `Empty Text Encoder(Positive)` node
6. Click the `Run` button, or use the shortcut `Ctrl(cmd) + Enter` to generate the image


### Additional Notes on ComfyUI HiDream-e1 Workflow

- You may need to modify the prompt multiple times or generate multiple times to get better results
Expand Down
Loading