-
Notifications
You must be signed in to change notification settings - Fork 131
Fix QwenImage _forward argument alignment for ComfyUI master(修复 QwenImage 在 ComfyUI master 下的参数错位问题) #728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Align _forward parameter order with ComfyUI master to avoid positional mismatch - Use time_text_embed(timestep, hidden_states, additional_t_cond) only - Unwrap single-element additional_t_cond (refuse multi-element to avoid semantic drift) - Add bilingual (CN/EN) comments for maintainability
|
EN Refuses to merge multi-element list/tuple for tensor-like inputs (e.g. additional_t_cond) to avoid CFG/conditioning semantic drift; multi-image inputs are handled via ref_latents as intended. CN 仅对 additional_t_cond 等“tensor-like 输入”拒绝合并多元素 list/tuple,以避免 CFG/conditioning 语义漂移;多图输入按设计通过 ref_latents 传入并由模型内部逻辑处理。 |
|
great! it works |
|
Does your fix work also with Qwen edit models? For some reason, I still get the error with Qwen Image Edit 2509 if I put your file in the ComfyUI backend of SwarmUI. |
SwarmUI没有试过,考虑是否是SwarmUI接口问题?因为我修复后在openwebui中是可以正常调用comfyui的。 |
I found the issue. It seems that SwarmUI keeps another copy of the Nunchaku nodes here: SwarmUI\src\BuiltinExtensions\ComfyUIBackend\DLNodes\ComfyUI-nunchaku I replaced the qwenimage.py in the models directory there too, and it works now! Thank you for the fix! 🙏 |
|
guys for the non savvy ,just run this commnd in the in omfyUI\custom_nodes\nunchaku_nodes git fetch origin pull/728/head:pr-728 |
|
Thanks for sharing this! I was struggling with the exact same AttributeError after the recent ComfyUI update, and applying the PR #728 fix solved it perfectly for my QwenImageEdit-2509 workflow. Appreciate the help |
|
work! |
Background / 背景
After upgrading to ComfyUI master, QwenImage-based nodes could crash
(e.g.
'list' object has no attribute 'dtype') or silently drift in generationdue to positional argument mismatch in
_forward.在升级到 ComfyUI master 之后,QwenImage 相关节点可能出现
'list' object has no attribute 'dtype'报错,或者由于
_forward位置参数错位而导致生成语义漂移(模型不听 prompt)。What this PR does / 本次修改内容
_forwardparameter order with ComfyUI master implementation对齐
_forward的参数顺序,使其与 ComfyUI master 实现保持一致guidancehandling fromtime_text_embed移除历史遗留的
guidance注入逻辑,避免参数错位additional_t_condwithout changing semantics仅对单元素
additional_t_cond做安全解包,拒绝多元素以避免语义变化增加中英文注释,说明与 ComfyUI master 兼容所需的约束条件
Why this is safe / 修改安全性说明
comfy/ldm/qwen_image/model.pysignatures exactly与上游
comfy/ldm/qwen_image/model.py的函数签名完全一致明确拒绝合并多元素列表,避免 CFG / 条件语义漂移
当输入已是 tensor 时,不会引入任何行为变化
Tested / 测试环境