Nodes/ComfyUI-KIE-Nodes-Next/Seedream5.0 Flash - Layer Decomposition
ComfyUI Node

Seedream5.0 Flash - Layer Decomposition

Split an image into layers you can actually use

By felipederosilva·Created about a month ago·Updated 6 days ago· 2
Seedream5.0 Flash - Layer Decomposition
  • image_url
  • image
  • url
  • all_urls_json
  • task_id
  • raw_json
  • credits_consumed
  • credits_left
◄promptSeparate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers►
◄size2K►
◄output_formatjpeg►
◄timeout_seconds1200►
◄callback_url►

Ever wanted to take a flattened image and get the text, the subject and the background back as separate pieces? That's this. You hand it a picture, optionally tell it what to cut out and roughly where, and the model returns a base image plus isolated layers.

It's a genuinely useful capability with an important ComfyUI-side caveat: the node's single IMAGE output is only the first result. The separated layers arrive in the URL outputs. More on that below, because it's the thing that makes people think the node is broken.

The bbox trick

The interesting input is prompt, and not for the reason you'd expect. Per its tooltip, it's optional in the API's terms:

  • give it a prompt and the model separates the elements you named;
  • leave it empty and the model picks out the main elements on its own;
  • include <bbox>x1 y1 x2 y2</bbox> and you're specifying coordinates rather than describing content.

The shipped default shows the syntax:

Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers

Coordinates are x1 y1 x2 y2 and the docs recommend normalised 0–1000 values, which is a gift - you can estimate them by eye from a grid overlay instead of measuring pixels. This is the difference between "it separated something" and "it separated the thing I meant", and it's the only real control you have.

Inputs and outputs

Required:

  • prompt - the separation instruction above, multiline.
  • image_url - singular IMAGE socket. One image; batch something into it and the pre-check stops you before upload.

Optional:

  • size - 2K (default), auto, 1K, 1.5K. The base image keeps the input's aspect ratio, and so does each separated layer.
  • output_format - jpeg (default) or png. Read the tooltip carefully: this only governs the base image. Separated layers are always PNG, which is what you want - you need the alpha channel.
  • timeout_seconds - default 1200. Layer work is slower than a plain generation, so this has more headroom than you'd think for a reason.
  • callback_url - leave empty.

Outputs: image, url, all_urls_json, task_id, raw_json, credits_consumed, credits_left.

Where the layers actually are

Here's the part that trips people up. The node downloads the first preferred result URL into the image tensor and puts every URL the provider returned into all_urls_json, with url holding the primary one. A decomposition returns a base image plus N layer images - so image gives you one layer, and the rest live in that JSON list.

So the working pattern is: read all_urls_json, then either fetch those URLs yourself with a download node, or wire them through the pack's download helpers to bring each layer into the graph as its own IMAGE. If you queue this node, see one image, and conclude the separation failed, you've got the wrong output socket.

Keep the task_id too - KIE • Reuse Completed Image retrieves a completed task's results by ID without resubmitting, which matters when a single run of this models several layers at once and you'd rather not pay for it again.

Installing the pack

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
cd ComfyUI-KIE-Nodes-Next
pip install -r requirements.txt

Restart. The pack's dependencies are just requests, Pillow, numpy and PyYAML - Pillow is what decodes the returned layers into tensors.

Save your key once under Settings → KIE.ai Nodes Next → Connection. It's verified against KIE before replacing a working key, stored in ComfyUI's user config directory rather than your workflow, and never handed to the frontend in full. Environment variables aren't supported.

One pack-level warning: if you upgrade by copying files over an existing install, ComfyUI refuses to load a mixed-version pack and tells you to delete the folder and reinstall. Heed it - the alternative is stale generation code quietly running.

Gotchas

Only one image came back. Covered above: check all_urls_json before assuming failure.

It separated the wrong things. Add explicit <bbox> coordinates. Free-text descriptions of location ("the parrot on the left") are much weaker than normalised boxes, and the model's idea of "main elements" is not yours.

No alpha on a layer. You set output_format to jpeg and expected transparency. Base image format and layer format are separate - layers are always PNG regardless.

Node missing from the menu. These nodes are generated from KIE's live API catalog. Restart to trigger the sync, or add the KIE Next · Catalog Sync node and run it. Search for "Layer Decomposition", not the hashed class name.

CategoryKIE Next/Image/ByteDance/Seedream

Inputs (6)

NameTypeDefaultDescription
promptSTRINGSeparate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layersOptional prompt for layer separation. - When a prompt is provided, the model separates the specified elements based on the prompt - When no prompt is provided, the model automatically identifies the main elements in the image - Supports using `<bbox>x1 y1 x2 y2</bbox>` to precisely specify element positions, recommending the use of normalized coordinates in the 0-1000 range
image_urlIMAGE—
sizeoptCOMBO2KResolution level of the output image. The base image maintains the aspect ratio of the input image, and each separated layer maintains the aspect ratio of the corresponding element in the original image. - `auto`: Automatically selected based on the input image size - `1K`: 1K resolution level - `1.5K`: 1.5K resolution level - `2K`: 2K resolution level
output_formatoptCOMBOjpegOutput format of the base image. This parameter only controls the base image format; all separated layers are fixed to output as PNG.
timeout_secondsoptINT120030–7200—
callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

Outputs (7)

NameTypeDescription
imageIMAGE—
urlSTRING—
all_urls_jsonSTRING—
task_idSTRING—
raw_jsonSTRING—
credits_consumedFLOAT—
credits_leftFLOAT—