mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
add joyai-image-edit
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -110,6 +110,8 @@ def get_model_type(pipe):
|
||||
model_type = 'glmimage'
|
||||
elif 'Step1XEdit' in name:
|
||||
model_type = 'step1x_edit'
|
||||
elif 'JoyImageEdit' in name:
|
||||
model_type = 'joy'
|
||||
elif 'OvisImage' in name or 'Ovis-Image' in name:
|
||||
model_type = 'ovis'
|
||||
elif 'Wan' in name:
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ class InternalProgressResponse(BaseModel):
|
||||
|
||||
|
||||
def api_progress(req: ProgressRequest):
|
||||
active = req.id_task == current_task
|
||||
active = (req.id_task == current_task) or (req.id_task == 'undefined' and len(shared.state.job) > 0)
|
||||
queued = req.id_task in pending_tasks
|
||||
completed = req.id_task in finished_tasks
|
||||
paused = shared.state.paused
|
||||
@@ -92,7 +92,7 @@ def api_progress(req: ProgressRequest):
|
||||
id_live_preview = -1
|
||||
textinfo = "Queued..." if queued else "Waiting..."
|
||||
|
||||
debug_log(f'Preview: job={shared.state.job} active={active} progress={step}/{steps}/{progress} image={shared.state.current_image_sampling_step} request={id_live_preview} last={shared.state.id_live_preview} job={shared.state.preview_job} elapsed={elapsed:.3f}')
|
||||
debug_log(f'Progress: job="{shared.state.job}" active={active} progress={step}/{steps}/{progress} image={shared.state.current_image_sampling_step} request={id_live_preview} last={shared.state.id_live_preview} job={shared.state.preview_job} elapsed={elapsed:.3f}')
|
||||
|
||||
if active and (req.id_live_preview != -1):
|
||||
have_image = shared.state.set_current_image()
|
||||
|
||||
@@ -162,6 +162,8 @@ def guess_by_name(fn, current_guess):
|
||||
new_guess = 'Step1X-Edit'
|
||||
elif 'vibe-image-edit' in fn.lower():
|
||||
new_guess = 'VIBE'
|
||||
elif 'joyai-image-edit' in fn.lower() or 'joy-image-edit' in fn.lower():
|
||||
new_guess = 'Joy'
|
||||
if debug_load:
|
||||
log.trace(f'Autodetect: method=name file="{fn}" previous="{current_guess}" current="{new_guess}"')
|
||||
return new_guess or current_guess
|
||||
|
||||
@@ -469,6 +469,10 @@ def load_diffuser_force(detected_model_type, checkpoint_info, diffusers_load_con
|
||||
from pipelines.model_vibe import load_vibe
|
||||
sd_model = load_vibe(checkpoint_info, diffusers_load_config)
|
||||
allow_post_quant = False
|
||||
elif model_type in ['Joy']:
|
||||
from pipelines.model_joy import load_joy
|
||||
sd_model = load_joy(checkpoint_info, diffusers_load_config)
|
||||
allow_post_quant = False
|
||||
elif model_type in ['Qwen']:
|
||||
from pipelines.model_qwen import load_qwen
|
||||
sd_model = load_qwen(checkpoint_info, diffusers_load_config)
|
||||
@@ -1489,3 +1493,13 @@ def save_model(name: str, path: str | None = None, shard: str = "5GB", overwrite
|
||||
log.error(f'Save model: path="{model_name}" {e}')
|
||||
errors.display(e, 'Save model')
|
||||
return f'Error: {e}'
|
||||
|
||||
|
||||
def list_hfcache():
|
||||
checkpoints = []
|
||||
for f in os.scandir(shared.opts.hfcache_dir):
|
||||
if not os.path.isdir(f) or not f.name.startswith('models--'):
|
||||
continue
|
||||
checkpoint = CheckpointInfo(filename=f.path, name=path_to_repo(f.name), model_type='hfcache')
|
||||
checkpoints.append(checkpoint)
|
||||
return checkpoints
|
||||
|
||||
@@ -12,6 +12,7 @@ pipelines = {
|
||||
'Stable Diffusion Inpaint': getattr(diffusers, 'StableDiffusionInpaintPipeline', None),
|
||||
'Stable Diffusion Instruct': getattr(diffusers, 'StableDiffusionInstructPix2PixPipeline', None),
|
||||
'Stable Diffusion 1.5': getattr(diffusers, 'StableDiffusionPipeline', None),
|
||||
'Stable Diffusion 2': getattr(diffusers, 'StableDiffusionPipeline', None),
|
||||
'Stable Diffusion 2.x': getattr(diffusers, 'StableDiffusionPipeline', None),
|
||||
'Stable Diffusion Upscale': getattr(diffusers, 'StableDiffusionUpscalePipeline', None),
|
||||
'Stable Diffusion XL': getattr(diffusers, 'StableDiffusionXLPipeline', None),
|
||||
@@ -36,6 +37,7 @@ pipelines = {
|
||||
'Kandinsky 2.1': getattr(diffusers, 'KandinskyCombinedPipeline', None),
|
||||
'Kandinsky 2.2': getattr(diffusers, 'KandinskyV22CombinedPipeline', None),
|
||||
'Kandinsky 3.0': getattr(diffusers, 'Kandinsky3Pipeline', None),
|
||||
'Kandinsky 5.0': getattr(diffusers, 'Kandinsky5T2IPipeline', None),
|
||||
'Wuerstchen': getattr(diffusers, 'WuerstchenCombinedPipeline', None),
|
||||
'Kolors': getattr(diffusers, 'KolorsPipeline', None),
|
||||
'CogView 3': getattr(diffusers, 'CogView3PlusPipeline', None),
|
||||
@@ -47,6 +49,7 @@ pipelines = {
|
||||
'Cosmos': getattr(diffusers, 'Cosmos2TextToImagePipeline', None),
|
||||
'WanAI': getattr(diffusers, 'WanPipeline', None),
|
||||
'Qwen': getattr(diffusers, 'QwenImagePipeline', None),
|
||||
'Joy': getattr(diffusers, 'JoyImageEditPipeline', None),
|
||||
'HunyuanImage': getattr(diffusers, 'HunyuanImagePipeline', None),
|
||||
'ERNIE-Image': getattr(diffusers, 'ErnieImagePipeline', None),
|
||||
'Nucleus-Image': getattr(diffusers, 'NucleusMoEImagePipeline', None),
|
||||
|
||||
Reference in New Issue
Block a user