ProCreations/Image-2.1-Calibrated-FP8 main
Python repeats repository clone calls
SHA-256da46438ad7be6f574f083a74d1272dd735834116458427da5aff5c82680fd970
MaleculeH(Po)
Evidence
1:28… le prefix layout during cached image decode."""
2import math
3import types
4import torch
5from diffusers.models.modeling_outputs import Transformer2DModelOutput
6from diffusers.models.transformers.transformer_qwenimage21 import QwenImage21KVCache
7
8
9def metadata(model, kw):
10 cache = kw['kv_cache']
11 if not hasattr(cache, '_fast_layout') …
31:26… tention_mask, target_tokens = layout
32 # Keep the original img_in shape, including condition-image tokens for edits.
33 image = model.img_in(hidden_states)
34 hidden = image[:, -target_tokens:]
35 times …
49:23… model, hidden, timestep, cache, layout):
50 self.hidden = hidden.clone()
51 self.timestep = timestep.clone()
52 self.cache = QwenImage21KVCache(len(cache.layer_caches))
53 for dst, src in zip(self.cache.layer_caches, cache.layer_caches):
54 dst.store(src.k.clone(), src.v.clone())
55 self.layout = tuple(x.clone() if isinstance(x, torch.Tensor) else x for x in layout)
56 stream = torch.cuda.Stream()
57 stream.wait_stream(torch.cuda.current_stream())
58 with torch.cuda.stream(stream):
59 for _ in range(2):
60 core(model, self.hidden, self.timestep, self.cache, self.layout)
61 torch …