Commit Graph

2308 Commits

Author SHA1 Message Date
Scott 4e2c2e3afb
Merge d6762aa7da into 6665515349 2026-07-19 19:40:23 -07:00
comfyanonymous 6665515349
Fix wan dancer issue with batches. (#14999) 2026-07-19 15:13:49 -07:00
comfyanonymous c9602625e4
Implement regular and timestep zero reference images to krea 2 for ostris and identity edit ref loras. (#14843) 2026-07-18 17:12:18 -07: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
comfyanonymous 71b73e3b2b
Speed up anima a bit. (#14953) 2026-07-16 19:44:02 -07:00
彼彼 03978e1e81
[feat]Add JoyImageEdit native model support (#14428) 2026-07-15 23:48:28 -04:00
comfyanonymous c35a622acd
Fix hidream o1 regression. (#14923) 2026-07-13 12:52:28 -07:00
comfyanonymous 917faef771
Support PID 1.5 models. (#14894) 2026-07-12 09:43:30 -07:00
comfyanonymous 69ea58697b
Try to fix flash attention related issue on AMD. (#14880) 2026-07-11 17:16:40 -07:00
comfyanonymous f3a36e7484
Temporarily disable auto enabling triton by default on AMD. (#14878)
I get freezing issues on my test machine.
2026-07-10 18:37:59 -07:00
comfyanonymous 92ddf07ba1
Try to fix some issues with the seedvr VAE. (#14877) 2026-07-10 19:54:28 -04:00
liminfei-amd 1377a2f729
Only auto-enable the ROCm comfy-kitchen Triton backend on matrix-core GPUs (#14869)
#14862 auto-enables the comfy-kitchen Triton backend whenever torch.version.hip
is set and Triton >= 3.7. The INT8 matmul kernels compile tl.dot to matrix-core
instructions (WMMA on RDNA3+/gfx11xx-gfx12xx, MFMA on CDNA/gfx9xx); RDNA1/RDNA2
(gfx10xx) have neither, so the auto-enabled INT8 path hangs the GPU there
(reported on RDNA2 + triton-windows 3.7.1: native and custom-node INT8 freeze
until reset).

Gate the automatic ROCm default on GPU architecture as well as Triton version so
RDNA1/RDNA2 stay on the working eager fallback. Add --disable-triton-backend as
an explicit override; --enable-triton-backend still force-enables on any arch.
2026-07-10 03:31:20 -07:00
John Pollock 8e2e54e2b8
Add SeedVR2 support (CORE-6) (#14424) 2026-07-10 15:07:42 +08:00
liminfei-amd 099522f85b
Enable comfy-kitchen Triton backend by default on ROCm/AMD (#14862)
On AMD/ROCm the CUDA backend is unavailable, so Triton is the only accelerated
comfy-kitchen backend. It was disabled by default (opt-in --enable-triton-backend),
leaving AMD on the slow eager path. Enable it by default when torch.version.hip is
set AND Triton is >= 3.7 -- older Triton lacks libdevice.rint on the HIP backend and
hard-crashes the INT8 path, so on Triton < 3.7 it stays disabled with a log line.
NVIDIA behavior is unchanged; the explicit --enable-triton-backend flag still works
as an override.

Fixes #14861
2026-07-09 23:11:52 -04:00
liminfei-amd 62e025a4f3
Fix FP8 activation quantization for >2D activations in mixed_precision_ops (#14643)
mixed_precision_ops.Linear.forward only quantized activations that were 2D, or
3D (reshaped to 2D). Inputs with rank >= 4 (e.g. Anima's MLP activations, which
are not reshaped to 3D the way the attention path is) fell through the
`input_reshaped.ndim == 2` guard and reached scaled_mm as bf16, silently
dispatching a bf16 kernel instead of FP8. Since MLP is roughly half the compute,
the FP8 speedup was far below expectation.

Generalize the existing 3D->2D reshape to any rank >= 3 (flatten the leading
dims, keep the contraction dim) and reshape the output back to the original
leading dims. 2D and 3D inputs are handled exactly as before; only rank >= 4
inputs change (now quantized instead of skipped). This matches the rank-agnostic
handling already used by the training path (flatten(0, -2) / unflatten).

Fixes #14595.
2026-07-09 22:30:26 -04:00
comfyanonymous b7a648ca20
Try to fix the model reloading issue some people have. (#14822) 2026-07-09 16:39:01 -07:00
comfyanonymous 73e84d5ec8
Support convrot int4 models. (#14859)
linear_dtype in comfy_quant metadata can be used to set if the int4 op does
the matrix multiplication in int8 or int4, the default is int4 on GPUs that
support it with fallback to int8 for GPUs that don't.
2026-07-09 18:57:09 -04:00
Alexander Piskun b35819712e
feat: allow --comfy-api-base target ephemeral testenvs (#14569)
* feat: allow --comfy-api-base target ephemeral testenvs

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* refactor: name /features data as backend flags, not frontend

---------

Signed-off-by: bigcat88 <bigcat88@icloud.com>
Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-07-08 23:20:10 -07:00
comfyanonymous d0008a8958
Fix qwen3vl reference images when used as a text encode models. (#14845)
Should not affect use as a text generation model.
2026-07-09 01:50:25 -04:00
Scott d6762aa7da
Merge branch 'master' into fix/mps-attention-large-sequence-corruption 2026-07-08 16:56:27 -04:00
Scott Yewell 55760cdeb5 attention_pytorch: skip the chunk buffer/copy when steps==1
Addresses CodeRabbit feedback on #14838: the chunking loop always
allocated a temporary output buffer and copied SDPA's result into it,
even in the common case (any non-MPS device, or MPS below the size
threshold) where steps==1 and the loop only ever runs once. Adds a
fast path that calls scaled_dot_product_attention directly and
reshapes its result, matching the original pre-fix code for that case
-- no extra allocation or copy. The chunked path (steps>1) is
unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HAMqHgFBD6e9wjU8k8U6uW
2026-07-08 16:31:12 -04:00
Scott Yewell 7b7d48faa2 Remove diagnostic logging scaffolding from the MPS attention fix
Keep the fix itself (size-based chunking/capping) but drop the
_diag_log_attn_size helper, the debug-level [MPS-ATTN-FIX:...]
messages, and the now-unused tag parameters that only existed to
support that logging -- a minimal correctness fix without added
observability scaffolding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HAMqHgFBD6e9wjU8k8U6uW
2026-07-08 16:23:23 -04:00
Scott Yewell 7be129913f Fix MPS attention corruption for large sequences (Wan2.2 long-video)
MPS uses 32-bit indexing internally for many ops; a single attention
matrix (b*heads*seq_q*seq_k) at or above ~2^31 elements silently
corrupts output instead of raising, regardless of free unified memory.
A 61-frame/832x640 Wan2.2 case measured 7.68B elements, 3.6x over the
limit.

Fixes all four MPS-reachable attention implementations in
comfy/ldm/modules/attention.py, not just the ones a given launch
config happens to select:

- model_management.py: add bf16 to FORCE_UPCAST_ATTENTION_DTYPE
  (was fp16-only).
- attention_split: extend fp32 upcast to the second (weights x V)
  matmul, not just Q.Kt; add size-based diagnostic logging
  (_diag_log_attn_size); force chunking via a new shared
  _mps_forced_attn_chunk_steps() helper once the attention matrix
  exceeds 2^30 elements, independent of the existing memory-pressure
  based steps calculation (which never triggers on a 512GB unified
  memory machine); fix a slice_size divisibility bug that silently
  fell back to computing the whole unchunked sequence.
- attention_pytorch: port the same MPS chunking guard to the native
  SDPA path (previously unguarded and unsafe for large sequences on
  MPS), chunking over seq_q with a preallocated output buffer; zero
  behavior change when chunking doesn't engage. Also add
  attn_precision handling (get_attn_precision + float32 upcast of
  q/k/v/mask), which this path previously ignored entirely.
- attention_basic: reached via optimized_attention_for_device's
  small_input=True path whenever pytorch attention isn't enabled --
  a live path on MPS for text/image encoder attention (CLIP, T5,
  Llama, Gemma, Qwen-VL, DINO, BiRefNet, RT-DETR, etc). Had zero
  chunking of any kind; introduces a chunking loop using the same
  shared helper, preserving both bool-mask (masked_fill_) and
  float-mask (additive) handling.
- attention_sub_quad: the actual default MPS attention path (selected
  whenever no --use-*-attention flag is passed at all). Its
  free-memory-based query_chunk_size/kv_chunk_size selection has the
  same class of gap attention_split had -- on a 512GB unified-memory
  machine it always picks the largest candidate and disables
  kv-chunking entirely. Adds a new _mps_cap_subquad_chunk_sizes()
  helper that caps both values against the same MPS ceiling, entirely
  in the caller so the third-party MIT-licensed
  sub_quadratic_attention.py delegate stays untouched.
- Quiet the MPS-ATTN-FIX log to debug level (fires on every call once
  a guard engages, not deduplicated like the diagnostic logging).

Verified: standalone numerical tests confirm chunked/capped output
matches unchunked baseline (fp16-rounding-level max abs diff) for all
four functions, across no-mask/float-mask/bool-mask and fp32-upcast
variants, including the attention_sub_quad boundary case that forces
the delegate's real kv-chunked branch instead of its fast path. Shape
parity confirmed against the real 61-frame/832x640 repro case: all
four functions independently compute consistent forced chunk sizes
for the identical b*heads=40, seq=13860 shape.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HAMqHgFBD6e9wjU8k8U6uW
2026-07-08 16:23:23 -04:00
j2gg0s c6cb904994
Fix AttributeError in VAE.is_dynamic() for VAEs constructed without a patcher (#14826) 2026-07-08 16:01:43 -04:00
Silver 091b70edda
add models-directory launch argument (#9113) 2026-07-08 22:20:47 +08:00
comfyanonymous ffbecfffb9
Fix crash when using UNetSelfAttentionMultiply (#14823) 2026-07-07 21:17:31 -07:00
comfyanonymous b481bc15af
Support gqa on all attention backends, drop support for pytorch 2.4 (#14772) 2026-07-07 22:57:52 -04:00
comfyanonymous 439bd807f8
Skip unloading dynamic model patchers in current workflow. (#14799) 2026-07-06 14:35:12 -07:00
comfyanonymous 000c6b784e
Small speedup for text model sampling. (#14773) 2026-07-05 18:39:24 -07:00
Silver 6c62ca0b6b
fix: error when embedding is loaded with models using llama_template (#14744) 2026-07-04 17:06:09 +08:00
Silver 2c935de1b1
Fix Qwen3-VL tokenizer crash with custom embeddings (#14713) 2026-07-01 21:15:07 +03:00
Matt Miller 1c59659a2f
feat: make asset hashing opt-in via --enable-asset-hashing, off by default (#14663)
Add a --enable-asset-hashing CLI flag (action=store_true, default False)
and plumb it into the two asset-seeder call sites in main.py that
previously hardcoded compute_hashes=True (the startup scan and the
post-job output enqueue). Local runs now skip blake3 hashing unless the
user opts in, avoiding the startup/per-output cost on large models
directories while keeping hashing available for asset-portability
features.

Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-06-30 14:13:20 -07:00
comfyanonymous 79c555ce6b
Fix int8 mm being skipped on offloaded lora weights. (#14669) 2026-06-28 23:52:36 -04:00
comfyanonymous 470ac36a0a
Fix int8 loras causing lower quality requant with wrong settings. (#14650)
* Update comfy-kitchen

* Support requantizing with same settings as orig quant.
2026-06-26 16:41:29 -07:00
comfyanonymous 1a510f0423
Support int8 models. (#14636) 2026-06-25 11:23:58 -07:00
comfyanonymous b910f4fa2a
More accurate memory usage factor for krea 2. (#14594) 2026-06-23 16:50:48 +08:00
Jukka Seppänen 2a61015582
feat: Support Krea2 (#14589) 2026-06-22 14:35:00 -07:00
comfyanonymous e00b55631a
Small anima optimization. (#14557) 2026-06-20 08:05: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
comfyanonymous 52257bb435
Add negative prompt to boogu edit node and set min images to 0. (#14529) 2026-06-17 15:42:29 -07:00
Jukka Seppänen e25c391888
feat: Support Boogu-Image (CORE-308) (#14523) 2026-06-17 14:22:36 -07:00
Jukka Seppänen ca3dbe206c
Allow using Qwen3-VL as flux2 klein text encoder (again) (#14526) 2026-06-17 08:45:06 -07:00
Jukka Seppänen a590d60bb1
feat: SCAIL-2 multireference (CORE-310) (#14509)
* SCAIl-2: support multiref
2026-06-17 16:21:23 +03:00
Jukka Seppänen fc964047e7
feat: Support text generation with Qwen3-VL (CORE-276) (#14298) 2026-06-17 08:12:44 +08:00
rattus ec4dec93d2
Comfy Aimdo 0.4.10 + Dynamic --reserve-vram + --vram-headroom (#14480)
* main: implement --vram-headroom

Implement --vram-headroom for dynamic vram as a hybrid debug/diagnostic
option that can be used for people who still report shared VRAM spills.
They can trial and error the setting to maintain a bit more headroom to
avoid shared VRAM spills.

* main: implement --reserve-vram

Implement --reserve-vram as extra headroom on the simple method which
is semantically as close as possible to the stated functionality and
formet behaviour of non-dynamic VRAM.
2026-06-15 07:54:36 -07:00
comfyanonymous 7277d99d3a
Use comfy kitchen apply rope in omnigen2 model. (#14442) 2026-06-13 09:38:39 +08:00
rattus d7a552720c
add --high-ram option (#14437)
Add this option for users who know they have so much ram they want
to pin everything or have a pagefile that outruns their disk speed.

The removes the RAM pressure caps completely and pins behind the
primary model load forcing all models to be permanently comitted
to RAM.
2026-06-12 07:53:33 -07:00
comfyanonymous 02656ea0bb
Fix potential dtype issue with ideogram 4. (#14436) 2026-06-12 07:51:12 -07:00
Jedrzej Kosinski befc321438
Make --enable-manager-legacy-ui imply --enable-manager (#14421) 2026-06-12 06:45:22 +08:00
Barish Ozbay 91187c58d9
Improve context window resizing for SCAIL2 (CORE-286) (#14394) 2026-06-11 13:37:43 +08:00