mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
feat(anima): add image-to-image and inpainting support
This commit is contained in:
@@ -72,7 +72,7 @@ def get_model_type(pipe):
|
||||
model_type = 'sana'
|
||||
elif "HiDream" in name:
|
||||
model_type = 'h1'
|
||||
elif "AnimaTextToImage" in name:
|
||||
elif name.startswith("Anima") and "AnimateDiff" not in name:
|
||||
model_type = 'anima'
|
||||
elif "Cosmos2TextToImage" in name:
|
||||
model_type = 'cosmos'
|
||||
|
||||
@@ -272,7 +272,7 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:l
|
||||
kwargs['output_type'] = 'np' # only set latent if model has vae
|
||||
|
||||
# model specific
|
||||
if 'Kandinsky' in model.__class__.__name__ or 'Cosmos2' in model.__class__.__name__ or 'Anima' in model.__class__.__name__ or 'OmniGen2' in model.__class__.__name__:
|
||||
if 'Kandinsky' in model.__class__.__name__ or 'Cosmos2' in model.__class__.__name__ or 'OmniGen2' in model.__class__.__name__:
|
||||
kwargs['output_type'] = 'np' # only set latent if model has vae
|
||||
if 'StableCascade' in model.__class__.__name__:
|
||||
kwargs.pop("guidance_scale") # remove
|
||||
|
||||
@@ -247,6 +247,8 @@ def vae_postprocess(tensor, model, output_type='np'):
|
||||
if tensor.ndim == 6 and tensor.shape[1] == 1:
|
||||
tensor = tensor.squeeze(0)
|
||||
images = model.video_processor.postprocess_video(tensor, output_type='pil')
|
||||
if isinstance(images, list) and len(images) > 0 and isinstance(images[0], list):
|
||||
images = [frame for batch in images for frame in batch]
|
||||
elif hasattr(model, 'image_processor'):
|
||||
if tensor.ndim == 5 and tensor.shape[1] == 3: # Qwen Image
|
||||
tensor = tensor[:, :, 0]
|
||||
|
||||
Reference in New Issue
Block a user