Nodes/comfyui-PD_comfy-api-node/PD: Seedream 5.0 Pro Layer Separation (comfyui_apikey)
ComfyUI Node

PD: Seedream 5.0 Pro Layer Separation (comfyui_apikey)

Seedream 5.0 layer separation via your Comfy key

By 7BEII·Created 9 months ago·Updated a day ago· 2
PD: Seedream 5.0 Pro Layer Separation (comfyui_apikey)
  • image
  • base_image
  • base_mask
  • layers
  • masks
  • bboxes
  • layer_stack
comfy_api_key
prompt
sizeauto
seed0
prompt_optimizationstandard
watermarkfalse
crop_layersfalse

The node that unpacks a whole image for you

"PD: Seedream 5.0 Pro Layer Separation (comfyui_apikey)" does something no local node in this pack does: it takes one image and hands back the image broken into its separate elements - the person, the logo, the prop, each as its own layer with its own mask and bounding box. Think of it as "extract every element" as a cloud call, instead of you painting masks by hand for the compositing/inpainting part of your workflow.

This only exists as a cloud feature, and here's the ByteDance context: Seedream 5.0 Pro is API-only. ByteDance's posture is components open, products closed - its entire Seedream/Seedance line is a paid API, and layer decomposition ships on the closed product. So the only door into it is an API call, and this node is a door shaped like a Comfy node, routing through Comfy's proxy with your comfy_api_key.

How it works

The node uploads your image to Comfy's storage, then POSTs to the ByteDance images/generations proxy with layer_decomposition: true. It gets back the base image plus each separated layer as a PNG (with alpha), downloads them all, and does the geometry work locally: masks computed from alpha, bounding boxes, and a versioned layer_stack (LAYERS) that LAYERS-aware compositing nodes can consume. There's real care in here - layers get z-ordered, bbox-clamping is flagged when the API returns something odd, and crop_layers switches between a tight minimal-size canvas per layer and the full-canvas layout.

The inputs that matter

  • comfy_api_key - your key from comfy.org/api-keys.
  • image - exactly one image, and it has to be at least 512x512 with an aspect ratio between 1:16 and 16:1, or the node refuses before spending your money. Good behavior, honestly.
  • prompt - leave empty and it separates all major elements automatically. Give it text to steer what gets pulled apart.
  • crop_layers - off (default) puts every layer on the full canvas so positions line up with the original; on trims each layer to its content for tight, ready-to-move elements.
  • size (auto/1K/1.5K/2K), seed, prompt_optimization (standard/fast), watermark - the rest of the standard dials.

Outputs - this is the payoff

Six of them: base_image and base_mask (the clean background and its mask), layers and masks (the separated elements and their masks), bboxes (BOUNDING_BOX, one per layer with name/description/z-index metadata), and layer_stack (LAYERS) for compositing. That's the full grammar for "move the subject, re-color the background, swap the logo" workflows - feed the layers into mask/bbox-aware compositing nodes and you're doing professional-style edits without painting a single mask.

Install and gotchas

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/comfyui-PD_comfy-api-node.git
pip install -r comfyui-PD_comfy-api-node/requirements.txt

Restart, find it under PD_Tools/Image_Generation. No model downloads; it's a network node, and a patient one - the request timeout is 1800 seconds because layer decomposition is slow on ByteDance's side.

Where people get burned: feeding a small or very weird aspect-ratio image (it errors before billing, which is the good kind of burn), expecting a deterministic result (it's a live cloud model, seed notwithstanding), and forgetting this is metered - every call costs Comfy credits, and the base image plus each layer are separate downloads. Local segmentation tools can approximate the job for free, but nothing open-weight does this exact "layers + masks + boxes + stack" hand-off yet; that's the honest appeal of the node.

CategoryPD_Tools/Image_Generation

Inputs (8)

NameTypeDefaultDescription
comfy_api_keySTRING
imageIMAGEExactly one image, at least 512x512 pixels.
promptSTRINGLeave empty to separate all major elements automatically.
sizeCOMBOauto4 options: auto, 1K, 1.5K, 2K
seedINT00–2147483647
prompt_optimizationCOMBOstandard2 options: standard, fast
watermarkBOOLEANfalse
crop_layersBOOLEANfalse

Outputs (6)

NameTypeDescription
base_imageIMAGE
base_maskMASK
layersIMAGE
masksMASK
bboxesBOUNDING_BOX
layer_stackLAYERS