🖼️ SF Scene Composer
Tensor-level alpha blending for putting characters on backgrounds — with a wiring gap you need to know about
- fury_bus
- optional_fg_mask
- bus
- composed_image
- fusion_mask
Scene Composer is the montage node - the one that takes a background and a character and physically places one on top of the other, in latent-adjacent tensor space, before anything gets generated into the scene. It's a compositor, not a generator: no model input, no sampling. You get a composed image, a mask, and an updated bus, all from pure tensor math done on the GPU.
Here's how it works. It pulls two assets off the bus - a background and a foreground, each selected by role - scales the foreground with scale, offsets it with x_offset/y_offset, and alpha-blends it onto the canvas using the classic FG * Alpha + BG * (1 - Alpha) formula. The coordinates get clamped so a character positioned half off-screen doesn't crash the node; it just crops naturally, which is nice for "walks in from the left edge" staging. Outputs are composed_image, a fusion_mask (the final silhouette, used downstream by the Action Animator to decide what's allowed to move), and an updated bus carrying the result as master_composition.
The inputs that matter:
- bg_role / fg_role - each is one of
scene_background,character_main,character_secondary,element_overlay. These are keys into the bus'sloaded_assets, which is where things get interesting (see the gotcha below). - x_offset / y_offset - integer pixel offsets, negative values allowed so a character can come in from off-camera.
- scale (0.1–5) and opacity (0–1) - size and blend strength. Scale is bilinear-resized on the GPU, so it's fast even if it's slightly soft.
- optional_fg_mask - an optional MASK input, meant for a background-removal mask (BiRefNet, rembg, whatever you've got - the KB's guidance applies here: pick your mask model by which edge failure you can tolerate). If you don't connect one, it uses a full rectangular alpha or whatever mask the loaded asset carries.
The outputs: bus (SF_LINK, now with master_composition), composed_image (IMAGE), fusion_mask (MASK). The first two feed Generative Fusion next; the mask feeds the Action Animator.
Install
Part of StudioFury: ComfyUI Manager → ComfyUI-Studio-Fury → Install → restart, or:
cd ComfyUI/custom_nodes/
git clone https://github.com/FuryNocturn/ComfyUI-Studio-Fury
Dependencies are just torch/Pillow/numpy/aiohttp. No downloads beyond the pack.
Gotchas - read this before wiring
Here's where the pack's rough edges are most visible. Scene Composer reads its assets from bus["loaded_assets"], keyed by those roles. But nothing in the shipped code writes loaded_assets. The pack's own Asset Loader returns bare IMAGE and LATENT outputs - it does not touch the bus. So the flow the README implies - load a character, load a background, compose them - doesn't connect out of the box: run it as documented and you'll hit the Spanish-language error telling you the roles aren't loaded. The fix is either a small patch (have a loader write into the bus under the role keys, which the code clearly expects) or feeding assets by another route - a custom node, a workflow tweak, anything that populates bus["loaded_assets"]["scene_background"] and bus["loaded_assets"]["character_main"] with {image, mask} dicts before this node runs. The FurySampler writes current_render to the bus, not loaded_assets, so it won't help you here on its own. Annoying, but it's one dict entry away from working, and the blending math itself is solid once you get there.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| fury_bus | SF_LINK | — | |
| bg_role | COMBO | scene_background | 4 options: scene_background, character_main, character_secondary, element_overlay |
| fg_role | COMBO | character_main | 4 options: scene_background, character_main, character_secondary, element_overlay |
| x_offset | INT | 0-4096–4096 | — |
| y_offset | INT | 0-4096–4096 | — |
| scale | FLOAT | 1.000.1–5 | — |
| opacity | FLOAT | 1.000–1 | — |
| optional_fg_maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| bus | SF_LINK | — |
| composed_image | IMAGE | — |
| fusion_mask | MASK | — |