Fix/model cache Qwen/CogView4 cancel repair - #8959
Conversation
lstein
left a comment
There was a problem hiding this comment.
Works. I don't see any obvious code problems.
Code reviewFound 1 issue:
InvokeAI/invokeai/app/invocations/cogview4_text_encoder.py Lines 23 to 25 in 385462f InvokeAI/invokeai/app/invocations/flux2_klein_text_encoder.py Lines 48 to 50 in 385462f InvokeAI/invokeai/app/invocations/z_image_text_encoder.py Lines 37 to 39 in 385462f 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Internal changes to the node that don't alter its functionality do not require a node version bump, in general. If you are fundamentally changing how a node works, a version bump is a good idea to alert users. If you're altering its external interface (inputs/outputs), it's essential. |
Summary
Fixes a canceled-run regression where the next Qwen-based or CogView4-based text encoder invocation could fail with a CPU/CUDA device mismatch.
The change adds a repair hook to partially loaded cached models so required non-autocast tensors are restored to the compute device before inference, while keeping model-cache VRAM accounting consistent. The invocation paths now use that repair flow, and a focused cached-model regression test was added.
Related Issues / Discussions
https://discord.com/channels/1020123559063990373/1049495067846524939/1481290964587778273
QA Instructions
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)