Nodes/Comfyui-zhenzhen/zhenzhen-image-gk-v2-region-edit
ComfyUI Node

zhenzhen-image-gk-v2-region-edit

Edit one object inside an image, not the whole canvas

By T8mars·Created about a year ago·Updated 2 days ago· 740
zhenzhen-image-gk-v2-region-edit
  • api_config
  • image
  • image_url
  • task_id
  • response
image_id
prompt
selection_modeobject_indices
selection_json[0]
skip_errorfalse
seed0

Full-canvas image editing is easy; editing just the chair without touching the room is the hard part. Comfly_zhenzhen_image_gk_v2_region_edit_lowprice is the GK V2 tool for exactly that. You give it an image_id, tell it what to change in prompt, and select where using one of three selection modes - object indices, bounding boxes, or region JSON - and the model rewrites only that part of the image. Output is a fresh image plus image_url, task_id, and response.

It's the downstream half of a two-node pair: the segment node detects objects and hands you an image_id; this node takes that id and does the regional surgery. It shipped in the August domestic-storefront drop as part of the GK V2 image-tools family.

How it works

The selection system is the whole story. selection_mode picks the vocabulary, selection_json supplies the coordinates:

  • object_indices - reference objects by their index from the segmentation step. Default [0] means "the first detected object." This is the clean path: segment → pick an index → edit.
  • boxes - pixel bounding boxes as JSON lists of numbers. For when you know the region without running segmentation.
  • selection_regions - JSON objects describing regions, the most flexible but also the most fiddly.

image_id is required and comes from the segment node's image_id output (or from a segmentation-enabled image task). prompt is the edit instruction for that region only. The node validates that selection_json parses and matches the mode before submitting - a malformed JSON list is rejected with a clear error, which is nicer than most of the pack.

Installing and setting up

Install through ComfyUI Manager (search Comfyui-zhenzhen) or:

cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen

Restart ComfyUI. No model downloads. Connect the Comfly Seedance2 Low Price Settings node's api_config, or set SEEDANCE_API_KEY. The pack ships a workflow chaining segment → region-edit.

Troubleshooting

The family tripwire: no api_config, "empty api_key." Specific to this node - the biggest confusion is where image_id comes from. It's not a task id; it's the segment node's image_id output. Wiring a raw task_id in here produces nonsense or an error. Second, object indices are zero-based and order-dependent - index [2] today might be index [3] after a different segmentation run, so re-run segmentation if the source image changed. And keep the prompt scoped to the region; regional edits assume "change this one thing," so describe that thing, not the whole scene. skip_error is available.

This is a genuinely useful node once the pairing clicks. Inpainting-in-the-cloud with no mask drawing, no SAM install, no VRAM - just object indices and a prompt.

Categoryzhenzhen/Seedance2 Low Price/Image Tools

Inputs (7)

NameTypeDefaultDescription
image_idSTRING
promptSTRING
selection_modeCOMBOobject_indices3 options: object_indices, boxes, selection_regions
selection_jsonSTRING[0]
api_configoptZHENZHEN_SEEDANCE2_CONFIG
skip_erroroptBOOLEANfalse
seedoptINT00–18446744073709550000Execution seed for ComfyUI cache control. Fixed reuses the cached result; randomize/increment/decrement requests a new run. This compatibility seed is not sent to APIs that do not expose a native seed parameter.

Outputs (4)

NameTypeDescription
imageIMAGE
image_urlSTRING
task_idSTRING
responseSTRING