mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
xyzgrid with control tab
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -77,19 +77,19 @@ predefined_sdxl = {
|
||||
# 'StabilityAI Sketch R256': 'stabilityai/control-lora/control-LoRAs-rank256/control-lora-sketch-rank256.safetensors',
|
||||
}
|
||||
predefined_f1 = {
|
||||
"InstantX Union": 'InstantX/FLUX.1-dev-Controlnet-Union',
|
||||
"InstantX Canny": 'InstantX/FLUX.1-dev-Controlnet-Canny',
|
||||
"JasperAI Depth": 'jasperai/Flux.1-dev-Controlnet-Depth',
|
||||
"BlackForrestLabs Canny LoRA": '/huggingface.co/black-forest-labs/FLUX.1-Canny-dev-lora/flux1-canny-dev-lora.safetensors',
|
||||
"BlackForrestLabs Depth LoRA": '/huggingface.co/black-forest-labs/FLUX.1-Depth-dev-lora/flux1-depth-dev-lora.safetensors',
|
||||
"JasperAI Surface Normals": 'jasperai/Flux.1-dev-Controlnet-Surface-Normals',
|
||||
"JasperAI Upscaler": 'jasperai/Flux.1-dev-Controlnet-Upscaler',
|
||||
"Shakker-Labs Union": 'Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro',
|
||||
"Shakker-Labs Pose": 'Shakker-Labs/FLUX.1-dev-ControlNet-Pose',
|
||||
"Shakker-Labs Depth": 'Shakker-Labs/FLUX.1-dev-ControlNet-Depth',
|
||||
"XLabs-AI Canny": 'XLabs-AI/flux-controlnet-canny-diffusers',
|
||||
"XLabs-AI Depth": 'XLabs-AI/flux-controlnet-depth-diffusers',
|
||||
"XLabs-AI HED": 'XLabs-AI/flux-controlnet-hed-diffusers'
|
||||
"InstantX Union F1": 'InstantX/FLUX.1-dev-Controlnet-Union',
|
||||
"InstantX Canny F1": 'InstantX/FLUX.1-dev-Controlnet-Canny',
|
||||
"JasperAI Depth F1": 'jasperai/Flux.1-dev-Controlnet-Depth',
|
||||
"BlackForrestLabs Canny LoRA F1": '/huggingface.co/black-forest-labs/FLUX.1-Canny-dev-lora/flux1-canny-dev-lora.safetensors',
|
||||
"BlackForrestLabs Depth LoRA F1": '/huggingface.co/black-forest-labs/FLUX.1-Depth-dev-lora/flux1-depth-dev-lora.safetensors',
|
||||
"JasperAI Surface Normals F1": 'jasperai/Flux.1-dev-Controlnet-Surface-Normals',
|
||||
"JasperAI Upscaler F1": 'jasperai/Flux.1-dev-Controlnet-Upscaler',
|
||||
"Shakker-Labs Union F1": 'Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro',
|
||||
"Shakker-Labs Pose F1": 'Shakker-Labs/FLUX.1-dev-ControlNet-Pose',
|
||||
"Shakker-Labs Depth F1": 'Shakker-Labs/FLUX.1-dev-ControlNet-Depth',
|
||||
"XLabs-AI Canny F1": 'XLabs-AI/flux-controlnet-canny-diffusers',
|
||||
"XLabs-AI Depth F1": 'XLabs-AI/flux-controlnet-depth-diffusers',
|
||||
"XLabs-AI HED F1": 'XLabs-AI/flux-controlnet-hed-diffusers'
|
||||
}
|
||||
predefined_sd3 = {
|
||||
"StabilityAI Canny SD35": 'diffusers-internal-dev/sd35-controlnet-canny-8b',
|
||||
@@ -452,6 +452,7 @@ class ControlNetPipeline():
|
||||
debug_log(f'Control {what} pipeline: class={self.pipeline.__class__.__name__} time={t1-t0:.2f}')
|
||||
|
||||
def restore(self):
|
||||
self.pipeline.unload_lora_weights()
|
||||
if self.pipeline is not None:
|
||||
self.pipeline.unload_lora_weights()
|
||||
self.pipeline = None
|
||||
return self.orig_pipeline
|
||||
|
||||
@@ -1,31 +1,51 @@
|
||||
import diffusers.pipelines as p
|
||||
|
||||
|
||||
def is_sd15(model):
|
||||
def is_compatible(model, compatible):
|
||||
if model is None:
|
||||
return False
|
||||
if hasattr(model, '__name__'):
|
||||
return model.__name__ == p.StableDiffusionPipeline.__name__ or model.__name__ == p.StableDiffusionImg2ImgPipeline.__name__ or model.__name__ == p.StableDiffusionInpaintPipeline.__name__
|
||||
return isinstance(model, p.StableDiffusionPipeline) or isinstance(model, p.StableDiffusionImg2ImgPipeline) or isinstance(model, p.StableDiffusionInpaintPipeline)
|
||||
if hasattr(model, '__class__'):
|
||||
return any(model.__class__.__name__ == c.__name__ for c in compatible)
|
||||
return any(isinstance(model, c) for c in compatible)
|
||||
|
||||
|
||||
def is_sd15(model):
|
||||
compatible = [
|
||||
p.StableDiffusionPipeline,
|
||||
p.StableDiffusionImg2ImgPipeline,
|
||||
p.StableDiffusionInpaintPipeline,
|
||||
p.StableDiffusionControlNetPipeline,
|
||||
]
|
||||
return is_compatible(model, compatible)
|
||||
|
||||
|
||||
def is_sdxl(model):
|
||||
if model is None:
|
||||
return False
|
||||
if hasattr(model, '__name__'):
|
||||
return model.__name__ == p.StableDiffusionXLPipeline.__name__ or model.__name__ == p.StableDiffusionXLImg2ImgPipeline.__name__ or model.__name__ == p.StableDiffusionXLInpaintPipeline.__name__
|
||||
return isinstance(model, p.StableDiffusionXLPipeline) or isinstance(model, p.StableDiffusionXLImg2ImgPipeline) or isinstance(model, p.StableDiffusionXLInpaintPipeline)
|
||||
compatible = [
|
||||
p.StableDiffusionXLPipeline,
|
||||
p.StableDiffusionXLImg2ImgPipeline,
|
||||
p.StableDiffusionXLInpaintPipeline,
|
||||
p.StableDiffusionXLControlNetPipeline,
|
||||
p.StableDiffusionXLControlNetImg2ImgPipeline,
|
||||
p.StableDiffusionXLControlNetUnionPipeline,
|
||||
]
|
||||
return is_compatible(model, compatible)
|
||||
|
||||
|
||||
def is_f1(model):
|
||||
if model is None:
|
||||
return False
|
||||
if hasattr(model, '__name__'):
|
||||
return model.__name__ == p.FluxPipeline.__name__ or model.__name__ == p.FluxImg2ImgPipeline.__name__ or model.__name__ == p.FluxInpaintPipeline.__name__
|
||||
return isinstance(model, p.FluxPipeline) or isinstance(model, p.FluxImg2ImgPipeline) or isinstance(model, p.FluxInpaintPipeline)
|
||||
compatible = [
|
||||
p.FluxPipeline,
|
||||
p.FluxImg2ImgPipeline,
|
||||
p.FluxInpaintPipeline,
|
||||
p.FluxControlNetPipeline,
|
||||
]
|
||||
return is_compatible(model, compatible)
|
||||
|
||||
|
||||
def is_sd3(model):
|
||||
if model is None:
|
||||
return False
|
||||
if hasattr(model, '__name__'):
|
||||
return model.__name__ == p.StableDiffusion3Pipeline.__name__ or model.__name__ == p.StableDiffusion3Img2ImgPipeline.__name__ or model.__name__ == p.StableDiffusion3InpaintPipeline.__name__
|
||||
return isinstance(model, p.StableDiffusion3Pipeline) or isinstance(model, p.StableDiffusion3Img2ImgPipeline) or isinstance(model, p.StableDiffusion3InpaintPipeline)
|
||||
compatible = [
|
||||
p.StableDiffusion3Pipeline,
|
||||
p.StableDiffusion3Img2ImgPipeline,
|
||||
p.StableDiffusion3InpaintPipeline,
|
||||
p.StableDiffusion3ControlNetPipeline,
|
||||
]
|
||||
return is_compatible(model, compatible)
|
||||
|
||||
Reference in New Issue
Block a user