Hunyuan Instruct Image Edit
Tell it what to change, in plain English
- model
- image
- image
- cot_reasoning
- status
"Hunyuan Instruct Image Edit" is the node that does what it says on the tin: hand it an image and an instruction like "change the background to a sunset scene," and it edits the image. No masks, no inpaint gymnastics, no ControlNet - just a sentence. It runs on the Instruct family of HunyuanImage-3.0, which is autoregressive, so the model literally reasons about your instruction before it generates. That's the whole differentiator: you're not describing pixels, you're having a conversation with an image model.
The inputs that matter
- image - the IMAGE to edit (from Load Image).
- instruction - your edit, in plain language. The model understands English and Chinese.
- bot_task - the biggest decision.
imageapplies your instruction as-is (fast).recaptionhas the model rewrite your instruction into a detailed edit description first (better for vague asks).think_recaptionadds a chain-of-thought pass that reasons about what to change and what to preserve - the tooltip calls it "BEST QUALITY," and the warning is equally blunt: the CoT text generation adds minutes before editing even starts. Useimagewhen your instruction is already precise. - seed - -1 for random.
- resolution -
auto(default) withalign_output_size: truematches the input image's dimensions (snapped to multiples of 16), which keeps 2K+ inputs at 2K+. Set a fixed preset to force an output size instead. - steps / guidance_scale - both default to -1 (auto: 8 steps for Distil, 50 for full; CFG ~2.5). Push steps to 60–80 at 2K+ to reduce flow-matching artifacts.
- flow_shift - the denoising schedule shape, default 2.8. 2.0–2.5 for portraits (sharper), 3.5–5.0 for landscapes/illustrations.
- max_new_tokens - cap for the CoT/rewrite output, default 2048.
- system_prompt -
dynamic(default) picks the right prompt for your bot_task;en_unifiedcovers every edit mode including style transfer and text editing.
Outputs: image (the edit), cot_reasoning (a STRING of the model's thinking - fascinating to read, and genuinely useful for debugging why an edit went sideways), and status.
Workflow shape
Load Image → Hunyuan Instruct Image Edit → Save Image
The model input comes from the Hunyuan Instruct Loader. Both must be Instruct - the base loaders are a different output type and won't plug in.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Comfy_HunyuanImage3
cd Comfy_HunyuanImage3
pip install -r requirements.txt
Restart ComfyUI, or use ComfyUI Manager (search "Comfy_HunyuanImage3"). You need an Instruct model in ComfyUI/models/ - the Distil-NF4 (~45GB) is the entry point for 48GB cards; Distil-INT8 (~81GB) is the 96GB recommendation. Since this is an autoregressive model rather than diffusion, don't expect classic img2img semantics - edits can be surprisingly strong, which is why think_recaption exists to keep the model from "improving" things you wanted preserved.
The honest caveat
It's slow. The model is 80B parameters, and recaption/think_recaption run a full text-generation pass before a single diffusion step. Budget several minutes per edit on the Distil variants, more on full Instruct. And the author's known-issues list still shows edge OOM handling on Image Edit - if a big 2K+ input blows up on a 48GB card, drop to the ~1MP preset or a smaller input rather than fighting it.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | HUNYUAN_INSTRUCT_MODEL | — | |
| image | IMAGE | — | |
| instruction | STRING | Change the background to a sunset scene | Instruction for how to modify the image |
| bot_task | COMBO | image | Controls how the model processes your edit instruction. • image: Direct edit — your instruction is applied as-is. • recaption: The model rewrites your instruction into a detailed edit description (preserving elements, specifying changes) then applies the edit. • think_recaption: (BEST QUALITY) The model first reasons about what to change and what to preserve using CoT analysis, rewrites the instruction, then edits. Best for complex edits like style transfer, element replacement, or multi-step changes. WARNING: recaption and think_recaption add several minutes of autoregressive text generation before the edit starts. Use 'image' for direct editing when your instruction is already clear. |
| seed | INT | -1-1–2147483647 | -1 for random seed |
| system_promptopt | COMBO | dynamic | System prompt guiding the model's edit behavior. dynamic (recommended) auto-selects the best prompt for your bot_task. en_unified covers all editing modes including replacement, addition, removal, style transfer, and text editing. The model understands both English and Chinese instructions natively. |
| align_output_sizeopt | BOOLEAN | true | When resolution='auto': True (default): generate at the input image's exact dimensions (snapped to a multiple of 16 for VAE/patch alignment). The default bucket-snapping in the upstream image_processor is bypassed for this call so 2K+ inputs stay at 2K+. Higher resolutions use significantly more VRAM. False: let upstream pick the closest trained aspect-ratio bucket (~1MP). Ignored when resolution is set to a specific preset. |
| resolutionopt | COMBO | auto | Output resolution. 'auto' lets the model pick (or matches input if align_output_size=True). Otherwise overrides with a fixed preset. |
| stepsopt | INT | -1-1–100 | -1 for auto (8 for Distil, 50 for full Instruct). Higher step counts (60–80) reduce flow-matching artifacts at 2K+ resolutions but generation time scales linearly — expect a much longer wait. |
| guidance_scaleopt | FLOAT | -1.0-1–20 | CFG scale. -1 = auto (model's recommended value, typically 2.5) |
| flow_shiftopt | FLOAT | 2.800–10 | Flow shift for the diffusion scheduler. Controls denoising schedule shape. Default 2.8 is balanced. Presets: Portraits / faces: 2.0–2.5 (sharper detail). Landscapes / illustrations: 3.5–5.0 (cleaner gradients). |
| max_new_tokensopt | INT | 2048256–8192 | Maximum tokens for CoT reasoning and instruction rewriting. Only used with recaption or think_recaption modes. 2048 is usually sufficient. |
| verboseopt | INT | 00–2 | Verbosity level. 0=silent (recommended), 1=info (shows full system prompt), 2=debug |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| cot_reasoning | STRING | — |
| status | STRING | — |