refactor detailer

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-07-04 11:17:56 +02:00
parent d62a0690a2
commit 2c632bb562
11 changed files with 339 additions and 215 deletions
+2 -2
View File
@@ -320,13 +320,13 @@ def process_samples(p: StableDiffusionProcessing, samples):
sample = shared.detailer.restore(sample, p)
if isinstance(sample, list):
if len(sample) > 0:
image = Image.fromarray(sample[0])
image = sample[0] if isinstance(sample[0], Image.Image) else Image.fromarray(sample[0])
if len(sample) > 1:
annotated = sample[1] if isinstance(sample[1], Image.Image) else Image.fromarray(sample[1])
out_images.append(annotated)
out_infotexts.append("Detailer annotations")
elif sample is not None:
image = Image.fromarray(sample)
image = sample if isinstance(sample, Image.Image) else Image.fromarray(sample)
if p.color_corrections is not None and i < len(p.color_corrections):
p.ops.append('color')