ComfyUI YoYo HyperFlow Chunk FeedForward
Token-chunked SwiGLU FeedForward for MiniMax H3 with per-block HyperFlow Flash LowRankLinear compatibility to reduce peak VRAM.
ComfyUI-YoYo-HyperFlow-Chunk
A lightweight ComfyUI custom node providing YoYo MiniMax H3 Chunk FeedForward (YoYo_MiniMaxH3ChunkFeedForward), which chunks MiniMax H3's SwiGLU MLP along the packed token dimension to reduce peak VRAM—while remaining compatible with HyperFlow Flash checkpoints that mix dense linears and factorized LowRankLinear blocks.
Installation
Option 1: Comfy Registry / ComfyUI-Manager
comfy node install comfyui-yoyo-hyperflow-chunk
Or search for ComfyUI YoYo HyperFlow Chunk FeedForward in ComfyUI-Manager.
Option 2: Git Clone
cd ComfyUI/custom_nodes
git clone https://github.com/demon820308/ComfyUI-YoYo-HyperFlow-Chunk.git
Overview
- Drop-in replacement for
MiniMaxChunkFeedForward(samemodel,chunks,seq_thresholdinterface). - Per-block dispatch: Dense blocks keep ComfyUI's fused
comfy.ops.linear_input_actINT8 path; factorizedLowRankLinearblocks (without a single.weight) automatically use module-call SwiGLU chunking (fc1 -> silu * hidden -> fc2). - Implementation note: Original standalone engineering node inspired by the token-chunking pattern of
comfyui-kjnodes(MiniMaxChunkFeedForward) and designed for compatibility withComfyUI-HyperFlow-Flashfactorized blocks. No externalpipdependencies required.
中文说明
一个节点:YoYo MiniMax H3 Chunk FeedForward
(节点类型 YoYo_MiniMaxH3ChunkFeedForward,菜单位置:YoYo / MiniMax H3)
它解决什么
KJNodes 的 MiniMaxChunkFeedForward 对 HyperFlow Flash 模型会报 AttributeError: 'LowRankLinear' object has no attribute 'weight':它写死了 comfy.ops.linear_input_act(self.fc2, ...),要直接读 fc2.weight,而 Flash 的分解层 LowRankLinear 只有 down/up 两个瘦矩阵。
本节点与 KJ 版接口、参数完全一致(model 进出、chunks、seq_threshold),内部按 block 分发:
fc2是普通 Linear 的 block:走原样的融合路径linear_input_actfc2是LowRankLinear的 block:走 Flash 自己的FactorizedMLP语义(fc1 → silu 门控 → fc2,全部模块调用),外面套同样的 token 分块
Flash 一个模型里稠密块与分解块混存,所以必须逐 block 判断,不能全局二选一。分块只切 token 维,SwiGLU 与 GEMM 逐行独立,输出与不分块一致(已离线数值验证:稠密/分解/混合四种组合 × 阈值上下 × 不均匀切分,全等)。
使用要点
- 默认
chunks=4、seq_threshold=4096(与原低显存流设置一致)。 - 运行日志会打印一行:
YoYo_MiniMaxH3ChunkFeedForward: patched N blocks (X dense, Y factorized, Z skipped), ...在 Flash 模型上Y应大于 0。 - KJ 的
MiniMaxLowVRAMAttention可继续保留在链路中。