fix ipadapter unload/reapply and use in control

This commit is contained in:
Vladimir Mandic
2024-01-30 17:02:31 -05:00
parent 8f1f538bc9
commit ccc38dde95
5 changed files with 54 additions and 64 deletions
+2 -1
View File
@@ -769,7 +769,9 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
finally:
if not shared.opts.cuda_compile:
sd_models.apply_token_merging(p.sd_model, 0)
script_callbacks.after_process_callback(p)
if p.override_settings_restore_afterwards: # restore opts to original state
for k, v in stored_opts.items():
setattr(shared.opts, k, v)
@@ -1193,7 +1195,6 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
if shared.opts.sd_vae_sliced_encode and len(decoded_samples) > 1:
samples = torch.stack([self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(torch.unsqueeze(resized_sample, 0)))[0] for resized_sample in resized_samples])
else:
# TODO add TEASD support
samples = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(resized_samples))
image_conditioning = self.img2img_image_conditioning(resized_samples, samples)
else: