mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
detailer validate if model is compatible
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+7
-4
@@ -1,14 +1,14 @@
|
||||
# Change Log for SD.Next
|
||||
|
||||
## Update for 2025-11-09
|
||||
## Update for 2025-11-10
|
||||
|
||||
### Highlights for 2025-11-09
|
||||
### Highlights for 2025-11-10
|
||||
|
||||
TBD
|
||||
|
||||
### Details for 2025-11-09
|
||||
### Details for 2025-11-10
|
||||
|
||||
- **Features**
|
||||
- **Features**
|
||||
- **kanvas**: new module for native canvas-based image manipulation
|
||||
kanvas is a full replacement for *img2img, inpaint and outpaint* controls
|
||||
see [docs](https://vladmandic.github.io/sdnext-docs/Kanvas/) for details
|
||||
@@ -18,6 +18,7 @@ TBD
|
||||
- **attention**: additional torch attention settings
|
||||
- **lora**: separate fuse setting for native-vs-diffuser implementations
|
||||
- **auth**: strong-enforce auth check on all api endpoints
|
||||
- **amdgpu**: prefer rocm-on-windows over zluda
|
||||
- **Internal**
|
||||
- refactor attention handling
|
||||
- remove obsolete video scripts
|
||||
@@ -26,9 +27,11 @@ TBD
|
||||
- hires: strength save/load in metadata, thanks @awsr
|
||||
- imgi2img: fix initial scale tab, thanks @awsr
|
||||
- log: client log formatting, thanks @awsr
|
||||
- rocm: check if installed before forcing install
|
||||
- pony-v7: fix text-encoder
|
||||
- detailer: with face-restorers
|
||||
- detailer: using lora in detailer prompt
|
||||
- detailer: fail on unsupported models instead of corrputing results
|
||||
|
||||
## Update for 2025-11-06
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from copy import copy
|
||||
import numpy as np
|
||||
import gradio as gr
|
||||
from PIL import Image, ImageDraw
|
||||
from modules import shared, processing, devices, processing_class, ui_common, ui_components, ui_symbols, images, extra_networks
|
||||
from modules import shared, processing, devices, processing_class, ui_common, ui_components, ui_symbols, images, extra_networks, sd_models
|
||||
from modules.detailer import Detailer
|
||||
|
||||
|
||||
@@ -239,6 +239,12 @@ class YoloRestorer(Detailer):
|
||||
p.detailer_active = 0
|
||||
if np_image is None or p.detailer_active >= p.batch_size * p.n_iter:
|
||||
return np_image
|
||||
|
||||
shared.sd_model = sd_models.set_diffuser_pipe(shared.sd_model, sd_models.DiffusersTaskType.INPAINTING)
|
||||
if (sd_models.get_diffusers_task(shared.sd_model) != sd_models.DiffusersTaskType.INPAINTING) and (shared.sd_model.__class__.__name__ not in sd_models.pipe_switch_task_exclude):
|
||||
shared.log.error(f'Detailer: model="{shared.sd_model.__class__.__name__}" not compatible')
|
||||
return np_image
|
||||
|
||||
models = []
|
||||
if len(shared.opts.detailer_args) > 0:
|
||||
models = [m.strip() for m in re.split(r'[\n,;]+', shared.opts.detailer_args)]
|
||||
@@ -367,6 +373,7 @@ class YoloRestorer(Detailer):
|
||||
if item.mask is None:
|
||||
continue
|
||||
pc.keep_prompts = True
|
||||
shared.sd_model.fail_on_switch_error = True
|
||||
pc.prompt = prompt_lines[i*len(items)+j]
|
||||
pc.negative_prompt = negative_lines[i*len(items)+j]
|
||||
pc.prompts = [pc.prompt]
|
||||
@@ -382,6 +389,7 @@ class YoloRestorer(Detailer):
|
||||
jobid = shared.state.begin('Detailer')
|
||||
pp = processing.process_images_inner(pc)
|
||||
extra_networks.deactivate(pc, force=True)
|
||||
shared.sd_model.fail_on_switch_error = False
|
||||
shared.state.end(jobid)
|
||||
|
||||
del pc.recursion
|
||||
|
||||
Reference in New Issue
Block a user