mirror of
https://github.com/vladmandic/automatic
synced 2026-09-02 02:50:47 +02:00
improve taesd live preview downscaling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
- Fix process batch double image save
|
||||
- Fix unapply texture tiling
|
||||
- Suppress torch empty logging
|
||||
- Improve TAESD live preview downscale handling
|
||||
|
||||
## Update for 2025-06-16
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ def single_sample_to_image(sample, approximation=None):
|
||||
if len(sample.shape) == 4 and sample.shape[0]: # likely animatediff latent
|
||||
sample = sample.permute(1, 0, 2, 3)[0]
|
||||
if approximation == 2: # TAESD
|
||||
if (len(sample.shape) == 3 or len(sample.shape) == 4) and shared.opts.live_preview_downscale and (sample.shape[-1] > 128 or sample.shape[-2] > 128):
|
||||
if (len(sample.shape) == 3 or len(sample.shape) == 4) and shared.opts.live_preview_downscale and (sample.shape[-1]*sample.shape[-2] > 128*128):
|
||||
try:
|
||||
scale = 128 / max(sample.shape[-1], sample.shape[-2])
|
||||
scale = (128 * 128) / (sample.shape[-1] * sample.shape[-2])
|
||||
sample = torch.nn.functional.interpolate(sample.unsqueeze(0), scale_factor=[scale, scale], mode='bilinear', align_corners=False)[0]
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user