feat(anima): Make Anima respect the precision property in Invoke.yaml#9183
Open
kappacommit wants to merge 2 commits into
Open
feat(anima): Make Anima respect the precision property in Invoke.yaml#9183kappacommit wants to merge 2 commits into
precision property in Invoke.yaml#9183kappacommit wants to merge 2 commits into
Conversation
…sion When precision='auto', delegates to the existing choose_bfloat16_safe_dtype probe. When set to a specific value (float16/bfloat16/float32), returns that dtype directly so the user's config choice is honored. Anima call sites will migrate to this helper in a follow-up commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Swaps choose_bfloat16_safe_dtype for choose_anima_inference_dtype at: - _run_diffusion (transformer / latents / LoRA dtype) - anima_text_encoder (text-encoder LoRA dtype) - model_loaders/anima (transformer load dtype) precision='auto' preserves the current bf16-probe fallback; specific values are now honored end-to-end. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
precision property in Invoke.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes it so that Anima respects the
precisionproperty in invoke.yamlWhy?
Anima runs in bf16 precision. This is slow on 2000 series and earlier Nvidia GPUs, and on mac. Allowing the user to configure this, enables that hardware to run the model at adequate performance on those systems.
Why only Anima?
Today - Qwen and Z-Image do not respect the
precisionproperty. Which is fine, because neither Z-Image nor Qwen support fp16 at all (it produces broken output.) If we make Z-Image and Qwen respectprecision, they will break if set tofloat16and if set tofloat32they will double their VRAM cost and realistically not be usable on consumer hardware. (Qwen will take >40gb of VRAM)Anima, SD, and Flux 1 are the only models which safely and feasibly support all precisions. So it is natural to add Anima to the list.
I have documented an issue here for a more robust fix for all models by implementing a similar fix to how Forge and Comfy both handle this automatically. However, testing this is difficult. It requires testing on many different devices (2000 series nvidia gpu, mac): #9153
QA Instructions
invoke.yamladdprecision: float32invoke.yamladdprecision: float16Merge Plan
Standard merge. Backend-only change isolated to Anima paths.
Checklist
🤖 Generated with Claude Code