Nodes/ComfyUI Seedance/Zhenzhen Image GK v2 区域编辑
ComfyUI Node

Zhenzhen Image GK v2 区域编辑

Change one object in a picture, leave the rest exactly alone

By T8mars·Created 2 months ago·Updated 3 days ago· 31
Zhenzhen Image GK v2 区域编辑
  • api_config
  • image
  • image_url
  • task_id
  • response
image_id
prompt
selection_modeobject_indices
selection_json[0]
skip_errorfalse
seed0

This is the payoff node of the GK v2 "segment then edit" pipeline. Zhenzhen_Image_GK_V2_Region_Edit takes the image_id produced by Zhenzhen_Image_GK_V2_Segment, takes your edit instruction, and regenerates only the region you selected - the rest of the picture stays put. It's server-side masked editing, and it answers the exact complaint that kept masks alive in the local world: whole-image instruction editors drift the parts you wanted untouched, while a region edit changes precisely what you point at.

The KB's inpainting essay makes this case cleanly - edit models like Qwen/Kontext take the whole image into context and emit a whole new image, so unmasked regions come back "close but not identical," and the drift compounds across a chain of edits. That's the failure this node is built to avoid, and it's the reason this whole family is structured as segment → region-edit rather than just "describe the edit."

How it works

Three inputs do the work. image_id is the link from the segmentation node. prompt is the edit instruction for the target region. And the pair selection_mode + selection_json decides which region:

  • object_indices (default) - target objects by their index in the segmentation, e.g. [0] for the first detected object.
  • boxes - target by bounding boxes described in JSON.
  • selection_regions - target by explicit region structures.

The default selection_json is [0], so the quickest way to learn this node is: segment, then edit object zero. The node validates that your JSON parses and matches the mode before it spends any credits, which is a nice touch - bad selections fail cheap.

Inputs and outputs that matter

  • image_id - required; from the GK v2 segment node's image_id output.
  • prompt - the region edit instruction.
  • selection_mode - object_indices, boxes, or selection_regions.
  • selection_json - JSON list matching the mode; default [0].

Outputs: image (a real ComfyUI IMAGE this time), image_url, task_id, response.

Install

One node in T8mars/ComfyUI_Seedance:

# ComfyUI Manager: search "ComfyUI Seedance", or:
comfy node install seedance

Or clone https://github.com/T8mars/ComfyUI_Seedance.git into ComfyUI/custom_nodes, pip install -r requirements.txt, restart, and configure a key from api.seedance.nz/console via the Seedance API Config node or SEEDANCE_API_KEY.

Where people get burned

Mostly by the chain. This node cannot run on its own - no image_id, no job, and the strict validation will say so. If you land here from a search, know the full flow is: generate with a GK v2 image node → take its task_id into the segment node → take that node's image_id into here. Second, the pack's changelog mentions the segment/region path supports 30-way image concurrency for batch work - but for a first run, don't. One segment, one region, confirm the selection_json matches the mode you picked (a boxes selection against object_indices will fail validation). And the usual hosted-model rule: the edit happens on their server, your images are already there from the generation step, and moderation applies to the prompt regardless.

CategorySeedance/Image Tools

Inputs (7)

NameTypeDefaultDescription
image_idSTRINGimage_id returned by the GK v2 segment node. | GK v2 分割节点返回的 image_id。
promptSTRINGRegion editing instruction. | 区域编辑指令。
selection_modeCOMBOobject_indicesHow the target region is described. | 目标区域描述方式。
selection_jsonSTRING[0]JSON list matching the selected mode. | 与选择方式匹配的 JSON 数组。
api_configoptSEEDANCE_CONFIGConnect Seedance API Config; otherwise SEEDANCE_API_KEY is used.
skip_erroroptBOOLEANfalseOn failure return a placeholder image instead of stopping. | 失败时输出占位图片而不中断工作流。
seedoptINT00–18446744073709550000ComfyUI cache seed. Fixed reuses the cached result while all other inputs stay unchanged; randomize/increment/decrement starts a new execution. This value is not sent to models without documented seed support. | ComfyUI 缓存种子;Fixed 在其他输入不变时复用缓存,随机、递增或递减会触发新任务。未声明支持 seed 的模型不会收到此参数。

Outputs (4)

NameTypeDescription
imageIMAGE
image_urlSTRING
task_idSTRING
responseSTRING