Commit Graph

910 Commits

Author SHA1 Message Date
Purz
86907df9aa feat(compositor): Layers From Bounding Boxes
Adapter node: IMAGE (batch) + BOUNDING_BOX (+ MASK, + LAYERS) -> LAYERS.
One document item per frame, each placed by its own box.

Why this is needed. A node that separates an image into elements emits
them as an image batch plus a list of boxes. That batch cannot be fed to
Create Layered Image with the placement intact, because
`expand_item_frames` applies the item's single x/y/w/h/name/z_index to
every frame of a batch. Sixteen layers get one placement between them.

The current workaround is to have the producer pre-place each layer on a
full-size canvas so x=0,y=0 is correct for all of them. That works but is
expensive: at 2K with 16 layers it carries ~768MB of layer tensors and
~268MB of masks to encode what cropped layers hold in a fraction of it.

This node emits one item per layer instead, so each carries its own
placement. It needs no change to the existing compositor path:
`document_items` already sorts by z_index, and `expand_item_frames`
already handles single-frame items correctly - the shared-placement
limitation only bites on batches.

Reads `metadata.name`, `metadata.z_index` and `metadata.content_rect`
where present. `crop_to_content` trims each frame out of a padded batch
and places it by its box, which is what recovers the memory win.

Also restores a `_bbox_list` parser. The equivalent (`_bbox_entries`,
`layout_bboxes`, `state_from_bboxes`) was removed in 1c4953ff along with
the rest of the bbox handling when the node moved to the LAYERS document,
so there is currently no path from a bounding box into the compositor.

