HiDream E1.1圖像編輯
使用HiDream E1.1編輯圖像 - 在圖像品質和編輯準確性方面優於HiDream-E1-Full。
關於
本 ComfyUI 工作流程「HiDream E1.1 圖像編輯」針對 HiDream E1.1 與 HiDream-E1-Full 兩種圖像編輯模型進行比較分析。重點在於評估兩者的畫質與編輯精度。HiDream E1.1 以更高的畫質與精細的編輯能力著稱,特別適合需要高保真度圖像修改的使用者。流程中會用到 CLIPTextEncode、VAEDecode 與 KSamplerSelect 等節點,根據用戶提示詞進行圖片處理與編輯。兩者主要差異在於細節處理與未編輯區域的完整性維持,這也是 HiDream E1.1 優於前代的地方。
流程分為多步驟,從模型載入、圖片上傳,到使用 InstructPixToPixConditioning 節點根據提示詞進行編輯。這種比較特別適合需要根據不同編輯需求選擇模型的使用者。了解 HiDream E1.1 的優勢後,您可針對高精度與高品質需求的任務發揮其效能,同時考量處理時間與資源消耗的取捨。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"42",
0
],
"text": "Change the image to let the girl’s hair fall loose around her shoulders, natural and flowing. Don’t change other parts"
},
"_meta": {
"title": "Positive"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"42",
0
],
"text": "low quality, blurry, distorted"
},
"_meta": {
"title": "Negative"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"54",
0
],
"vae": [
"43",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"13": {
"class_type": "LoadImage",
"inputs": {
"image": "hidream_e1_1_input_image.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"41": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "hidream_e1_1_bf16.safetensors",
"weight_dtype": "fp8_e4m3fn_fast"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"42": {
"class_type": "QuadrupleCLIPLoader",
"inputs": {
"clip_name1": "clip_g_hidream.safetensors",
"clip_name2": "clip_l_hidream.safetensors",
"clip_name3": "t5xxl_fp8_e4m3fn_scaled.safetensors",
"clip_name4": "llama_3.1_8b_instruct_fp8_scaled.safetensors"
},
"_meta": {
"title": "Load CLIP (Quadruple)"
}
},
"43": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"13",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"46": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"47": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 567500569211369
},
"_meta": {
"title": "RandomNoise"
}
},
"49": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"55",
0
],
"scheduler": "simple",
"steps": 20
},
"_meta": {
"title": "BasicScheduler"
}
},
"52": {
"class_type": "InstructPixToPixConditioning",
"inputs": {
"negative": [
"7",
0
],
"pixels": [
"45",
0
],
"positive": [
"6",
0
],
"vae": [
"43",
0
]
},
"_meta": {
"title": "InstructPixToPixConditioning"
}
},
"53": {
"class_type": "DualCFGGuider",
"inputs": {
"cfg_cond2_negative": 1.5,
"cfg_conds": 3,
"cond1": [
"52",
0
],
"cond2": [
"52",
1
],
"model": [
"55",
0
],
"negative": [
"6",
0
],
"style": "regular"
},
"_meta": {
"title": "Dual CFG Guider"
}
},
"54": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"53",
0
],
"latent_image": [
"52",
2
],
"noise": [
"47",
0
],
"sampler": [
"46",
0
],
"sigmas": [
"49",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"55": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"41",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
HiDream E1.1 提供更高的畫質與編輯精度,特別適合需要高保真度且未編輯區域失真最小的任務。
流程透過 CLIPTextEncode 節點解析用戶提示詞,並引導圖像編輯過程,確保變更依指示執行。
雖然本流程設計為單張圖片編輯,但可透過迴圈方式批次處理多張圖片。
建議使用具備高效能 GPU 的系統,以應付 AI 模型的運算需求,特別是高解析度圖片。