mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Complete Z-Image support
This commit is contained in:
@@ -36,6 +36,8 @@ def get_model_type(pipe):
|
||||
model_type = 'f2'
|
||||
elif "Flux" in name or "Flex1" in name or "Flex2" in name:
|
||||
model_type = 'f1'
|
||||
elif "ZImage" in name or "Z-Image" in name:
|
||||
model_type = 'z_image'
|
||||
elif "Lumina2" in name:
|
||||
model_type = 'lumina2'
|
||||
elif "Lumina" in name:
|
||||
|
||||
@@ -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', 'lumina2', 'cogview4', 'h1', 'cosmos', 'chroma', 'omnigen', 'omnigen2']
|
||||
flow_models = ['f1', 'f2', 'sd3', 'lumina', 'auraflow', 'sana', 'z_image', 'lumina2', 'cogview4', 'h1', 'cosmos', 'chroma', 'omnigen', 'omnigen2']
|
||||
warned = False
|
||||
queue_lock = threading.Lock()
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ hf_decode_endpoints['auraflow'] = hf_decode_endpoints['sdxl']
|
||||
hf_decode_endpoints['omnigen'] = hf_decode_endpoints['sdxl']
|
||||
hf_decode_endpoints['h1'] = hf_decode_endpoints['f1']
|
||||
hf_decode_endpoints['chroma'] = hf_decode_endpoints['f1']
|
||||
hf_decode_endpoints['z_image'] = hf_decode_endpoints['f1']
|
||||
hf_decode_endpoints['lumina2'] = hf_decode_endpoints['f1']
|
||||
|
||||
hf_encode_endpoints = {
|
||||
@@ -35,6 +36,7 @@ hf_encode_endpoints['hunyuandit'] = hf_encode_endpoints['sdxl']
|
||||
hf_encode_endpoints['auraflow'] = hf_encode_endpoints['sdxl']
|
||||
hf_encode_endpoints['omnigen'] = hf_encode_endpoints['sdxl']
|
||||
hf_encode_endpoints['h1'] = hf_encode_endpoints['f1']
|
||||
hf_encode_endpoints['z_image'] = hf_encode_endpoints['f1']
|
||||
hf_encode_endpoints['lumina2'] = hf_encode_endpoints['f1']
|
||||
|
||||
dtypes = {
|
||||
@@ -91,7 +93,7 @@ def remote_decode(latents: torch.Tensor, width: int = 0, height: int = 0, model_
|
||||
params["output_type"] = "pt"
|
||||
params["output_tensor_type"] = "binary"
|
||||
headers["Accept"] = "tensor/binary"
|
||||
if model_type in {'f1', 'h1', 'lumina2', 'chroma'} and (width > 0) and (height > 0):
|
||||
if model_type in {'f1', 'h1', 'z_image', 'lumina2', 'chroma'} and (width > 0) and (height > 0):
|
||||
params['width'] = width
|
||||
params['height'] = height
|
||||
if shared.sd_model.vae is not None and shared.sd_model.vae.config is not None:
|
||||
|
||||
@@ -38,7 +38,7 @@ prev_cls = ''
|
||||
prev_type = ''
|
||||
prev_model = ''
|
||||
lock = threading.Lock()
|
||||
supported = ['sd', 'sdxl', 'sd3', 'f1', 'h1', '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']
|
||||
|
||||
|
||||
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', 'lumina2', 'chroma'}:
|
||||
elif model_cls in {'h1', 'z_image', 'lumina2', 'chroma'}:
|
||||
model_cls = 'f1'
|
||||
elif model_cls in {'wanai', 'qwen', 'chrono'}:
|
||||
variant = variant or 'TAE WanVideo'
|
||||
|
||||
Reference in New Issue
Block a user