Verified: two padded layers with different content sizes, cropped and
placed independently, composite to within 0.50/255 of expectation - the
8-bit quantisation floor of the PIL round trip inside the compositor.
The 76 existing compositor tests still pass.
2026-08-07 02:00:57 -04:00
Terry Jia
5e34e441c8 feat: carry rotation and scale on layer items 2026-08-07 00:26:49 -04:00
Terry Jia
3b3c61dd49 fix: version-gate saved compositions and reset them on initial property changes 2026-08-06 23:03:58 -04:00
Terry Jia
1c4953ff9d feat: LAYERS io type with a chainable Add Layer builder 2026-08-06 22:16:34 -04:00
Christian Byrne
d36bc61a3e test(compositor): pin blend behaviour to a golden fixture; fix luminosity (#15373)
Blending exists in two implementations - the numpy compositor and the
layerBlend.frag shader that drives the live preview - with nothing holding
them together. They have already diverged once (the safeDiv operand), and a
divergence only shows up to the user as 'the render does not match the
preview'.

Adds compositor_blend_golden.json: every mode, at both endpoints, the
midpoint and inside each epsilon guard. Any implementation of these 26 modes
must reproduce it. compositor_blend_test.py pins the numpy side to it and
additionally spells out the boundary rules by hand, so the guards cannot be
re-broken by regenerating the fixture.

Diffing the shader against the numpy implementation over that grid leaves
exactly one mismatch: luminosity. safe_div guards the denominator and
returns 0, so a luminosity layer over a black or near-black backdrop
disappears. The backdrop has no hue or saturation to preserve there, so the
result should be a neutral grey at the layer's luminance - which is also the
analytic limit of i * lum(l)/lum(i) as the backdrop approaches black. The
matching four-line shader change is proposed on the frontend PR; with both
applied all 26 modes agree.

Also clamps layer opacity to [0, 1]. The layer state round-trips through the
saved workflow and is accepted verbatim on /prompt, so it is untrusted
input; the canvas is only clamped once, after the last layer, so an
out-of-range coverage multiplier changes the blend of every layer above it.
_parse_background already clamps the same field.
2026-08-06 22:14:37 -04:00
Terry Jia
9232943a2c feat: single batched inputs, transparent default, experimental flag 2026-08-06 19:25:35 -04:00
Terry Jia
9e5cb77906 fix: align blend mode boundary behavior with the editor shader 2026-08-06 17:52:57 -04:00
Terry Jia
b6b2572cd9 fix: address compositor review feedback 2026-08-06 14:49:40 -04:00
Terry Jia
19467819d3 feat: compositor transparency, max canvas, and layer order replay 2026-08-06 00:54:02 -04:00
Terry Jia
a444ba34b9 feat: ImageCompositor node with layer-state compositing 2026-08-05 10:32:03 -04:00
Jukka Seppänen
57500fc5bc feat: Support MiniMax-H3 (CORE-375) (#15224) 2026-08-02 22:28:29 -04:00
comfyanonymous
e0951a9c7e Let the save text node save in csv format. (#15217) 2026-08-01 22:27:37 -04:00
Jukka Seppänen
49a7422892 Support latent previews for nested latents (#15196) 2026-08-01 19:57:15 -04:00
comfyanonymous
e803f24ea0 Let the VAEDecodeAudio node decode nested audio. (#15211) 2026-08-01 16:38:42 -04:00
comfyanonymous
235b466a0c Add crf option to save video node. (#15191) 2026-08-01 00:27:48 -04:00
Terry Jia
5cc026f5b8 fix: resend cached histogram UI for CurveEditor after page refresh (#15152) 2026-07-31 03:07:31 -04:00
Kohaku-Blueleaf
42d2aa5543 [Dataset/Security,Feature] Add dataset folder to avoid arbitrary folder access for dataset stuff. (#14807) 2026-07-28 19:03:04 -04:00
Jukka Seppänen
a3572c4832 Allow using float fps for LTXVEmptyLatentAudio (#15106) 2026-07-27 13:04:14 -07:00
Jukka Seppänen
6f6c500c15 Improve LTXV IC-lora detection (#15073) 2026-07-25 14:30:37 +03:00
Jukka Seppänen
45ffd5430b feat: Support MageFlow (CORE-372) (#15026) 2026-07-24 23:14:01 -04:00
rattus
f8a3fd9d79 upscalers: convert latent_upsampler model to DynamicVram (#15063)
These were alll non-dynamic (some non-ModelPatcher) code path calling
FreeMemory for management requiring up-front memory freeing. Convert it
to dynamic to avoid legacy free behaviour mixing into otherwise
dynamic workflows.
2026-07-24 13:34:40 -07:00
Barish Ozbay
ac3a7a654f Add native Uni3C Controlnet support for Wan models (CORE-365) (#14946)
* Add native Uni3C controlnet support for Wan models

* Dispatch double_block patches in all Wan model variants

* Remove unused grid_sizes assignment in CameraWanModel, WanModel_S2V, HumoWanModel, and AnimateWanModel
2026-07-21 15:44:14 +03:00
TheToxin-git
593786e489 FreSca: 5D+ (ex. Anima) fix, model-agnostic iteration (#15007)
* FreSca: Make fresca work on multi dim
2026-07-21 14:43:34 +03:00
Kohaku-Blueleaf
d0fec2ef7e [Trainer,Dataset/Feature] Video processing nodes, Image Processing Node video support, trainer video support (CORE-81) (#13588) 2026-07-21 00:02:54 -04:00
comfyanonymous
0f42ba5146 Support anima lllite control models. (#14954)
Put them in the models/model_patches folder. Use the new AnimaLLLiteApply node.
2026-07-17 07:36:21 -07:00
彼彼
03978e1e81 [feat]Add JoyImageEdit native model support (#14428) 2026-07-15 23:48:28 -04:00
Terry Jia
0aecac867d Fix 3D advanced nodes crashing in API mode (no UI) (#14930) 2026-07-14 10:07:23 +08:00
Alexander Piskun
ec0e8b3447 fix(image): support single-channel images in Save Image (Advanced) (#14761)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-07-13 11:38:50 +03:00
Alexander Piskun
8deaa4d911 fix(image): correct HLG inverse-OETF clamp in hlg_to_linear (#14762)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-07-13 10:53:37 +03:00
Gustavo Schneiter
8b099de36a Fix SaveVideo description: says images, saves video (#14885) 2026-07-12 12:58:25 +08:00
Alexis Rolland
1f51e146a8 chore: Update preview nodes (#14871) 2026-07-10 19:32:53 -04:00
Alexis Rolland
5976ee37cd Bringing back the text node (#14870) 2026-07-10 19:31:39 -04:00
Terry Jia
328144ce24 CORE-329 feat: add Save 3D (Advanced) node family (#14701) 2026-07-11 04:03:34 +08:00
Terry Jia
8310b0e0db feat: add bboxes input to Create Bounding Boxes node (#14724) 2026-07-11 03:58:03 +08:00
Yousef R. Gamaleldin
94fa08223e Save Text Node (CORE-176) (#14102) 2026-07-11 03:54:56 +08:00
John Pollock
8e2e54e2b8 Add SeedVR2 support (CORE-6) (#14424) 2026-07-10 15:07:42 +08:00
Terry Jia
04a30fb375 fix: Load3D failing path validation from double path resolution (#14852) 2026-07-09 22:42:20 +08:00
Barish Ozbay
51bf508a0b feat: Implement basic text overlay node (CORE-137) (#14610) 2026-07-07 21:26:52 +08:00
Alexis Rolland
7f287b705e fix: Bug when setting transparency in color picker (#14764) 2026-07-04 19:13:38 -04:00
Alexis Rolland
6e11828d10 chore: Update nodes categories (#14674) 2026-07-01 05:20:20 +08:00
pythongosssss
603d891eaf Update GLSL node to use ANGLE library (CORE-162) (#13195) 2026-06-27 08:40:31 +08:00
Terry Jia
dac4ea3a80 feat: Bounding boxes canvas and Ideogram JSON prompt (#14537) 2026-06-25 22:34:09 +08:00
comfyanonymous
64e1d740b8 Add advanced krea 2 model merging node. (#14621) 2026-06-24 20:37:30 -07:00
Yousef R. Gamaleldin
b22d0fb9c0 feat: Add Support For Simple Seed (CORE-295) (#14616) 2026-06-25 09:39:10 +08:00
Alexis Rolland
b0f9e326af Add output socket to save nodes (#13866) 2026-06-22 10:15:28 +08:00
Alexis Rolland
69d34f2654 Rename a bunch of nodes (#14547) 2026-06-20 08:01:28 +08:00
Barish Ozbay
cd77c551d6 feat: Context Windows sampling with LTX2 models and IC-LoRa guides (CORE-3) (#13325) 2026-06-20 07:47:31 +08:00
Terry Jia
2ab3816dcf feat: add Load3DAdvanced node (#14316) 2026-06-20 07:06:55 +08:00
Matt Miller
94ee49b161 harden: load training-dataset shards with weights_only=True (#14543)
LoadTrainingDataset was the only torch.load call in the codebase without
weights_only=True; comfy/utils.py and comfy/sd1_clip.py already pass it.
Recent PyTorch defaults to weights_only=True, so this is defense-in-depth
for installs pinned to older PyTorch. Verified a typical shard (latents +
standard conditioning) round-trips cleanly under weights_only=True.
2026-06-18 15:30:57 -04:00
comfyanonymous
52257bb435 Add negative prompt to boogu edit node and set min images to 0. (#14529) 2026-06-17 15:42:29 -07:00