mirror of https://github.com/vladmandic/automatic
reorganize scripts/extensions
Signed-off-by: vladmandic <mandic00@live.com>pull/4715/head
parent
db6b724dfa
commit
b5e9fbc7b3
|
|
@ -79,6 +79,7 @@ But also many smaller quality-of-life improvements - for full details, see [Chan
|
||||||
- legacy panels **T2I** and **I2I** are disabled by default
|
- legacy panels **T2I** and **I2I** are disabled by default
|
||||||
you can re-enable them in *settings -> ui -> hide legacy tabs*
|
you can re-enable them in *settings -> ui -> hide legacy tabs*
|
||||||
- new panel: **Server Info** with detailed runtime informaton
|
- new panel: **Server Info** with detailed runtime informaton
|
||||||
|
- rename **Scripts** to **Extras** and reorganize to split internal functionality vs external extensions
|
||||||
- **Networks** add **UNet/DiT**
|
- **Networks** add **UNet/DiT**
|
||||||
- **Localization** improved translation quality and new translations locales:
|
- **Localization** improved translation quality and new translations locales:
|
||||||
*en, en1, en2, en3, en4, hr, es, it, fr, de, pt, ru, zh, ja, ko, hi, ar, bn, ur, id, vi, tr, sr, po, he, xx, yy, qq, tlh*
|
*en, en1, en2, en3, en4, hr, es, it, fr, de, pt, ru, zh, ja, ko, hi, ar, bn, ur, id, vi, tr, sr, po, he, xx, yy, qq, tlh*
|
||||||
|
|
@ -103,6 +104,7 @@ But also many smaller quality-of-life improvements - for full details, see [Chan
|
||||||
- **Obsoleted**
|
- **Obsoleted**
|
||||||
- removed support for additional quantization engines: *BitsAndBytes, TorchAO, Optimum-Quanto, NNCF*
|
- removed support for additional quantization engines: *BitsAndBytes, TorchAO, Optimum-Quanto, NNCF*
|
||||||
*note*: SDNQ is quantization engine of choice for SD.Next
|
*note*: SDNQ is quantization engine of choice for SD.Next
|
||||||
|
- removed `flux_enhance` script
|
||||||
- **Internal**
|
- **Internal**
|
||||||
- `python==3.13` full support
|
- `python==3.13` full support
|
||||||
- `python==3.14` initial support
|
- `python==3.14` initial support
|
||||||
|
|
|
||||||
|
|
@ -424,6 +424,7 @@
|
||||||
"e": [
|
"e": [
|
||||||
{"id":"component-883","label":"Enhance prompt","localized":"","hint":"","ui":"script_flux_prompt_enhance_(legacy)"},
|
{"id":"component-883","label":"Enhance prompt","localized":"","hint":"","ui":"script_flux_prompt_enhance_(legacy)"},
|
||||||
{"id":"prompt_enhance_apply","label":"Enhance now","localized":"","hint":"Run prompt enhancement using the selected LLM model","ui":"script_prompt_enhance"},
|
{"id":"prompt_enhance_apply","label":"Enhance now","localized":"","hint":"Run prompt enhancement using the selected LLM model","ui":"script_prompt_enhance"},
|
||||||
|
{"id":"","label":"Extras","localized":"","hint":"Additional functionality that can be enabled during generate"},
|
||||||
{"id":"btn_extensions","label":"Extensions","localized":"","hint":"Application extensions"},
|
{"id":"btn_extensions","label":"Extensions","localized":"","hint":"Application extensions"},
|
||||||
{"id":"","label":"Extract LoRA","localized":"","hint":""},
|
{"id":"","label":"Extract LoRA","localized":"","hint":""},
|
||||||
{"id":"","label":"Embedded metadata","localized":"","hint":""},
|
{"id":"","label":"Embedded metadata","localized":"","hint":""},
|
||||||
|
|
@ -1242,7 +1243,7 @@
|
||||||
],
|
],
|
||||||
"s": [
|
"s": [
|
||||||
{"id":"txt2img_sampler","label":"Sampler","localized":"","hint":"Settings related to sampler and seed selection and configuration. Samplers guide the process of turning noise into an image over multiple steps.","ui":"txt2img"},
|
{"id":"txt2img_sampler","label":"Sampler","localized":"","hint":"Settings related to sampler and seed selection and configuration. Samplers guide the process of turning noise into an image over multiple steps.","ui":"txt2img"},
|
||||||
{"id":"txt2img_scripts","label":"Scripts","localized":"","hint":"Enable additional features by using selected scripts during generate process","ui":"txt2img"},
|
{"id":"","label":"Scripts","localized":"","hint":"Enable additional features by using selected scripts during generate process","ui":"txt2img"},
|
||||||
{"id":"","label":"Scale","localized":"","hint":"Resize image to target scale. If resize fixed width/height are set this option is ignored","ui":"txt2img"},
|
{"id":"","label":"Scale","localized":"","hint":"Resize image to target scale. If resize fixed width/height are set this option is ignored","ui":"txt2img"},
|
||||||
{"id":"xy_grid_swap_axes_button","label":"Swap X/Y","localized":"","hint":"","ui":"script_xyz_grid_script"},
|
{"id":"xy_grid_swap_axes_button","label":"Swap X/Y","localized":"","hint":"","ui":"script_xyz_grid_script"},
|
||||||
{"id":"yz_grid_swap_axes_button","label":"Swap Y/Z","localized":"","hint":"","ui":"script_xyz_grid_script"},
|
{"id":"yz_grid_swap_axes_button","label":"Swap Y/Z","localized":"","hint":"","ui":"script_xyz_grid_script"},
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ def check_transformers():
|
||||||
else:
|
else:
|
||||||
# Git commit-pinned version
|
# Git commit-pinned version
|
||||||
current = opts.get('transformers_version', '')
|
current = opts.get('transformers_version', '')
|
||||||
if (pkg_transformers is None) or (current != target_commit):
|
if (pkg_transformers is None) or (pkg_transformers.version.startswith('4')) or (current != target_commit):
|
||||||
if pkg_transformers is None:
|
if pkg_transformers is None:
|
||||||
log.info(f'Install: package="transformers" commit={target_commit}')
|
log.info(f'Install: package="transformers" commit={target_commit}')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from modules.logger import log
|
||||||
debug = log.trace if os.environ.get('SD_FACE_DEBUG', None) is not None else lambda *args, **kwargs: None
|
debug = log.trace if os.environ.get('SD_FACE_DEBUG', None) is not None else lambda *args, **kwargs: None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class FaceScript(scripts_manager.Script):
|
||||||
original_pipeline = None
|
original_pipeline = None
|
||||||
original_prompt_attention = None
|
original_prompt_attention = None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,14 @@ errors.install()
|
||||||
logging.getLogger("DeepSpeed").disabled = True
|
logging.getLogger("DeepSpeed").disabled = True
|
||||||
timer.startup.record("loader")
|
timer.startup.record("loader")
|
||||||
log.debug('Initializing: libraries')
|
log.debug('Initializing: libraries')
|
||||||
|
debug = os.environ.get('SD_LOAD_DEBUG')
|
||||||
|
|
||||||
|
|
||||||
def report(msg: str, e: Exception):
|
def report(msg: str, e: Exception):
|
||||||
log.error(f'Loader: {msg} {e}')
|
log.error(f'Loader: {msg} {e}')
|
||||||
log.error('Please restart the app to fix this issue')
|
log.error('Please restart the app to fix this issue')
|
||||||
|
if debug:
|
||||||
|
errors.display(e, msg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,13 @@ class Script:
|
||||||
paste_field_names = None
|
paste_field_names = None
|
||||||
section = None
|
section = None
|
||||||
standalone = False
|
standalone = False
|
||||||
|
external = False
|
||||||
on_before_component_elem_id = [] # list of callbacks to be called before a component with an elem_id is created
|
on_before_component_elem_id = [] # list of callbacks to be called before a component with an elem_id is created
|
||||||
on_after_component_elem_id = [] # list of callbacks to be called after a component with an elem_id is created
|
on_after_component_elem_id = [] # list of callbacks to be called after a component with an elem_id is created
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'Script: name="{self.name}" filename="{self.filename}" external={self.external} parent="{self.parent}" args_from={self.args_from} args_to={self.args_to} alwayson={self.alwayson} is_txt2img={self.is_txt2img} is_img2img={self.is_img2img}'
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
"""this function should return the title of the script. This is what will be displayed in the dropdown menu."""
|
"""this function should return the title of the script. This is what will be displayed in the dropdown menu."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
@ -226,11 +230,11 @@ def list_scripts(scriptdirname, extension):
|
||||||
if os.path.splitext(script.path)[1].lower() == extension and os.path.isfile(script.path):
|
if os.path.splitext(script.path)[1].lower() == extension and os.path.isfile(script.path):
|
||||||
if script.basedir == paths.script_path:
|
if script.basedir == paths.script_path:
|
||||||
priority = '0'
|
priority = '0'
|
||||||
elif script.basedir.startswith(os.path.join(paths.script_path, 'scripts')):
|
elif script.basedir.startswith(os.path.join(paths.script_path, 'scripts')) or script.basedir.startswith('scripts'):
|
||||||
priority = '1'
|
priority = '1'
|
||||||
elif script.basedir.startswith(os.path.join(paths.script_path, 'extensions-builtin')):
|
elif script.basedir.startswith(os.path.join(paths.script_path, 'extensions-builtin')) or script.basedir.startswith('extensions-builtin'):
|
||||||
priority = '2'
|
priority = '2'
|
||||||
elif script.basedir.startswith(os.path.join(paths.script_path, 'extensions')):
|
elif script.basedir.startswith(os.path.join(paths.script_path, 'extensions')) or script.basedir.startswith('extensions'):
|
||||||
priority = '3'
|
priority = '3'
|
||||||
else:
|
else:
|
||||||
priority = '9'
|
priority = '9'
|
||||||
|
|
@ -351,6 +355,8 @@ class ScriptRunner:
|
||||||
script.filename = path
|
script.filename = path
|
||||||
script.is_txt2img = not is_img2img
|
script.is_txt2img = not is_img2img
|
||||||
script.is_img2img = is_img2img
|
script.is_img2img = is_img2img
|
||||||
|
if path.startswith(paths.extensions_dir) and not path.startswith(paths.extensions_builtin_dir):
|
||||||
|
script.external = True
|
||||||
if is_control: # this is messy but show is a legacy function that is not aware of control tab
|
if is_control: # this is messy but show is a legacy function that is not aware of control tab
|
||||||
v1 = script.show(script.is_txt2img)
|
v1 = script.show(script.is_txt2img)
|
||||||
v2 = script.show(script.is_img2img)
|
v2 = script.show(script.is_img2img)
|
||||||
|
|
@ -458,6 +464,7 @@ class ScriptRunner:
|
||||||
dropdown = gr.Dropdown(label="Script", elem_id=f'{parent}_script_list', choices=["None"] + self.titles, value="None", type="index")
|
dropdown = gr.Dropdown(label="Script", elem_id=f'{parent}_script_list', choices=["None"] + self.titles, value="None", type="index")
|
||||||
inputs.insert(0, dropdown)
|
inputs.insert(0, dropdown)
|
||||||
|
|
||||||
|
# internal
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
for script in self.alwayson_scripts:
|
for script in self.alwayson_scripts:
|
||||||
if not script.standalone:
|
if not script.standalone:
|
||||||
|
|
@ -471,10 +478,11 @@ class ScriptRunner:
|
||||||
script.group = group
|
script.group = group
|
||||||
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||||
|
|
||||||
|
# extensions-builtin
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
with gr.Accordion(label="Extensions", elem_id=f'{parent}_script_alwayson') if accordion else gr.Group():
|
with gr.Group(label="Extras", elem_id=f'{parent}_extras_alwayson'):
|
||||||
for script in self.alwayson_scripts:
|
for script in self.alwayson_scripts:
|
||||||
if script.standalone:
|
if script.standalone or script.external:
|
||||||
continue
|
continue
|
||||||
if (self.name == 'control') and (paths.extensions_dir in script.filename) and (script.title() not in control_extensions):
|
if (self.name == 'control') and (paths.extensions_dir in script.filename) and (script.title() not in control_extensions):
|
||||||
log.debug(f'Script: fn="{script.filename}" type={self.name} skip')
|
log.debug(f'Script: fn="{script.filename}" type={self.name} skip')
|
||||||
|
|
@ -485,6 +493,22 @@ class ScriptRunner:
|
||||||
script.group = group
|
script.group = group
|
||||||
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||||
|
|
||||||
|
# extensions
|
||||||
|
with gr.Row():
|
||||||
|
with gr.Accordion(label="Extensions", elem_id=f'{parent}_script_alwayson') if accordion else gr.Group():
|
||||||
|
for script in self.alwayson_scripts:
|
||||||
|
if script.standalone or not script.external:
|
||||||
|
continue
|
||||||
|
if (self.name == 'control') and (paths.extensions_dir in script.filename) and (script.title() not in control_extensions):
|
||||||
|
log.debug(f'Script: fn="{script.filename}" type={self.name} skip')
|
||||||
|
continue
|
||||||
|
t0 = time.time()
|
||||||
|
with gr.Group(elem_id=f'{parent}_script_{script.title().lower().replace(" ", "_")}', elem_classes=['group-extension']) as group:
|
||||||
|
create_script_ui(script, inputs, inputs_alwayson)
|
||||||
|
script.group = group
|
||||||
|
time_setup[script.title()] = time_setup.get(script.title(), 0) + (time.time()-t0)
|
||||||
|
|
||||||
|
|
||||||
for script in self.selectable_scripts:
|
for script in self.selectable_scripts:
|
||||||
if (self.name == 'control') and (paths.extensions_dir in script.filename) and (script.title() not in control_extensions):
|
if (self.name == 'control') and (paths.extensions_dir in script.filename) and (script.title() not in control_extensions):
|
||||||
log.debug(f'Script: fn="{script.filename}" type={self.name} skip')
|
log.debug(f'Script: fn="{script.filename}" type={self.name} skip')
|
||||||
|
|
|
||||||
|
|
@ -393,28 +393,29 @@ def create_html(search_text, sort_column):
|
||||||
tags_text = ", ".join([f"<span class='extension-tag'>{x}</span>" for x in tags])
|
tags_text = ", ".join([f"<span class='extension-tag'>{x}</span>" for x in tags])
|
||||||
if ext.get('status', None) is None or type(ext['status']) == str: # old format
|
if ext.get('status', None) is None or type(ext['status']) == str: # old format
|
||||||
ext['status'] = 0
|
ext['status'] = 0
|
||||||
|
style = "style='cursor: help;width: 1rem;margin: 0.2em;'"
|
||||||
if ext['url'] is None or ext['url'] == '':
|
if ext['url'] is None or ext['url'] == '':
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Local'>{ui_symbols.svg_bullet.style('#00C0FD')}</div>"
|
status = f"<div title='Local'>{ui_symbols.svg_bullet.style('#00C0FD')}</div>"
|
||||||
elif ext['status'] > 0:
|
elif ext['status'] > 0:
|
||||||
if ext['status'] == 1:
|
if ext['status'] == 1:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Verified'>{ui_symbols.svg_bullet.style('#00FD9C')}</div>"
|
status = f"<div {style} title='Verified'>{ui_symbols.svg_bullet.style('#00FD9C')}</div>"
|
||||||
elif ext['status'] == 2:
|
elif ext['status'] == 2:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Supported only with backend: Original'>{ui_symbols.svg_bullet.style('#FFC300')}</div>"
|
status = f"<div {style} title='Supported only with backend: Original'>{ui_symbols.svg_bullet.style('#FFC300')}</div>"
|
||||||
elif ext['status'] == 3:
|
elif ext['status'] == 3:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Supported only with backend: Diffusers'>{ui_symbols.svg_bullet.style('#FFC300')}</div>"
|
status = f"<div {style} title='Supported only with backend: Diffusers'>{ui_symbols.svg_bullet.style('#FFC300')}</div>"
|
||||||
elif ext['status'] == 4:
|
elif ext['status'] == 4:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title=\"{html.escape(ext.get('note', 'custom value'))}\">{ui_symbols.svg_bullet.style('#4E22FF')}</div>"
|
status = f"<div {style} title=\"{html.escape(ext.get('note', 'custom value'))}\">{ui_symbols.svg_bullet.style('#4E22FF')}</div>"
|
||||||
elif ext['status'] == 5:
|
elif ext['status'] == 5:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Not supported'>{ui_symbols.svg_bullet.style('#CE0000')}</div>"
|
status = f"<div {style} title='Not supported'>{ui_symbols.svg_bullet.style('#CE0000')}</div>"
|
||||||
elif ext['status'] == 6:
|
elif ext['status'] == 6:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Just discovered'>{ui_symbols.svg_bullet.style('#AEAEAE')}</div>"
|
status = f"<div {style} title='Just discovered'>{ui_symbols.svg_bullet.style('#AEAEAE')}</div>"
|
||||||
else:
|
else:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Unknown status'>{ui_symbols.svg_bullet.style('#008EBC')}</div>"
|
status = f"<div {style} title='Unknown status'>{ui_symbols.svg_bullet.style('#008EBC')}</div>"
|
||||||
else:
|
else:
|
||||||
if updated < datetime.now(timezone.utc) - timedelta(6*30): # TZ-aware
|
if updated < datetime.now(timezone.utc) - timedelta(6*30): # TZ-aware
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='Unmaintained'>{ui_symbols.svg_bullet.style('#C000CF')}</div>"
|
status = f"<div {style} title='Unmaintained'>{ui_symbols.svg_bullet.style('#C000CF')}</div>"
|
||||||
else:
|
else:
|
||||||
status = f"<div style='cursor:help;width:1rem;margin:auto;' title='No info'>{ui_symbols.svg_bullet.style('#7C7C7C')}</div>"
|
status = f"<div {style} title='No info'>{ui_symbols.svg_bullet.style('#7C7C7C')}</div>"
|
||||||
|
|
||||||
code += f"""
|
code += f"""
|
||||||
<tr style="display: {visible}">
|
<tr style="display: {visible}">
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ def set_free_noise(frames):
|
||||||
shared.sd_model.enable_free_noise(context_length=context_length, context_stride=context_stride)
|
shared.sd_model.enable_free_noise(context_length=context_length, context_stride=context_stride)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class AnimateDiffScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Video: AnimateDiff'
|
return 'Video: AnimateDiff'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules.logger import log
|
||||||
registered = False
|
registered = False
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class APGScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ img2img = True
|
||||||
|
|
||||||
### Script definition
|
### Script definition
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class AutoColorInpaintScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return title
|
return title
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from modules import scripts_manager, processing, shared, sd_models
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class BLIPDiffusionScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'BLIP Diffusion: Controllable Generation and Editing'
|
return 'BLIP Diffusion: Controllable Generation and Editing'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ from modules import scripts_manager, devices, errors, processing, shared, sd_mod
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class ConsiStoryScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.anchor_cache_first_stage = None
|
self.anchor_cache_first_stage = None
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules import shared, scripts_manager, processing, processing_helpers, sd_
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class CtrlXScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Ctrl-X: Controlling Structure and Appearance'
|
return 'Ctrl-X: Controlling Structure and Appearance'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ def exec_with_return(code, module):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class CustomCodeScript(scripts_manager.Script):
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Custom code"
|
return "Custom code"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from modules.logger import log
|
||||||
COLORMAP = ['autumn', 'bone', 'jet', 'winter', 'rainbow', 'ocean', 'summer', 'spring', 'cool', 'hsv', 'pink', 'hot', 'parula', 'magma', 'inferno', 'plasma', 'viridis', 'cividis', 'twilight', 'shifted', 'turbo', 'deepgreen']
|
COLORMAP = ['autumn', 'bone', 'jet', 'winter', 'rainbow', 'ocean', 'summer', 'spring', 'cool', 'hsv', 'pink', 'hot', 'parula', 'magma', 'inferno', 'plasma', 'viridis', 'cividis', 'twilight', 'shifted', 'turbo', 'deepgreen']
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class DAAMScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'DAAM: Diffusion Attentive Attribution Maps'
|
return 'DAAM: Diffusion Attentive Attribution Maps'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1220,7 +1220,7 @@ class DemoFusionSDXLPipeline(DiffusionPipeline, FromSingleFileMixin, LoraLoaderM
|
||||||
|
|
||||||
### Script definition
|
### Script definition
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class DemoFusionScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'DemoFusion: High-Resolution Image Generation'
|
return 'DemoFusion: High-Resolution Image Generation'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1847,7 +1847,7 @@ MODELS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class DifferentialDiffusionScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Differential diffusion: Individual Pixel Strength'
|
return 'Differential diffusion: Individual Pixel Strength'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
# repo: https://huggingface.co/gokaygokay/Flux-Prompt-Enhance
|
|
||||||
|
|
||||||
import time
|
|
||||||
import random
|
|
||||||
import threading
|
|
||||||
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
||||||
import gradio as gr
|
|
||||||
from modules import shared, scripts_manager, devices, processing
|
|
||||||
from modules.logger import log
|
|
||||||
|
|
||||||
|
|
||||||
repo_id = "gokaygokay/Flux-Prompt-Enhance"
|
|
||||||
num_return_sequences = 5
|
|
||||||
load_lock = threading.Lock()
|
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
|
||||||
prompts = [['']]
|
|
||||||
tokenizer: AutoTokenizer = None
|
|
||||||
model: AutoModelForSeq2SeqLM = None
|
|
||||||
prefix: str = "enhance prompt: "
|
|
||||||
button: gr.Button = None
|
|
||||||
auto_apply: gr.Checkbox = None
|
|
||||||
max_length: gr.Slider = None
|
|
||||||
temperature: gr.Slider = None
|
|
||||||
repetition_penalty: gr.Slider = None
|
|
||||||
table: gr.DataFrame = None
|
|
||||||
prompt: gr.Textbox = None
|
|
||||||
|
|
||||||
def title(self):
|
|
||||||
return 'Flux Prompt enhance (Legacy)'
|
|
||||||
|
|
||||||
def show(self, is_img2img):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def load(self):
|
|
||||||
with load_lock:
|
|
||||||
if self.tokenizer is None:
|
|
||||||
self.tokenizer = AutoTokenizer.from_pretrained('gokaygokay/Flux-Prompt-Enhance', cache_dir=shared.opts.hfcache_dir)
|
|
||||||
if self.model is None:
|
|
||||||
log.info(f'Prompt enhance: model="{repo_id}"')
|
|
||||||
self.model = AutoModelForSeq2SeqLM.from_pretrained('gokaygokay/Flux-Prompt-Enhance', cache_dir=shared.opts.hfcache_dir).to(device=devices.cpu, dtype=devices.dtype)
|
|
||||||
|
|
||||||
def enhance(self, prompt, auto_apply: bool = False, temperature: float = 0.7, repetition_penalty: float = 1.2, max_length: int = 128):
|
|
||||||
self.load()
|
|
||||||
t0 = time.time()
|
|
||||||
input_text = self.prefix + prompt
|
|
||||||
input_ids = self.tokenizer(input_text, return_tensors="pt").input_ids.to(devices.device)
|
|
||||||
self.model = self.model.to(devices.device)
|
|
||||||
kwargs = {
|
|
||||||
'max_length': int(max_length),
|
|
||||||
'num_return_sequences': int(num_return_sequences),
|
|
||||||
'do_sample': True,
|
|
||||||
'temperature': float(temperature),
|
|
||||||
'repetition_penalty': float(repetition_penalty),
|
|
||||||
}
|
|
||||||
try:
|
|
||||||
outputs = self.model.generate(input_ids, **kwargs)
|
|
||||||
except Exception as e:
|
|
||||||
log.error(f'Prompt enhance: error="{e}"')
|
|
||||||
return [['']]
|
|
||||||
self.model = self.model.to(devices.cpu)
|
|
||||||
prompts = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
|
||||||
prompts = [[p] for p in prompts]
|
|
||||||
t1 = time.time()
|
|
||||||
log.info(f'Prompt enhance: temperature={temperature} repetition={repetition_penalty} length={max_length} sequences={num_return_sequences} apply={auto_apply} time={t1-t0:.2f}s')
|
|
||||||
return prompts
|
|
||||||
|
|
||||||
def select(self, cell: gr.SelectData, _table):
|
|
||||||
prompt = cell.value if hasattr(cell, 'value') else cell
|
|
||||||
log.info(f'Prompt enhance: prompt="{prompt}"')
|
|
||||||
return prompt
|
|
||||||
|
|
||||||
def ui(self, _is_img2img):
|
|
||||||
with gr.Row():
|
|
||||||
self.button = gr.Button(value='Enhance prompt')
|
|
||||||
self.auto_apply = gr.Checkbox(label='Auto apply', value=False)
|
|
||||||
with gr.Row():
|
|
||||||
self.max_length = gr.Slider(label='Length', minimum=64, maximum=512, step=1, value=128)
|
|
||||||
self.temperature = gr.Slider(label='Temperature', minimum=0.1, maximum=2.0, step=0.05, value=0.7)
|
|
||||||
self.repetition_penalty = gr.Slider(label='Penalty', minimum=0.1, maximum=2.0, step=0.05, value=1.2)
|
|
||||||
with gr.Row():
|
|
||||||
self.table = gr.DataFrame(self.prompts, label='', show_label=False, interactive=False, wrap=True, datatype="str", col_count=1, headers=['Prompts'])
|
|
||||||
|
|
||||||
if self.prompt is not None:
|
|
||||||
self.button.click(fn=self.enhance, inputs=[self.prompt, self.auto_apply, self.temperature, self.repetition_penalty, self.max_length], outputs=[self.table])
|
|
||||||
self.table.select(fn=self.select, inputs=[self.table], outputs=[self.prompt])
|
|
||||||
return [self.auto_apply, self.temperature, self.repetition_penalty, self.max_length]
|
|
||||||
|
|
||||||
def run(self, p: processing.StableDiffusionProcessing, auto_apply, temperature, repetition_penalty, max_length): # pylint: disable=arguments-differ
|
|
||||||
if auto_apply:
|
|
||||||
p.prompt = shared.prompt_styles.apply_styles_to_prompt(p.prompt, p.styles)
|
|
||||||
p.negative_prompt = shared.prompt_styles.apply_negative_styles_to_prompt(p.negative_prompt, p.styles)
|
|
||||||
shared.prompt_styles.apply_styles_to_extra(p)
|
|
||||||
p.styles = []
|
|
||||||
log.debug(f'Prompt enhance: source="{p.prompt}"')
|
|
||||||
prompts = self.enhance(p.prompt, auto_apply, temperature, repetition_penalty, max_length)
|
|
||||||
p.prompt = random.choice(prompts)[0]
|
|
||||||
log.debug(f'Prompt enhance: prompt="{p.prompt}"')
|
|
||||||
|
|
||||||
def after_component(self, component, **kwargs): # searching for actual ui prompt components
|
|
||||||
if getattr(component, 'elem_id', '') in ['txt2img_prompt', 'img2img_prompt', 'control_prompt', 'video_prompt']:
|
|
||||||
self.prompt = component
|
|
||||||
self.prompt.use_original = True
|
|
||||||
|
|
@ -15,7 +15,7 @@ processor_depth = None
|
||||||
title = 'Flux Tools'
|
title = 'Flux Tools'
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class FluxToolsScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return f'{title}'
|
return f'{title}'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules.logger import log
|
||||||
registered = False
|
registered = False
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class FreeScaleScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from modules.processing import get_processed
|
||||||
from modules.shared import opts, state
|
from modules.shared import opts, state
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class HDRScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "HDR: High Dynamic Range"
|
return "HDR: High Dynamic Range"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from modules.logger import log
|
||||||
from modules.files_cache import list_files
|
from modules.files_cache import list_files
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class I2IFolderScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "CeeTeeDees I2I folder batch inference"
|
return "CeeTeeDees I2I folder batch inference"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ MODELS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class VGenI2VScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Video: VGen Image-to-Video'
|
return 'Video: VGen Image-to-Video'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ def load_infiniteyou(model: str):
|
||||||
sd_models.set_diffuser_options(shared.sd_model)
|
sd_models.set_diffuser_options(shared.sd_model)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class InfiniteYouScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return f'{prefix}: Flexible Photo Recrafting'
|
return f'{prefix}: Flexible Photo Recrafting'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from modules.logger import log
|
||||||
from modules import scripts_manager, processing, shared, devices
|
from modules import scripts_manager, processing, shared, devices
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class InitLatentsScript(scripts_manager.Script):
|
||||||
standalone = False
|
standalone = False
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules import scripts_manager, processing, shared, sd_models, devices, ipa
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class InstantIRScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from modules.logger import log
|
||||||
MAX_ADAPTERS = 4
|
MAX_ADAPTERS = 4
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class IPAdapterScript(scripts_manager.Script):
|
||||||
standalone = True
|
standalone = True
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ encoder = "laion/CLIP-ViT-H-14-laion2B-s32B-b79K"
|
||||||
folder = os.path.join('repositories', 'ip_instruct')
|
folder = os.path.join('repositories', 'ip_instruct')
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class IPInstructScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from modules import scripts_manager, processing, shared, sd_models, devices
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class KohyaHiResFixScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Kohya HiRes Fix'
|
return 'Kohya HiRes Fix'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from modules import shared, scripts_manager, sd_models
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class LayerDiffuseScript(scripts_manager.Script):
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'LayerDiffuse: Transparent Image'
|
return 'LayerDiffuse: Transparent Image'
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ ASPECT_RATIOS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class LBMScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'LBM: Latent Bridge Matching'
|
return 'LBM: Latent Bridge Matching'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from modules import scripts_manager, processing, shared, devices, sd_models
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class LEditsScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'LEdits: Limitless Image Editing'
|
return 'LEdits: Limitless Image Editing'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from modules.processing import Processed
|
||||||
from modules.shared import opts, state, log
|
from modules.shared import opts, state, log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class LoopbackScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Loopback"
|
return "Loopback"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ max_xtiles = 4
|
||||||
max_ytiles = 4
|
max_ytiles = 4
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class MoDScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ def check_dependencies():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class MixtureTilingScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Mixture Tiling: Scene Composition'
|
return 'Mixture Tiling: Scene Composition'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ tokenizer = None
|
||||||
text_encoder_path = None
|
text_encoder_path = None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class MuLanScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'MuLan: Multi Language Prompts'
|
return 'MuLan: Multi Language Prompts'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ def get_matched_noise(_np_src_image, np_mask_rgb, noise_q=1, color_variation=0.0
|
||||||
return np.clip(matched_noise, 0., 1.)
|
return np.clip(matched_noise, 0., 1.)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class OutpaintingScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Outpainting"
|
return "Outpainting"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from modules import scripts_manager, processing, shared, sd_models, devices, ima
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class PixelSmithScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from modules.shared import opts, state, log
|
||||||
from modules.image.grid import split_grid
|
from modules.image.grid import split_grid
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class OutpaintingAltScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Outpainting alternative"
|
return "Outpainting alternative"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ class Options:
|
||||||
return get_model_display_name(Options.default)
|
return get_model_display_name(Options.default)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class PromptEnhanceScript(scripts_manager.Script):
|
||||||
prompt: gr.Textbox = None
|
prompt: gr.Textbox = None
|
||||||
image: gr.Image = None
|
image: gr.Image = None
|
||||||
model: str = None
|
model: str = None
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules.shared import opts, log
|
||||||
import modules.sd_samplers
|
import modules.sd_samplers
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class PromptMatrixScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Prompt matrix"
|
return "Prompt matrix"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ def load_prompt_file(file):
|
||||||
return None, "\n".join(lines), gr.update(lines=7)
|
return None, "\n".join(lines), gr.update(lines=7)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class PromptsFromFileScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "Prompts from file"
|
return "Prompts from file"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ registered = False
|
||||||
uploaded_images = []
|
uploaded_images = []
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class PulIDScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.pulid = None
|
self.pulid = None
|
||||||
self.cache = None
|
self.cache = None
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ def hijack_register_modules(self, **kwargs):
|
||||||
setattr(self, name, module)
|
setattr(self, name, module)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class RegionalPromptingScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Regional prompting'
|
return 'Regional prompting'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ models = {
|
||||||
'SDXL v1 interpolation': 'resadapter_v1_sdxl_interpolation',
|
'SDXL v1 interpolation': 'resadapter_v1_sdxl_interpolation',
|
||||||
}
|
}
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class ResAdapterScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'ResAdapter: Domain Consistent Resolution'
|
return 'ResAdapter: Domain Consistent Resolution'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from modules import scripts_manager, shared
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class ROCmScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "ROCm: Advanced Config"
|
return "ROCm: Advanced Config"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from modules.image.util import flatten
|
||||||
from modules.image.grid import split_grid
|
from modules.image.grid import split_grid
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class SDUpscaleScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return "SD Upscale"
|
return "SD Upscale"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from modules.logger import log
|
||||||
registered = False
|
registered = False
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class SLGScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.register()
|
self.register()
|
||||||
|
|
|
||||||
|
|
@ -1608,7 +1608,7 @@ from modules import shared, scripts_manager, processing, sd_models
|
||||||
from modules.logger import log
|
from modules.logger import log
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class SoftFillScript(scripts_manager.Script):
|
||||||
orig_pipeline = None
|
orig_pipeline = None
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ models = {
|
||||||
"SVD XT 1.1": "stabilityai/stable-video-diffusion-img2vid-xt-1-1",
|
"SVD XT 1.1": "stabilityai/stable-video-diffusion-img2vid-xt-1-1",
|
||||||
}
|
}
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class SVDScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Video: Stable Video Diffusion'
|
return 'Video: Stable Video Diffusion'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ supported_model_list = ['sdxl']
|
||||||
orig_prompt_attention = None
|
orig_prompt_attention = None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class StyleAlignedScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Style Aligned Image Generation'
|
return 'Style Aligned Image Generation'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from modules.logger import log
|
||||||
from installer import install
|
from installer import install
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class TGateScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'T-Gate: Accelerate via Gating Attention'
|
return 'T-Gate: Accelerate via Gating Attention'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ MODELS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class ModelScopeScript(scripts_manager.Script):
|
||||||
def title(self):
|
def title(self):
|
||||||
return 'Video: ModelScope'
|
return 'Video: ModelScope'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ def asymmetricConv2DConvForward(self, input: Tensor, weight: Tensor, bias: Optio
|
||||||
return F.conv2d(working, weight, bias, self.stride, _pair(0), self.dilation, self.groups)
|
return F.conv2d(working, weight, bias, self.stride, _pair(0), self.dilation, self.groups)
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class TilingScript(scripts_manager.Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.orig_pipe = None
|
self.orig_pipe = None
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ from modules.logger import log
|
||||||
debug = log.trace if os.environ.get('SD_XYZ_DEBUG', None) is not None else lambda *args, **kwargs: None
|
debug = log.trace if os.environ.get('SD_XYZ_DEBUG', None) is not None else lambda *args, **kwargs: None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class XYZGridScript(scripts_manager.Script):
|
||||||
current_axis_options = []
|
current_axis_options = []
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ xyz_results_cache = None
|
||||||
debug = log.trace if os.environ.get('SD_XYZ_DEBUG', None) is not None else lambda *args, **kwargs: None
|
debug = log.trace if os.environ.get('SD_XYZ_DEBUG', None) is not None else lambda *args, **kwargs: None
|
||||||
|
|
||||||
|
|
||||||
class Script(scripts_manager.Script):
|
class XYZGridScript(scripts_manager.Script):
|
||||||
current_axis_options = []
|
current_axis_options = []
|
||||||
|
|
||||||
def show(self, is_img2img):
|
def show(self, is_img2img):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue