Commit Graph

5704 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
Comfy Org PR Bot
14b05228ce Bump comfyui-frontend-package to 1.47.12 (#15244)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-02 22:03:37 -07:00
comfyanonymous
b1693ecba9 ComfyUI v0.30.0 v0.30.0 2026-08-02 22:49:14 -04:00
Daxiong (Lin)
6eba7739f0 chore: update workflow templates to v0.11.27 (#15239) 2026-08-02 19:47:04 -07:00
Daxiong (Lin)
f72b68878e Update workflow templates to v0.11.26 (#15228) 2026-08-02 22:29:02 -04:00
Jukka Seppänen
57500fc5bc feat: Support MiniMax-H3 (CORE-375) (#15224) 2026-08-02 22:28:29 -04:00
Oliver Freyermuth
b53e247c94 rename comfy/logging.py to comfy/internal_logging.py (#15231)
This avoids name collision (circular imports) for external custom nodes,
for which the comfy path is pushed into sys.path so Python's own logging module
is shadowed otherwise.

fixes: #15229
2026-08-02 16:20:27 -04:00
rattus
611f2a4e0f fix pin registration priority (#15226)
This priority scheme was broken in the case where you have pin
registration exhaustion while loading a VBAR that gets a big evicition.
The weight would stay in the loaded set but inherit the MRU priority
against other workflow models WRT pin registration which leads to async
offload without pinning.

Fix by universally promiting active pin registration above workflow
pins without concern for the weights/weights-loaded split. This diverges
from the actual budgeting where the split still makes sense.
2026-08-02 08:16:06 -07:00
Alexander Piskun
364081170f [Partner Nodes] feat(Minimax): add 768P resolution for H3 model (#15227)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-02 17:10:47 +03:00
rattus
8084083d4b comfy-aimdo 0.4.11 (#15215)
Changes:

Remove sequential scan hint
Prefer NVML pressure on windows
Add async malloc clamp option (unused by comfy so far)
Workaround AMD windows GPU virtual address space leak

The largest change is the NVML pressure, which works around a cuMemGetInfo
drift from actual VRAM in some circumstances.
2026-08-02 06:55:37 -04:00
comfyanonymous
f06a187f50 Handle case where swap memory query fails on windows. (#15219) 2026-08-02 01:12:12 -04:00
comfyanonymous
532a16f3b9 Disable gradients on diffusion models. (#15218) 2026-08-01 20:15:51 -07:00
comfyanonymous
e0951a9c7e Let the save text node save in csv format. (#15217) 2026-08-01 22:27:37 -04:00
comfyanonymous
41a3e160d7 Use the actual function to check if the path is within the dir. (#15216) 2026-08-01 22:15:17 -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
e8e233cdf6 Update comfy-kitchen version to 0.2.26 (#15208) 2026-08-01 15:10:39 -04:00
Alexander Piskun
1091c47b3a [Partner Nodes] chore(Bria): increase price for video endpoints (#15186)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-01 20:43:42 +03:00
Alexander Piskun
d8e6aa55f3 [Partner Nodes] feat(xAI): update nodes for grok-imagine-video-1.5 model (#15197)
* [Partner Nodes] feat(xAI): update nodes for grok-imagine-video-1.5 model

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2026-08-01 20:30:00 +03:00
comfyanonymous
2881e61610 Store mp4 metadata at the beginning of the file when possible. (#15195) 2026-08-01 03:21:28 -04:00
comfyanonymous
235b466a0c Add crf option to save video node. (#15191) 2026-08-01 00:27:48 -04:00
comfyanonymous
a1c421994c Expand k, v when attention backend would fall back to math because gqa. (#15190) 2026-07-31 15:17:56 -07:00
Alexander Piskun
6cedd34343 [Partner Nodes] fix(ByteDance): encode stereo reference audio without doubling its duration (#15177)
* [Partner Nodes] fix(ByteDance): encode stereo reference audio without doubling its duration

Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-31 21:57:45 +03:00
Daxiong (Lin)
0b73ae83a1 chore: update workflow templates to v0.11.23 (#15187) 2026-08-01 02:20:55 +08:00
rattus
7c806288d5 ops: apply the custom placeholder logic to Linux too (#15181)
Windows has proven this logic works for a long time and there are
corner cases where this materialization actual consumes real RAM
on linux.

Its not as bad as the original windows commit charge surge, but
its still a detectable transient leak. So simplify and unify.
2026-07-31 10:44:09 -07:00
rattus
de5625a64a Delay dynamic pin cleanup until model destruction (#15183) 2026-07-31 10:29:47 -07:00
Alexander Piskun
9bd9815eab [Partner Nodes] chore(Bria): adjust pricing for other video endpoints (#15171)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-31 19:59:53 +03:00
blepping
831710d257 Don't assume sampler_function has a __name__ attribute in detail logging (#15179) 2026-07-31 19:12:17 +03:00
Terry Jia
5cc026f5b8 fix: resend cached histogram UI for CurveEditor after page refresh (#15152) 2026-07-31 03:07:31 -04:00
Daxiong (Lin)
7dd4627460 Add minimax h3 support (#15167) 2026-07-30 19:30:32 -07:00
Daxiong (Lin)
b6fe23b4f1 chore: update workflow templates to v0.11.20 (#15165) 2026-07-30 19:27:06 -07:00
Alexander Piskun
f65f45511b [Partner Nodes] feat(Ideogram): add new P-Image model support (#15154) 2026-07-30 19:22:34 -07:00
Alexander Piskun
51d0405540 [Partner Nodes] chore(Bria): adjust pricing for the Bria Video Remove Background nodes (#15155) 2026-07-30 19:18:03 -07:00
Comfy Org PR Bot
c20269c1cb Bump comfyui-frontend-package to 1.47.11 (#15161) 2026-07-30 20:05:51 -04:00
comfyanonymous
8352644aa9 comfy-kitchen AMD support. (#15160) 2026-07-30 19:53:13 -04:00
comfyanonymous
9b3aa08967 Don't enable comfyui_detail.log by default. (#15159) 2026-07-30 16:15:39 -04:00
Matt Miller
9cf91339b7 Fix SVG previews broken by the stored-XSS forced-download (#15149)
* Fix SVG previews broken by the stored-XSS forced-download

/view and the assets download route force every SVG to
application/octet-stream + attachment. That blocks the stored XSS from
GHSA-779p-m5rp-r4h4, but it also breaks the SVG node output and Media
Assets previews, which request the file with a plain <img>.

Exempt only that case. An SVG referenced by an <img> loads in secure
static mode with scripting and external references disabled, so the
payload cannot fire. The attack needs the SVG to become a document,
which arrives with a different Sec-Fetch-Dest. Browsers set that header
themselves and page script cannot override it. A missing header, from a
non-browser client or a proxy that strips it, fails closed.

The blocklist itself is unchanged; this is a call-site gate.

* Don't let a cache replay the inline SVG into document context

The Sec-Fetch-Dest exemption makes /view and the assets content route vary
their Content-Type and Content-Disposition on a request header, but neither
response said so. FileResponse emits Last-Modified/ETag and the cache_control
middleware skips /view (the filename is in the query string, not the path), so
the inline image/svg+xml variant is heuristically cacheable. A cache keyed on
the URL alone could hand an entry primed by an <img> load to a later top-level
navigation of the same URL, turning the SVG back into a document and
re-enabling the stored XSS the forced download blocks.

Set Vary: Sec-Fetch-Dest and Cache-Control: no-store on both branches, not just
the exempt one: a cached attachment replayed to an <img> would re-break the
preview this fix exists to restore.

Also strip parameters from content_type before building the assets response.
mime_type there is uploader-supplied and unvalidated, and aiohttp rejects a
charset in the content_type argument with ValueError, so a stored
"image/svg+xml; charset=utf-8" turned a valid inline SVG into a 500.

Route-level guards now pin the headers on both branches and the parameterised
mime type; all three fail against the previous commit.
2026-07-29 23:29:36 -07:00
Denis
7374157e95 fix(jobs): prefer media over text for job preview_output (#14681) 2026-07-29 23:26:14 -07:00
kaalibro
c65f9f169c Fix user.css loading broken by #14734 (#15000) 2026-07-29 23:00:16 -07:00
comfyanonymous
f73e8cde88 Fallback to cudnn attention on linux if flash attention doesn't work. (#15146) 2026-07-29 18:10:28 -07:00
comfyanonymous
4f874c5e3a Update comfy-kitchen to fix flux kv issue. (#15144) 2026-07-29 14:10:01 -07:00