mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
major refactoring of modules
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import time
|
||||
import gradio as gr
|
||||
import diffusers
|
||||
from modules import scripts, processing, shared, devices, sd_models
|
||||
from modules import scripts_manager, processing, shared, devices, sd_models
|
||||
from installer import install
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ processor_depth = None
|
||||
title = 'Flux Tools'
|
||||
|
||||
|
||||
class Script(scripts.Script):
|
||||
class Script(scripts_manager.Script):
|
||||
def title(self):
|
||||
return f'{title}'
|
||||
|
||||
@@ -44,7 +44,7 @@ class Script(scripts.Script):
|
||||
def run(self, p: processing.StableDiffusionProcessing, tool: str = 'None', prompt: float = 1.0, strength: bool = True, process: bool = True): # pylint: disable=arguments-differ
|
||||
global redux_pipe, processor_canny, processor_depth # pylint: disable=global-statement
|
||||
if tool is None or tool == 'None':
|
||||
return
|
||||
return None
|
||||
image = getattr(p, 'init_images', None)
|
||||
if image is None or len(image) == 0:
|
||||
shared.log.error(f'{title}: tool={tool} no init_images')
|
||||
@@ -147,3 +147,4 @@ class Script(scripts.Script):
|
||||
|
||||
shared.log.debug(f'{title}: tool={tool} ready time={time.time() - t0:.2f}')
|
||||
devices.torch_gc()
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user