fix flux hires

This commit is contained in:
Vladimir Mandic
2024-09-08 19:48:08 -04:00
parent 62d3cdf37d
commit a0ea0840db
4 changed files with 13 additions and 2 deletions
+2
View File
@@ -179,6 +179,8 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
shared.state.job_count = 2 * p.n_iter
shared.sd_model = sd_models.set_diffuser_pipe(shared.sd_model, sd_models.DiffusersTaskType.IMAGE_2_IMAGE)
shared.log.info(f'HiRes: class={shared.sd_model.__class__.__name__} sampler="{p.hr_sampler_name}"')
if 'Upscale' in shared.sd_model.__class__.__name__ or 'Flux in shared.sd_refiner.__class__.__name__':
output.images = processing_vae.vae_decode(latents=output.images, model=shared.sd_model, full_quality=p.full_quality, output_type='pil', width=p.width, height=p.height)
if p.is_control and hasattr(p, 'task_args') and p.task_args.get('image', None) is not None:
if hasattr(shared.sd_model, "vae") and output.images is not None and len(output.images) > 0:
output.images = processing_vae.vae_decode(latents=output.images, model=shared.sd_model, full_quality=p.full_quality, output_type='pil', width=p.hr_upscale_to_x, height=p.hr_upscale_to_y) # controlnet cannnot deal with latent input