Image_transform_layer_visual
Composite two images with a drag-to-place widget
- bj_img
- fj_img
- mask
- composite
- mask
- bg_fill
Same job as this pack's Image_transform_layer - put a foreground image onto a background at a position, rotation, and scale, with a real blend mode - but with the fiddly part removed. Instead of hand-typing a JSON coordinates string, this node lives in the pack's visualize_edit category and drives placement through transform_state, a compact state string ({"cx":0.5,"cy":0.5,"w":0.25,"h":0.25,"rot":0}) that the node's own interactive widget is built to edit directly on the canvas - you position the foreground by eye instead of by number. It's also flagged as an output node in the schema, meaning it's built to render its result inline rather than purely feed downstream nodes, which fits a "visual edit" tool you're actively looking at while you work.
How it works
transform_state packs everything the plain Image_transform_layer split across coordinates, coordinate_align, x_offset, y_offset, rotation, and scale into one bundle: cx/cy (center position, normalized 0–1), w/h (size, also normalized), and rot (rotation in degrees). You could still edit that string by hand if you wanted numeric precision, but the whole point of this node existing alongside the non-visual version is that you're meant to drag, resize, and rotate the foreground directly on the node's canvas and let it write the state string for you. Blending works exactly like its sibling node: blending_mode gives you the full Photoshop-style list (Normal/正常 default, Multiply, Screen, Overlay, and the rest of the 27-item set, labeled in Chinese), blend_strength controls how hard that mode applies, and opacity controls the layer's overall transparency.
The inputs and outputs that matter
bj_img/fj_img(required) - background and foreground.transform_state(STRING, JSON) - position/size/rotation, meant to be driven by the on-canvas widget rather than typed by hand.bg_fill- fallback color for uncovered canvas area.opacity(FLOAT, 0–1, default 1) - layer transparency.blending_mode- the Photoshop-style blend list, default Normal.blend_strength(FLOAT, 0–1, default 1) - blend mode intensity.- Optional
mask- constrain where the foreground composites.
Three outputs, matching Image_transform_layer: composite, mask, and bg_fill.
How to install it
ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt
install.bat is Windows-only; on Linux (comfy.icu's executor included) run pip install -r requirements.txt directly. No model downloads - pure compositing.
Common issues
If you're running ComfyUI headless or through an API without the browser UI open - which is exactly how comfy.icu executes workflows - the interactive drag widget this node is built around isn't there to use; you're working with transform_state as a plain JSON string same as Image_transform_layer's coordinates. In that context, the two nodes are functionally almost identical, and there's no advantage to the "visual" one - if you're driving this from the API rather than the editor UI, Image_transform_layer with its more granular numeric fields (x_offset/y_offset/rotation/scale as separate widgets, rather than one combined JSON blob) may actually be the easier one to script against.
The blend-mode dropdown displaying Chinese labels is expected - it's the pack's shipped enum values, not a broken locale. And as with every node in ComfyUI-Apt_Preset, a from-scratch install pulls a large requirements.txt (onnxruntime, gguf, transparent-background, and more, for the pack's other 100+ nodes) - there's a documented case of that install failing to import cleanly. If the whole pack throws IMPORT FAILED, the real missing-package error is in the ComfyUI console above the generic failure line.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| bj_img | IMAGE | — | |
| fj_img | IMAGE | — | |
| bg_fill | COMBO | black | 9 options: black, white, red, green, blue, yellow, +3 |
| opacity | FLOAT | 1.000–1 | — |
| blending_mode | COMBO | 正常 | 27 options: 正常, 溶解, 变暗, 正片叠底, 颜色加深, 线性加深, +21 |
| blend_strength | FLOAT | 1.000–1 | — |
| transform_state | STRING | {"cx":0.5,"cy":0.5,"w":0.25,"h":0.25,"rot":0} | — |
| maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| composite | IMAGE | — |
| mask | MASK | — |
| bg_fill | IMAGE | — |