From 7fe00d08402b8bf9f7f0ffef59ee3f3ad0187cfc Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Thu, 15 Sep 2022 22:39:46 +0300 Subject: [PATCH] [Bug] Alternative img2img error #508 --- scripts/img2imgalt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/img2imgalt.py b/scripts/img2imgalt.py index 3153afa7..7813bbcc 100644 --- a/scripts/img2imgalt.py +++ b/scripts/img2imgalt.py @@ -6,7 +6,7 @@ from tqdm import trange import modules.scripts as scripts import gradio as gr -from modules import processing, shared, sd_samplers +from modules import processing, shared, sd_samplers, prompt_parser from modules.processing import Processed from modules.sd_samplers import samplers from modules.shared import opts, cmd_opts, state @@ -94,7 +94,8 @@ class Script(scripts.Script): else: shared.state.job_count += 1 cond = p.sd_model.get_learned_conditioning(p.batch_size * [original_prompt]) - noise = find_noise_for_image(p, cond, unconditional_conditioning, cfg, st) + uncond = p.sd_model.get_learned_conditioning(p.batch_size * [""]) + noise = find_noise_for_image(p, cond, uncond, cfg, st) self.cache = Cached(noise, cfg, st, lat, original_prompt) sampler = samplers[p.sampler_index].constructor(p.sd_model)