mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix bfloat and pag
This commit is contained in:
@@ -461,10 +461,9 @@ class StableDiffusionXLPAGPipeline(
|
||||
image_encoder=image_encoder,
|
||||
feature_extractor=feature_extractor,
|
||||
)
|
||||
# if 'force_zeros_for_empty_prompt' in self.config:
|
||||
# self.register_to_config(force_zeros_for_empty_prompt=force_zeros_for_empty_prompt)
|
||||
# if 'requires_aesthetics_score' in self.config:
|
||||
# self.register_to_config(requires_aesthetics_score=requires_aesthetics_score)
|
||||
if 'requires_aesthetics_score' in self.config:
|
||||
self.register_to_config(requires_aesthetics_score=requires_aesthetics_score)
|
||||
self.register_to_config(force_zeros_for_empty_prompt=force_zeros_for_empty_prompt)
|
||||
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
||||
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|
||||
self.default_sample_size = self.unet.config.sample_size
|
||||
|
||||
@@ -51,7 +51,6 @@ def single_sample_to_image(sample, approximation=None):
|
||||
sd_cascade = True
|
||||
if len(sample.shape) == 4 and sample.shape[0]: # likely animatediff latent
|
||||
sample = sample.permute(1, 0, 2, 3)[0]
|
||||
|
||||
if shared.native: # [-x,x] to [-5,5]
|
||||
sample_max = torch.max(sample)
|
||||
if sample_max > 5:
|
||||
|
||||
@@ -51,7 +51,7 @@ def nn_approximation(sample): # Approximate NN
|
||||
in_sample = sample.to(device, dtype).unsqueeze(0)
|
||||
sd_vae_approx_model.to(device, dtype)
|
||||
x_sample = sd_vae_approx_model(in_sample)
|
||||
x_sample = x_sample[0].detach().cpu()
|
||||
x_sample = x_sample[0].to(torch.float32).detach().cpu()
|
||||
return x_sample
|
||||
except Exception as e:
|
||||
shared.log.error(f'VAE decode approximate: {e}')
|
||||
|
||||
Reference in New Issue
Block a user