Nodes/Comfy_HunyuanImage3/Hunyuan Instruct Image Edit
ComfyUI Node

Hunyuan Instruct Image Edit

Tell it what to change, in plain English

By EricRollei·Created 10 months ago·Updated 4 months ago· 65
Hunyuan Instruct Image Edit
  • model
  • image
  • image
  • cot_reasoning
  • status
instructionChange the background to a sunset scene
bot_taskimage
seed-1
system_promptdynamic
align_output_sizetrue
resolutionauto
steps-1
guidance_scale-1.0
flow_shift2.80
max_new_tokens2048
verbose0

"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. image applies your instruction as-is (fast). recaption has the model rewrite your instruction into a detailed edit description first (better for vague asks). think_recaption adds 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. Use image when your instruction is already precise.
  • seed - -1 for random.
  • resolution - auto (default) with align_output_size: true matches 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_unified covers 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.

CategoryHunyuan/Instruct

Inputs (13)

NameTypeDefaultDescription
modelHUNYUAN_INSTRUCT_MODEL
imageIMAGE
instructionSTRINGChange the background to a sunset sceneInstruction for how to modify the image
bot_taskCOMBOimageControls 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.
seedINT-1-1–2147483647-1 for random seed
system_promptoptCOMBOdynamicSystem 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_sizeoptBOOLEANtrueWhen 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.
resolutionoptCOMBOautoOutput resolution. 'auto' lets the model pick (or matches input if align_output_size=True). Otherwise overrides with a fixed preset.
stepsoptINT-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_scaleoptFLOAT-1.0-1–20CFG scale. -1 = auto (model's recommended value, typically 2.5)
flow_shiftoptFLOAT2.800–10Flow 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_tokensoptINT2048256–8192Maximum tokens for CoT reasoning and instruction rewriting. Only used with recaption or think_recaption modes. 2048 is usually sufficient.
verboseoptINT00–2Verbosity level. 0=silent (recommended), 1=info (shows full system prompt), 2=debug

Outputs (3)

NameTypeDescription
imageIMAGE
cot_reasoningSTRING
statusSTRING