Commit ed49fab
fix(flux2): strip reference-image tokens from Heun preview latents (invoke-ai#9274)
The Heun (2nd order) branch of the FLUX.2 Klein denoise loop passed the
full preview latent to step_callback without removing the concatenated
reference-image tokens. With ref images the sequence length is doubled,
so unpack_flux2 failed with "Shape mismatch, 8192 != 4096".
Slice the preview to original_seq_len before the callback, matching the
behavior already present in the Euler branch.
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>1 parent 5c464f8 commit ed49fab
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
204 | | - | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
0 commit comments