kohya-ss / sd-scripts

Apache License 2.0
5.33k stars 881 forks source link

BUG: Cache validation does not check latent size for SD/SDXL (sd3 branch) #1771

Open feffy380 opened 3 weeks ago

feffy380 commented 3 weeks ago

The new cache validation in the sd3 branch only checks the key name. When multiresolution is disabled (like with sd and sdxl training), the key is latents and the size of the tensor is not checked. If the training resolution or bucketing changes, the cache should not pass validation.

https://github.com/kohya-ss/sd-scripts/blob/123474d784096a2a3063d1ff91ef1957b41ccc72/library/strategy_base.py#L446-L451