add longcat image and image-edit

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2025-12-16 08:58:22 +01:00
parent 2ac0a67bd9
commit 409ad8d2bd
12 changed files with 78 additions and 6 deletions
+1
View File
@@ -43,6 +43,7 @@ force_models_diffusers = [ # forced always
'chrono',
'z_image',
'f2',
'longcat',
# video models
'hunyuanvideo',
'hunyuanvideo15'
+2
View File
@@ -76,6 +76,8 @@ def get_model_type(pipe):
model_type = 'x-omni'
elif 'Photoroom' in name:
model_type = 'prx'
elif 'LongCat' in name:
model_type = 'longcat'
# video models
elif "CogVideo" in name:
model_type = 'cogvideo'
+2
View File
@@ -139,6 +139,8 @@ def guess_by_name(fn, current_guess):
new_guess = 'NanoBanana'
elif 'z-image' in fn.lower() or 'z_image' in fn.lower():
new_guess = 'Z-Image'
elif 'longcat-image' in fn.lower():
new_guess = 'LongCat'
if debug_load:
shared.log.trace(f'Autodetect: method=name file="{fn}" previous="{current_guess}" current="{new_guess}"')
return new_guess or current_guess
+4
View File
@@ -458,6 +458,10 @@ def load_diffuser_force(detected_model_type, checkpoint_info, diffusers_load_con
from pipelines.model_z_image import load_z_image
sd_model = load_z_image(checkpoint_info, diffusers_load_config)
allow_post_quant = False
elif model_type in ['LongCat']:
from pipelines.model_longcat import load_longcat
sd_model = load_longcat(checkpoint_info, diffusers_load_config)
allow_post_quant = False
except Exception as e:
shared.log.error(f'Load {op}: path="{checkpoint_info.path}" {e}')
if debug_load:
+1 -1
View File
@@ -14,7 +14,7 @@ from modules.timer import process as process_timer
debug = os.environ.get('SD_MOVE_DEBUG', None) is not None
verbose = os.environ.get('SD_MOVE_VERBOSE', None) is not None
debug_move = log.trace if debug else lambda *args, **kwargs: None
offload_warn = ['sc', 'sd3', 'f1', 'f2', 'h1', 'hunyuandit', 'auraflow', 'omnigen', 'omnigen2', 'cogview4', 'cosmos', 'chroma', 'x-omni', 'hunyuanimage', 'hunyuanimage3']
offload_warn = ['sc', 'sd3', 'f1', 'f2', 'h1', 'hunyuandit', 'auraflow', 'omnigen', 'omnigen2', 'cogview4', 'cosmos', 'chroma', 'x-omni', 'hunyuanimage', 'hunyuanimage3', 'longcat']
offload_post = ['h1']
offload_hook_instance = None
balanced_offload_exclude = ['CogView4Pipeline', 'MeissonicPipeline']
+1 -1
View File
@@ -9,7 +9,7 @@ from modules import shared, devices, processing, images, sd_vae_approx, sd_vae_t
SamplerData = namedtuple('SamplerData', ['name', 'constructor', 'aliases', 'options'])
approximation_indexes = { "Simple": 0, "Approximate": 1, "TAESD": 2, "Full VAE": 3 }
flow_models = ['f1', 'f2', 'sd3', 'lumina', 'auraflow', 'sana', 'z_image', 'lumina2', 'cogview4', 'h1', 'cosmos', 'chroma', 'omnigen', 'omnigen2']
flow_models = ['f1', 'f2', 'sd3', 'lumina', 'auraflow', 'sana', 'z_image', 'lumina2', 'cogview4', 'h1', 'cosmos', 'chroma', 'omnigen', 'omnigen2', 'longcat']
warned = False
queue_lock = threading.Lock()
+2 -2
View File
@@ -38,7 +38,7 @@ prev_cls = ''
prev_type = ''
prev_model = ''
lock = threading.Lock()
supported = ['sd', 'sdxl', 'sd3', 'f1', 'h1', 'z_image', 'lumina2', 'hunyuanvideo', 'wanai', 'chrono', 'mochivideo', 'pixartsigma', 'pixartalpha', 'hunyuandit', 'omnigen', 'qwen']
supported = ['sd', 'sdxl', 'sd3', 'f1', 'h1', 'z_image', 'lumina2', 'hunyuanvideo', 'wanai', 'chrono', 'mochivideo', 'pixartsigma', 'pixartalpha', 'hunyuandit', 'omnigen', 'qwen', 'longcat']
def warn_once(msg, variant=None):
@@ -59,7 +59,7 @@ def get_model(model_type = 'decoder', variant = None):
model_cls = 'sd'
elif model_cls in {'pixartsigma', 'hunyuandit', 'omnigen', 'auraflow'}:
model_cls = 'sdxl'
elif model_cls in {'h1', 'z_image', 'lumina2', 'chroma'}:
elif model_cls in {'h1', 'z_image', 'lumina2', 'chroma', 'longcat'}:
model_cls = 'f1'
elif model_cls in {'wanai', 'qwen', 'chrono'}:
variant = variant or 'TAE WanVideo'
+1
View File
@@ -48,6 +48,7 @@ pipelines = {
'Qwen': getattr(diffusers, 'QwenImagePipeline', None),
'HunyuanImage': getattr(diffusers, 'HunyuanImagePipeline', None),
'Z-Image': getattr(diffusers, 'ZImagePipeline', None),
'LongCat': getattr(diffusers, 'LongCatImagePipeline', None),
# dynamically imported and redefined later
'Meissonic': getattr(diffusers, 'DiffusionPipeline', None),
'Monetico': getattr(diffusers, 'DiffusionPipeline', None),