mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
feat: add Anima (Cosmos-Predict-2B variant) pipeline support
Anima replaces the Cosmos T5-11B text encoder with Qwen3-0.6B + a 6-layer LLM adapter and uses CONST preconditioning instead of EDM. - Add pipelines/model_anima.py loader with dynamic import of custom AnimaTextToImagePipeline and AnimaLLMAdapter from model repo - Register 'Anima' pipeline in shared_items.py - Add name-based detection in sd_detect.py - Fix list-format _class_name handling in guess_by_diffusers() - Wire loader in sd_models.py load_diffuser_force() - Skip noise_pred callback injection for Anima (uses velocity instead) - Add output_type='np' override in processing_args.py
This commit is contained in:
@@ -269,7 +269,7 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t
|
||||
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 'OmniGen2' in model.__class__.__name__:
|
||||
if 'Kandinsky' in model.__class__.__name__ or 'Cosmos2' in model.__class__.__name__ or 'Anima' 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
|
||||
|
||||
@@ -103,6 +103,8 @@ def guess_by_name(fn, current_guess):
|
||||
new_guess = 'FLUX'
|
||||
elif 'flex.2' in fn.lower():
|
||||
new_guess = 'FLEX'
|
||||
elif 'anima' in fn.lower() and 'cosmos' in fn.lower():
|
||||
new_guess = 'Anima'
|
||||
elif 'cosmos-predict2' in fn.lower():
|
||||
new_guess = 'Cosmos'
|
||||
elif 'f-lite' in fn.lower():
|
||||
|
||||
@@ -406,6 +406,10 @@ def load_diffuser_force(detected_model_type, checkpoint_info, diffusers_load_con
|
||||
from pipelines.model_cosmos import load_cosmos_t2i
|
||||
sd_model = load_cosmos_t2i(checkpoint_info, diffusers_load_config)
|
||||
allow_post_quant = False
|
||||
elif model_type in ['Anima']:
|
||||
from pipelines.model_anima import load_anima
|
||||
sd_model = load_anima(checkpoint_info, diffusers_load_config)
|
||||
allow_post_quant = False
|
||||
elif model_type in ['FLite']:
|
||||
from pipelines.model_flite import load_flite
|
||||
sd_model = load_flite(checkpoint_info, diffusers_load_config)
|
||||
@@ -1248,6 +1252,8 @@ def set_diffuser_pipe(pipe, new_pipe_type):
|
||||
def add_noise_pred_to_diffusers_callback(pipe):
|
||||
if not hasattr(pipe, "_callback_tensor_inputs"):
|
||||
return pipe
|
||||
if pipe.__class__.__name__.startswith("Anima"):
|
||||
return pipe
|
||||
if pipe.__class__.__name__.startswith("StableCascade") and ("predicted_image_embedding" not in pipe._callback_tensor_inputs): # pylint: disable=protected-access
|
||||
pipe.prior_pipe._callback_tensor_inputs.append("predicted_image_embedding") # pylint: disable=protected-access
|
||||
elif "noise_pred" not in pipe._callback_tensor_inputs: # pylint: disable=protected-access
|
||||
|
||||
@@ -64,6 +64,7 @@ pipelines = {
|
||||
'X-Omni': getattr(diffusers, 'DiffusionPipeline', None),
|
||||
'HunyuanImage3': getattr(diffusers, 'DiffusionPipeline', None),
|
||||
'ChronoEdit': getattr(diffusers, 'DiffusionPipeline', None),
|
||||
'Anima': getattr(diffusers, 'DiffusionPipeline', None),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user