Repository navigation
Conversation
…ce images Reference-image encoding now uses vae_info.compute_device. Regression tests cover a CPU VAE with a mocked CUDA default, checking latent output and device selection for memory estimates and conditional tiling. Another test checks that encoding failures preserve the shared VAE's tiling settings and propagate the original exception. Fixes invoke-ai#10204
1 task done
This branch has not been deployed
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
FLUX.2 reference-image generation can fail with a CUDA/CPU device mismatch when the VAE runs on CPU. Generation without a reference image can still succeed. Reference-image encoding selected the global default device instead of the VAE's compute device. This could place image tensors on CUDA while the VAE weights remained on CPU, and use the wrong device for tiling and memory estimates.
Reference-image encoding now uses vae_info.compute_device. Regression tests cover a CPU VAE with a mocked CUDA default, checking latent output and device selection for memory estimates and conditional tiling. Another test checks that encoding failures preserve the shared VAE's tiling settings and propagate the original exception.
Related Issues / Discussions
Closes #10204
QA Instructions
./scripts/family_e2ecould not run in this environment for the InvokeAI encode_reference_image change (./scripts/family_e2e is not in this checkout).uv run --frozen --project . pytest -q tests/backend/flux2/test_reference_encode_tiling.py failed during conftest loading because torch was unavailable; no tests ran.
./scripts/family_e2e could not run because the script was absent from the checkout.
A run with the InvokeAI encode_reference_image change reverted gave no clear result, so no test is shown to catch this bug.
The changed test tests/backend/flux2/test_reference_encode_tiling.py did not run here: the torch module is not installed.
Review
Not applicable to this change.
Compatibility / Rollout
Not applicable to this change.
Checklist
What's Newcopy (if doing a release after this PR)Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.