Nodes/SpicyAPI/Seedream 5.0 Flash · Layer Decomposition
ComfyUI Node

Seedream 5.0 Flash · Layer Decomposition

Turn a flat PNG into sixteen movable layers

By spicyapi-ai·Created 21 days ago·Updated 2 days ago· 2
Seedream 5.0 Flash · Layer Decomposition
  • image_url
  • images
  • alpha
  • task id
◄prompt►
◄resolutionauto►
◄output_formatjpeg►
◄seed0►

This one is the quiet oddity in the Seedream set. You don't generate anything - you hand it a finished image and it takes the picture apart: a clean base plate with the foreground elements removed, plus up to sixteen transparent PNG layers, one per thing it found, each with a position.

If you've ever tried to move a subject in a finished render, you know the pain: inpainting the hole, matching grain, rebuilding the shadow it was standing on. Layer decomposition attacks the same problem from the other end. Useful for poster and thumbnail work where the client says "can the logo be higher", for slicing a character out of a scene to re-use, or for feeding a transparent element into a video workflow. It is also the closest thing to a magic trick in the pack, and it is priced like the cheap one: $0.026 per image.

What actually happens

The node uploads your single source image, requests a quote, submits the task, and waits. SpicyAPI returns the base plate plus the cut-out layers; the pack hands the whole batch back on the images output as a ComfyUI IMAGE batch, with the corresponding transparency on the alpha MASK output. Layer pixels are always transparent PNG on the server side - the output_format dropdown only controls the container of the base image.

One practical consequence of it being a batch: Save Image writes one file per image in the batch, so you'll get the plate and every layer as separate files with the usual numeric suffixes. Nothing to configure for that; just don't be surprised by the file count.

The inputs

  • image_url - the finished image to split. One source only.
  • prompt - optional, and genuinely optional. Leave it empty and the model picks the main elements itself; fill it in to name what you want separated. This is the field to use when a decomposition comes back as "background / everything else" and you wanted the two characters on their own.
  • resolution - auto follows the source's own size, otherwise a fixed tier. Auto is usually what you want since the output has to sit back on top of the plate.
  • output_format - the base image's format. Layers ignore it.

Outputs: images (batch of the plate plus layers), alpha (the transparency mask), task id (the SpicyAPI request id, for the console or support).

Where this fits in a workflow

Two honest uses. First, as a finishing move: generate locally, decompose, then recompose in your editor or in ComfyUI with the alpha masks. Second, as a way to harvest assets - a background, a prop, a character - out of images you already like, without re-prompting and hoping. What it is not is a segmentation node you can trust for pixel-accurate mattes; the elements come back named and positioned, which is great for layout and not always perfect for hair-level edge work. If the edge quality matters more than the layering, a local matting pass on top is still the right call.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi

Restart ComfyUI, paste a key from spicyapi.ai/console/keys into Settings > SpicyAPI (or set SPICY_API_KEY), restart once more. Managers: search SpicyAPI. The pack installs no dependencies and downloads no weights - every model runs on the server, so this works fine on a laptop or a CPU-only box.

Costs and gotchas

$0.026 per image, quoted before the run and printed after it. Set Settings > SpicyAPI > Max cost per run as a ceiling; anything quoted above it refuses to submit rather than charging you. The pack defaults seeds to fixed so re-queueing doesn't buy a duplicate, and cancelling a run locally doesn't cancel the job on SpicyAPI - it finishes server-side and gets charged if it succeeds, with the result sitting in your console for a fortnight.

Common errors are the pack-wide ones: No SpicyAPI key is set when the key isn't configured, 40310 if your email isn't verified, 40004 if the option combination isn't served (the message names what to change, and nothing is billed). If your node list looks short, restart ComfyUI - it's rebuilt from your account at each start.

CategorySpicyAPI/Image/ByteDance

Inputs (5)

NameTypeDefaultDescription
image_urlIMAGEThe finished image to split into layers.
promptSTRINGOptional: name the elements to separate. Leave empty to let the model pick the main elements.
resolutionCOMBOautoOutput resolution tier. auto follows the size of the source image.
output_formatCOMBOjpegFile format of the base image. Layers are always transparent PNG.
seedINT00–2147483647This model takes no seed, so the number is never sent. Changing it makes ComfyUI run the node again: set 'control after generate' to randomize for a new result on every run; every run is billed.

Outputs (3)

NameTypeDescription
imagesIMAGE—
alphaMASKTransparency of each image: 1 is opaque.
task idSTRINGThe SpicyAPI task id, for the console logs or support.