digital-garbageandClaude Opus 4.8 ff224cbffb fix: guide scenes crash on Blackwell — route masked attention to SDPA when xformers can't
On compute capability > (9, 0) GPUs (Blackwell sm_120, e.g. RTX PRO 6000),
xformers' memory_efficient_attention has no kernel that accepts a tensor
attn_bias — fa3F/cutlassF require cap <= (9,0), fa2F/fa3F reject a tensor
bias. So unmasked attention works (i2v ANCHOR scenes generate) but MASKED
attention crashes: scenes generated from GUIDES hit the LTX guide path
(comfy/ldm/lightricks/model.py _attention_with_guide_mask) which passes a
tensor mask → "No operator found for memory_efficient_attention_forward".

This is the ComfyUI-wide issue normally worked around with
--disable-xformers --use-pytorch-cross-attention; when that flag isn't in
effect on an instance, the guide path still reaches xformers.

Fix: _funpack_install_mask_safe_attention(model), called at the top of the
chain sampler's sample(). When the active backend is xformers AND the device
capability is > (9,0), install ComfyUI's per-call optimized_attention_override
(the wrap_attn hook) so MASKED attention falls back to attention_pytorch
(SDPA handles masks on every GPU) while UNMASKED attention stays on the fast
xformers path. Threaded via transformer_options so it reaches every scene's
forward. No global monkeypatch; no recursion (wrap_attn stamps
_inside_attn_wrapper before calling the override). No-op on supported GPUs,
non-xformers backends, or when another override is already installed;
idempotent.

Tests: tests/test_mask_safe_attention.py — 9 cases covering override routing
(masked→pytorch via kwarg or positional, unmasked→original) and install
gating (xformers+Blackwell installs; supported cap / non-xformers / no-CUDA
skip; existing override respected; idempotent). Run with the ComfyUI venv.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:41:43 +03:00
2026-04-23 16:05:59 +03:00
2025-06-10 16:03:37 +03:00

ComfyUI-FunPack

A set of ComfyUI nodes for experimenting with video generation workflows based on WAN, HunyuanVideo, LTX, and similar models.

Ko-fi  Patreon  Vast.ai

Dev and other non-main branches

The dev branch is intended for testing unfinished changes, implementing new logic and basically, flipping everything just because I can. It can be broken, renamed, or changed without warning.

Use only main if you want the most stable version of this node pack. Bug reports based on dev version will be ignored.

From time to time other short-lived branches may appear for the most advanced yet most breaking changes and features (e.g. a large rework in progress). I do not recommend using any non-main branch unless it's strictly necessary for your workflow — any sort of stability is not guaranteed, and such branches can be force-pushed or deleted at any time.

Version 3.0 — Cutting Room and development direction

FunPack 3.0 introduces the Cutting Room — a dedicated montage editor at /funpack/movie inside ComfyUI. It is the primary surface for building multi-scene projects, previewing on a real timeline, and driving FunPack Studio + the LTXAV Scene Chain Sampler without wiring a graph by hand.

Going forward, new features and UX work target the Cutting Room frontend. The classic ComfyUI node popups (Studio, Refiner V2, Scene Chain Sampler, and other pre-3.0 nodes) remain fully usable but will receive bugfixes only — no significant UI reworks unless a fix requires it. If you live in ComfyUI graphs, nothing breaks; if you want the full montage workflow, use the Cutting Room.

3.0.1 adds per-shortcut refinement keys (a shortcut can mark which key it trains, with per-scene multi-key steering and a timeline preview of the keys each scene will use) and fixes Cutting Room splitting/anchor bugs — see the CHANGELOG.

3.1.1 adds prompt $variables and global-prompt templates in the Composer, a cross-shot JoyAI-Echo audio/video memory mode, contrastive-pair FreeSliders, and a seed-routing path-outcome planner that steers future generations away from disliked paths — see the CHANGELOG for the full list.

See docs/MovieEditor.md for complete Cutting Room documentation.

Installation

FunPack is available on Comfy Registry and can be installed in any of these ways:

  1. With comfy-cli: comfy node install ComfyUI-FunPack
  2. With git, inside your ComfyUI/custom_nodes directory: git clone https://github.com/digital-garbage/ComfyUI-FunPack
  3. With ComfyUI-Manager: Open Custom Nodes Manager, search for ComfyUI-FunPack, and click Install.

Dependencies

FunPack includes a requirements.txt file for its Python dependencies.

Install them with:

pip install -r requirements.txt

FunPack uses your existing ComfyUI/PyTorch install. The expected baseline is transformers >= 5.0.0

hpsv3 is optional and only used by the FunPack StoryMem Keyframe Extractor quality filter, so it is not installed by default.

Install it manually only if you need that feature:

pip3 install hpsv3 --no-build-isolation

Important Note About hpsv3

Installing hpsv3 can break Prompt Enhancer and Story Writer, because hpsv3 depends on a transformers version that conflicts with the version those LLM-based nodes require.

FunPack's LLM nodes require transformers >= 5.0. The version required for hpsv3 is strictly transformers==4.45.2. Installing any version different from it will result in broken quality detector.

If you install hpsv3, use --no-build-isolation. Optionally, specify the exact version - pip install transformers==4.45.2 --no-build-isolation.

Documentation

Per-node documentation is available in the docs folder.

Start with:

Version history is available in CHANGELOG.md.

Feedback

If you have suggestions, questions, or ideas for new nodes, feel free to open an issue or submit a pull request.

Intent

FunPack is a hobby project, provided to you by a fellow AI enthusiast who "lives in the trenches" and knows exactly what people seek in video/audio generation workflows.

FunPack is provided under GNU General Public License V3, which gives you broad rights to use, modify and distribute the original/modified version of it as long as the original license text is included. FunPack places no limitations on types of content you can generate by using it, meaning both SFW and NSFW content are fine as long as you don't violate your local laws. GPLv3 does not grant you rights for such violations.

However, I do not endorse using FunPack and/or demonstrating it alongside morally and legally questionable/prohibited content, including:

  • Non-consensual explicit depiction of a real person;
  • Explicit depiction of minors;
  • Depiction of violence and gore targeted at a real person.

I do not provide support to users who use FunPack in such cases, and in case I detect it, any support will be immediately ceased.

Thanks for understanding.

Thank you

I express my deepest gratitude to:

  • OpenAI and ChatGPT Codex;
  • xAI and Grok Build;
  • Anthropic and Claude Code;
  • Team Cursor and Composer model;
  • DeepSeek team and model;
  • Google and Gemini;
  • Lightricks and LTX-Video model;
  • ComfyUI-LTXVideo — LTX model loaders and nodes used by the built-in Cutting Room pipeline;
  • ComfyUI-VideoHelperSuite — video combine and helper nodes for montage export;
  • ComfyUI-KJNodes — utility nodes used by the built-in pipeline;
  • OpenCut — the in-browser non-linear video editor whose UI and interaction patterns inspired the FunPack Movie Editor;
  • ComfyUI and its whole community.

Without all of you, this project would've been impossible.

With <3

DigitalGarbage

S
Description
No description provided
Readme GPL-3.0
23 MiB
Languages
Python 64.4%
JavaScript 32.7%
CSS 2.8%