fix ipadapter batch runs

This commit is contained in:
Vladimir Mandic
2024-03-15 09:25:14 -04:00
parent 04dbc43186
commit 8b9d85a386
8 changed files with 32 additions and 22 deletions
+4 -4
View File
@@ -251,10 +251,6 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if p.scripts is not None and isinstance(p.scripts, scripts.ScriptRunner):
p.scripts.process(p)
if shared.backend == shared.Backend.DIFFUSERS:
from modules import ipadapter
ipadapter.apply(shared.sd_model, p)
def infotext(_inxex=0): # dummy function overriden if there are iterations
return ''
@@ -277,6 +273,10 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if shared.state.interrupted:
shared.log.debug(f'Process interrupted: {n+1}/{p.n_iter}')
break
if shared.backend == shared.Backend.DIFFUSERS:
from modules import ipadapter
ipadapter.apply(shared.sd_model, p)
p.prompts = p.all_prompts[n * p.batch_size:(n+1) * p.batch_size]
p.negative_prompts = p.all_negative_prompts[n * p.batch_size:(n+1) * p.batch_size]
p.seeds = p.all_seeds[n * p.batch_size:(n+1) * p.batch_size]