Files
CthomasdesignandClaude Fable 5 151033af99 engine: prompt-embedding cache + encode-once for batches
Krea2Pipeline now routes generate() through _encode_cached: an 8-entry
LRU keyed by prompt string. Seed sweeps with a fixed prompt (the dominant
ComfyUI iteration pattern) skip the text encoder entirely, and
num_images>1 encodes its prompt once instead of once per image.

Cache hits return the same arrays a fresh encode produced, so this is
bit-exact on the single-image path: verified repeat generate() calls are
pixel-identical and match the engine-path parity reference exactly; quick
parity (incl. LoRA) stays bit-exact. Batch img0 was never seed-compatible
with a single-image run (verified pre-existing on the legacy path).
LoRA-safe (LoRAs wrap only the DiT). KREA2_EXACT_LEGACY=1 bypasses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 23:12:17 -04:00
..