PD: Seedream 5.0 Pro Layer Separation (comfyui_apikey)
Seedream 5.0 layer separation via your Comfy key
- image
- base_image
- base_mask
- layers
- masks
- bboxes
- layer_stack
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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| comfy_api_key | STRING | — | |
| image | IMAGE | Exactly one image, at least 512x512 pixels. | |
| prompt | STRING | Leave empty to separate all major elements automatically. | |
| size | COMBO | auto | 4 options: auto, 1K, 1.5K, 2K |
| seed | INT | 00–2147483647 | — |
| prompt_optimization | COMBO | standard | 2 options: standard, fast |
| watermark | BOOLEAN | false | — |
| crop_layers | BOOLEAN | false | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| base_image | IMAGE | — |
| base_mask | MASK | — |
| layers | IMAGE | — |
| masks | MASK | — |
| bboxes | BOUNDING_BOX | — |
| layer_stack | LAYERS | — |