mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-01-26 19:09:45 +00:00
prompt-all-in-one now works
fix for webui backward compatibility
This commit is contained in:
@@ -29,19 +29,8 @@ class ForgeDiffusionEngine:
|
|||||||
self.forge_objects_after_applying_lora = None
|
self.forge_objects_after_applying_lora = None
|
||||||
|
|
||||||
self.current_lora_hash = str([])
|
self.current_lora_hash = str([])
|
||||||
self.tiling_enabled = False
|
|
||||||
|
|
||||||
self.first_stage_model = None # set this so that you can change VAE in UI
|
self.fix_for_webui_backward_compatibility()
|
||||||
self.use_distilled_cfg_scale = False
|
|
||||||
|
|
||||||
# WebUI Dirty Legacy
|
|
||||||
self.is_sd1 = False
|
|
||||||
self.is_sd2 = False
|
|
||||||
self.is_sdxl = False
|
|
||||||
self.is_sd3 = False
|
|
||||||
|
|
||||||
def is_webui_legacy_model(self):
|
|
||||||
return self.is_sd1 or self.is_sd2 or self.is_sdxl or self.is_sd3
|
|
||||||
|
|
||||||
def set_clip_skip(self, clip_skip):
|
def set_clip_skip(self, clip_skip):
|
||||||
pass
|
pass
|
||||||
@@ -59,4 +48,18 @@ class ForgeDiffusionEngine:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def get_prompt_lengths_on_ui(self, prompt):
|
def get_prompt_lengths_on_ui(self, prompt):
|
||||||
pass
|
return 0, 75
|
||||||
|
|
||||||
|
def is_webui_legacy_model(self):
|
||||||
|
return self.is_sd1 or self.is_sd2 or self.is_sdxl or self.is_sd3
|
||||||
|
|
||||||
|
def fix_for_webui_backward_compatibility(self):
|
||||||
|
self.tiling_enabled = False
|
||||||
|
self.first_stage_model = None
|
||||||
|
self.cond_stage_model = None
|
||||||
|
self.use_distilled_cfg_scale = False
|
||||||
|
self.is_sd1 = False
|
||||||
|
self.is_sd2 = False
|
||||||
|
self.is_sdxl = False
|
||||||
|
self.is_sd3 = False
|
||||||
|
return
|
||||||
|
|||||||
@@ -1,41 +1,32 @@
|
|||||||
# class StableDiffusionModelHijack:
|
class StableDiffusionModelHijack:
|
||||||
# fixes = None
|
|
||||||
# layers = None
|
def apply_optimizations(self, option=None):
|
||||||
# circular_enabled = False
|
pass
|
||||||
# clip = None
|
|
||||||
# optimization_method = None
|
def convert_sdxl_to_ssd(self, m):
|
||||||
#
|
pass
|
||||||
# def __init__(self):
|
|
||||||
# self.extra_generation_params = {}
|
def hijack(self, m):
|
||||||
# self.comments = []
|
pass
|
||||||
#
|
|
||||||
# def apply_optimizations(self, option=None):
|
def undo_hijack(self, m):
|
||||||
# pass
|
pass
|
||||||
#
|
|
||||||
# def convert_sdxl_to_ssd(self, m):
|
def apply_circular(self, enable):
|
||||||
# pass
|
pass
|
||||||
#
|
|
||||||
# def hijack(self, m):
|
def clear_comments(self):
|
||||||
# pass
|
pass
|
||||||
#
|
|
||||||
# def undo_hijack(self, m):
|
def get_prompt_lengths(self, text, cond_stage_model):
|
||||||
# pass
|
from modules import shared
|
||||||
#
|
return shared.sd_model.get_prompt_lengths_on_ui(text)
|
||||||
# def apply_circular(self, enable):
|
|
||||||
# pass
|
def redo_hijack(self, m):
|
||||||
#
|
pass
|
||||||
# def clear_comments(self):
|
|
||||||
# self.comments = []
|
|
||||||
# self.extra_generation_params = {}
|
model_hijack = StableDiffusionModelHijack()
|
||||||
#
|
|
||||||
# def get_prompt_lengths(self, text, cond_stage_model):
|
|
||||||
# pass
|
|
||||||
#
|
|
||||||
# def redo_hijack(self, m):
|
|
||||||
# pass
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# model_hijack = StableDiffusionModelHijack()
|
|
||||||
|
|
||||||
# import torch
|
# import torch
|
||||||
# from torch.nn.functional import silu
|
# from torch.nn.functional import silu
|
||||||
|
|||||||
Reference in New Issue
Block a user