Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: load Anima, Chroma, MOSS-Image and int4 Krea 2 ComfyUI single files (#16710)
oobaboogab7a0a85ca30b
diff --git a/studio/backend/core/inference/diffusion.py b/studio/backend/core/inference/diffusion.pyindex a5b8e0a09bd..d3b1a174a3f 100644--- a/studio/backend/core/inference/diffusion.py+++ b/studio/backend/core/inference/diffusion.py@@ -162,6 +162,12 @@ from .diffusion_hidream import ()from .diffusion_krea2 import KREA2_FAMILY_NAME, load_krea2_pipelinefrom .diffusion_families import MOSS_IMAGE_FAMILY_NAME+from .diffusion_anima import (+ ANIMA_COMPONENT_FOLDERS,+ ANIMA_COMPONENTS,+ ANIMA_FAMILY_NAME,+ is_anima_family,+)from .diffusion_flux3 import (FLUX3_COMPONENTS,FLUX3_COMPONENT_FOLDERS,@@ -400,7 +406,7 @@ from .diffusion_fp16_variant import ()from .diffusion_flow_shift import (SAMPLE_SIGMAS_KEY,- apply_comfy_flow_shift,+ apply_comfy_schedule,requested_flow_shift,scheduler_with_flow_shift,shift_control,@@ -1485,18 +1491,61 @@ def _generation_chunks(*,layer_count: Any = None,) -> list:- """Per-forward chunks of ``(prompt, seed)`` jobs. Layered: one input per forward. FLUX.3 runs one image per- modular call, so each image is its own chunk: every one then gets its own encode, denoise and decode phase, and+ """Per-forward chunks of ``(prompt, seed)`` jobs. Layered: one input per forward. FLUX.3 and Anima run one image+ per modular call, so each image is its own chunk: every one then gets its own encode, denoise and decode phase, andthe text-encoder release that comes with entering denoise (one chunk of several images would release it once,and the next image's encode would bring it back for the rest of the chunk)."""- if layer_count or is_flux3_family(family):+ if layer_count or is_flux3_family(family) or is_anima_family(family):return [[job] for job in jobs]return chunk_jobs(jobs, batch_size)+def _component_index(+ fam: Any,+ base: str,+ *,+ base_local_dir: Optional[str],+ hf_token: Optional[str],+ local_files_only: bool,+) -> dict:+ """The base's model_index.json components, or Anima's fixed classes (its modular base ships none)."""+ if is_anima_family(fam):+ return {name: [lib, cls] for name, (_folder, lib, cls) in ANIMA_COMPONENT_FOLDERS.items()}+ from .diffusion_comfy_components import read_model_index++ return read_model_index(+ base,+ base_local_dir = base_local_dir,+ hf_token = hf_token,+ local_files_only = local_files_only,+ cache_dir = hub_cache_dir(),+ )+++def _fixed_component_folders(fam: Any) -> Optional[dict]:+ if is_flux3_family(fam):+ return FLUX3_COMPONENT_FOLDERS+ if is_anima_family(fam):+ return ANIMA_COMPONENT_FOLDERS+ return None+++def _modular_companions(fam: Any) -> Optional[tuple[str, ...]]:+ if is_flux3_family(fam):+ return FLUX3_COMPONENTS+ if is_anima_family(fam):+ return ANIMA_COMPONENTS+ return None+++def _single_file_components(fam: Any, kind: Optional[str]) -> tuple[str, ...]:+ """Base components besides the denoiser whose weights a single file carries (Anima's text conditioner)."""+ return ("text_conditioner",) if kind in ("single_file", "gguf") and is_anima_family(fam) else ()++def _base_manifest_name(fam: Any) -> str:"""The pipeline index a base repo carries: FLUX.3 ships only ``modular_model_index.json``."""- return FLUX3_INDEX if is_flux3_family(fam) else "model_index.json"+ return FLUX3_INDEX if is_flux3_family(fam) or is_anima_family(fam) else "model_index.json"def _cached_mirror_manifest(base: str, manifest: str) -> tuple[str, ...]:@@ -1906,6 +1955,16 @@ def _model_index_sample_sigmas(base: str, base_local_dir: Optional[str]) -> Any:return index.get(SAMPLE_SIGMAS_KEY) if isinstance(index, dict) else None+def _family_default_ids(fam: Any) -> tuple:+ """Ids ahead of the file / repo names in the defaults lookup: FLUX.3's file names cannot tell its variants apart,+ and a bare "anima" matches Animagine XL files while a local folder never names Anima's base repo."""+ if is_flux3_family(fam):+ return (fam.name,)+ if is_anima_family(fam):+ return (fam.base_repo,)+ return ()++def _generation_defaults_for(repo_id: Optional[str],gguf_filename: Optional[str],@@ -1916,17 +1975,12 @@ def _generation_defaults_for("""The (steps, guidance) the OpenAI route renders this load with, header variant before base (FLUX.1's base isschnell), so the Images form can match it."""try:- # FLUX.3 first: the variant check has matched the checkpoint to the family, while the names cannot tell the- # variants apart (BFL's ComfyUI base files are flux3_image_klein_*.safetensors, no "base", and a base file can- # sit on the distilled repo's companions).- identifiers = (+ identifiers = _family_default_ids(family) + (gguf_filename,content_variant_hint(repo_id, gguf_filename),repo_id,base_repo,)- if is_flux3_family(family):- identifiers = (family.name,) + identifierssteps, guidance = generation_params_with_grid(grid, *identifiers)except Exception: # noqa: BLE001 - status must not fail on a recipe lookupreturn None@@ -4050,6 +4104,7 @@ def _image_cast_candidates(if is_flux3_family(fam) or getattr(fam, "name", None) in (MOSS_IMAGE_FAMILY_NAME,KREA2_FAMILY_NAME,+ ANIMA_FAMILY_NAME,IDEOGRAM4_FAMILY_NAME,):return []@@ -4949,12 +5004,7 @@ class DiffusionBackend:"""Header-only, so a bad pick is a 400 before eviction. Single-file / GGUF denoisers only."""from .diffusion_comfy_components import validate_component_specs- if (- kind not in ("gguf", "single_file")- or fam.single_file_is_pipeline- or fam.pipeline_only- or getattr(fam, "native_transformer_files_only", False)- ):+ if kind not in ("gguf", "single_file") or fam.single_file_is_pipeline or fam.pipeline_only:raise ValueError("text_encoder_file / vae_file load beside a single-file or GGUF transformer; a full pipeline ""(or a whole-pipeline single file) already carries its own text encoders and VAE."@@ -4967,15 +5017,6 @@ class DiffusionBackend:f"separate text encoder / VAE files are not supported for '{fam.name}' yet; omit ""text_encoder_files and vae_file (the base repo's encoder and VAE are used).")- if fam.name == MOSS_IMAGE_FAMILY_NAME and (vae_file or text_encoder_files):- raise ValueError(- f"separate text encoder / VAE files are not supported for '{fam.name}' yet; omit "- "text_encoder_files and vae_file (the base repo's encoder and VAE are used)."- )- if vae_file and fam.name == KREA2_FAMILY_NAME:- raise ValueError(- f"a separate VAE file is not supported for '{fam.name}' yet; omit vae_file."- )validate_component_specs(list(text_encoder_files or ()),vae_file,@@ -5000,14 +5041,14 @@ class DiffusionBackend:) -> Any:if not text_encoder_files and not vae_file:return None- from .diffusion_comfy_components import plan_component_overrides, read_model_index+ from .diffusion_comfy_components import plan_component_overrides- index = read_model_index(+ index = _component_index(+ fam,prefer_ungated_mirror(base, hf_token),base_local_dir = base_local_dir or (base if _is_local_path(base) else None),hf_token = hf_token,local_files_only = local_files_only,- cache_dir = hub_cache_dir(),)def _resolve_hub(ref: Any) -> str:@@ -5091,19 +5132,15 @@ class DiffusionBackend:]if not candidates:return []- from .diffusion_comfy_components import (- pick_comfy_text_encoders,- read_model_index,- verify_override_fit,- )+ from .diffusion_comfy_components import pick_comfy_text_encoders, verify_override_fitmirror = prefer_ungated_mirror(base, hf_token)- index = read_model_index(+ index = _component_index(+ fam,mirror,base_local_dir = base if _is_local_path(base) else None,hf_token = hf_token,local_files_only = local_files_only,- cache_dir = hub_cache_dir(),)planned_quant, auto = resolve_te_quant_request(text_encoder_quant, getattr(fam, "te_quant_auto", None)@@ -5211,7 +5248,10 @@ class DiffusionBackend:# MOSS-Image GGUFs are sd.cpp only: refuse before eviction and before the diffusers class check.if getattr(fam, "native_transformer_files_only", False) and (- kind == "single_file"+ (+ kind == "single_file"+ and not str(gguf_filename or "").lower().endswith(".safetensors")+ )or (kind == "gguf"and not family_buildable_here(fam, model_kind = kind, gguf_filename = gguf_filename)@@ -5237,6 +5277,10 @@ class DiffusionBackend:f"stable-diffusion.cpp convert of the checkpoint, on disk). Load the .safetensors checkpoint, or "f"such a GGUF, instead.")+ if kind == "gguf" and not fam.gguf_loadable:+ raise ValueError(+ f"'{fam.name}' GGUF files are not supported yet; load its .safetensors single file instead."+ )# A multi-denoiser family (Ideogram 4) has no transformer-only path; reject before evictionif kind in ("gguf", "single_file") and fam.pipeline_only:raise ValueError(@@ -5262,16 +5306,18 @@ class DiffusionBackend:# A local base_repo loads as a full pipeline; reject a non-pipeline one before evictionwhole_file = kind in ("single_file", "gguf") and fam.single_file_is_pipelineexcluded = (- (fam.denoiser_attr,) if kind in ("gguf", "single_file") and not whole_file else ()+ (fam.denoiser_attr,) + _single_file_components(fam, kind)+ if kind in ("gguf", "single_file") and not whole_file+ else ())_assert_local_base_is_pipeline(base_repo,# FLUX.3 companions come from a Modular Diffusers base, and its loader reads only modular_model_index.json.- modular_only = is_flux3_family(fam),+ modular_only = is_flux3_family(fam) or is_anima_family(fam),excluded_components = excluded,config_only_model_components = whole_file,# The FLUX.3 assembler reads each component from its own folder here, never from a spec's source repo.- fixed_component_folders = FLUX3_COMPONENT_FOLDERS if is_flux3_family(fam) else None,+ fixed_component_folders = _fixed_component_folders(fam),)local_root = Path(repo_id).expanduser()# Path-shaped: "."/".." prefix, a backslash (never in "org/name"), or an absolute path.@@ -5304,13 +5350,11 @@ class DiffusionBackend:)if local_root.exists():# FLUX.3 is a Modular Diffusers layout: its manifest is modular_model_index.json.- index_name = FLUX3_INDEX if is_flux3_family(fam) else "model_index.json"+ index_name = _base_manifest_name(fam)if not local_pipeline_components_are_complete(local_root,index_name,- fixed_component_folders = (- FLUX3_COMPONENT_FOLDERS if is_flux3_family(fam) else None- ),+ fixed_component_folders = _fixed_component_folders(fam),):raise FileNotFoundError(f"Local pipeline directory has no complete valid {index_name}: {repo_id}"@@ -5699,7 +5743,7 @@ class DiffusionBackend:kind = kind,pipeline_components = _explicit_pipeline_components(fam),single_file_is_pipeline = bool(fam and fam.single_file_is_pipeline),- companion_components = FLUX3_COMPONENTS if is_flux3_family(fam) else None,+ companion_components = _modular_companions(fam),base_manifest = _base_manifest_name(fam),include_transformer = ((@@ -5713,7 +5757,10 @@ class DiffusionBackend:if kind == "gguf"else False),- skip_te_components = tuple(te_prequant_files) + replaced + tuple(vae_hosted_files),+ skip_te_components = tuple(te_prequant_files)+ + replaced+ + tuple(vae_hosted_files)+ + _single_file_components(fam, kind),skip_transformer_weights = skip_transformer_weights,skipped_files_out = skipped_transformer_files,local_files_only = local_files_only,@@ -7067,7 +7114,7 @@ class DiffusionBackend:kind = kind,pipeline_components = _explicit_pipeline_components(fam),single_file_is_pipeline = bool(fam and fam.single_file_is_pipeline),- companion_components = FLUX3_COMPONENTS if is_flux3_family(fam) else None,+ companion_components = _modular_companions(fam),base_manifest = _base_manifest_name(fam),# The RESOLVED base, as the load passes it: a variant base picks its own pre-quant repo. Deferred exactly# as _run_load defers it. Called eagerly this runs before the base listing exists, so the cache gate sees@@ -7096,7 +7143,10 @@ class DiffusionBackend:resident_file_sizes_out = resident_file_sizes,revisions_out = revisions,fetch_repos_out = fetch_repos,- skip_te_components = tuple(te_files) + replaced + tuple(vae_hosted_files),+ skip_te_components = tuple(te_files)+ + replaced+ + tuple(vae_hosted_files)+ + _single_file_components(fam, kind),skip_transformer_weights = skip_transformer_weights,failures_out = plan_failures,fp16_twins = kind == "pipeline"@@ -9293,7 +9343,12 @@ class DiffusionBackend:pipeline_seed_scheme is not Noneor _pipeline_prequant_skippedor is_flux3_family(fam)- or fam.name in (MOSS_IMAGE_FAMILY_NAME, KREA2_FAMILY_NAME)+ or fam.name+ in (+ MOSS_IMAGE_FAMILY_NAME,+ KREA2_FAMILY_NAME,+ ANIMA_FAMILY_NAME,+ ))_fp16_variant = (local_fp16_variant(@@ -9548,6 +9603,23 @@ class DiffusionBackend:)finally:self._stop_load_prefetch()+ elif is_anima_family(fam):+ from .diffusion_anima import load_anima_pipeline+ try:+ pipe = load_anima_pipeline(+ _base_local_dir or fetch_base,+ dtype,+ hf_token = hf_token,+ check_cancelled = lambda: self._raise_if_load_cancelled(+ _load_token+ ),+ local_files_only = local_files_only,+ cache_dir = hub_cache_dir(),+ text_encoder = pipe_kwargs.get("text_encoder"),+ transformer = pipe_kwargs.get("transformer"),+ )+ finally:+ self._stop_load_prefetch()elif fam.name == MOSS_IMAGE_FAMILY_NAME:from .diffusion_moss_image import load_moss_image_pipelinetry:@@ -9561,6 +9633,7 @@ class DiffusionBackend:local_files_only = local_files_only,text_encoder = pipe_kwargs.get("text_encoder"),transformer = pipe_kwargs.get("transformer"),+ vae = pipe_kwargs.get("vae"),checkpoint = base,)finally:@@ -9579,6 +9652,7 @@ class DiffusionBackend:local_files_only = local_files_only,text_encoder = pipe_kwargs.get("text_encoder"),transformer = pipe_kwargs.get("transformer"),+ vae = pipe_kwargs.get("vae"),)finally:self._stop_load_prefetch()@@ -9773,7 +9847,18 @@ class DiffusionBackend:# sd.cpp GGUFs prefix tensors with model.diffusion_model.; the converters reject it._install_gguf_prefix_strip(transformer_cls, logger)_install_gguf_dim_restore(logger)- if comfy_scan is not None:+ anima_conditioner = None+ if is_anima_family(fam):+ from .diffusion_anima import load_anima_single_file+ transformer, anima_conditioner = load_anima_single_file(+ single_file_path,+ _base_local_dir or fetch_base,+ dtype,+ hf_token = hf_token,+ local_files_only = sf_kwargs["local_files_only"],+ cache_dir = hub_cache_dir(),+ )+ elif comfy_scan is not None:# int8 / fp8 codes go to Studio's runtime unchanged where it runs; the rest dequantize._comfy_offload = self._comfy_offload_for(plan, single_file_path)transformer = load_comfy_quant_transformer(@@ -9869,7 +9954,70 @@ class DiffusionBackend:).get("text_encoder"),family_name = fam.name,)+ elif fam.name == MOSS_IMAGE_FAMILY_NAME:+ from .diffusion_moss_image import load_moss_image_pipeline+ moss_components = te_prequant_pipe_kwargs(+ fam,+ fetch_base,+ te_quant_mode = text_encoder_quant,+ target = target,+ dtype = dtype,+ hf_token = hf_token,+ logger = logger,+ local_files_only = local_files_only,+ dense_source = _base_local_dir+ or (fetch_base if local_files_only else None),+ config_source = _base_local_dir,+ )+ pipe = load_moss_image_pipeline(+ _base_local_dir or fetch_base,+ dtype,+ hf_token = hf_token,+ check_cancelled = lambda: self._raise_if_load_cancelled(+ _load_token+ ),+ transformer = transformer,+ local_files_only = local_files_only,+ text_encoder = moss_components.get("text_encoder"),+ vae = moss_components.get("vae"),+ checkpoint = base,+ )+ elif is_anima_family(fam):+ from .diffusion_anima import load_anima_pipeline+ anima_supplied = supplied_component_pipe_kwargs(+ fetch_base,+ dtype = dtype,+ hf_token = hf_token,+ local_files_only = local_files_only,+ family = fam.name,+ logger = logger,+ )+ pipe = load_anima_pipeline(+ _base_local_dir or fetch_base,+ dtype,+ hf_token = hf_token,+ check_cancelled = lambda: self._raise_if_load_cancelled(+ _load_token+ ),+ transformer = transformer,+ text_conditioner = anima_conditioner,+ text_encoder = anima_supplied.get("text_encoder"),+ vae = anima_supplied.get("vae"),+ local_files_only = local_files_only,+ cache_dir = hub_cache_dir(),+ )elif fam.name == KREA2_FAMILY_NAME:+ krea_components = te_prequant_pipe_kwargs(+ fam,+ fetch_base,+ te_quant_mode = text_encoder_quant,+ target = target,+ dtype = dtype,+ hf_token = hf_token,+ logger = logger,+ local_files_only = local_files_only,+ dense_source = fetch_base if local_files_only else None,+ )pipe = load_krea2_pipeline(fetch_base,dtype,@@ -9880,17 +10028,8 @@ class DiffusionBackend:transformer = transformer,# Same as full-pipeline: single file supplies only the denoiser; other GB parts must not be fetched.local_files_only = local_files_only,- text_encoder = te_prequant_pipe_kwargs(- fam,- fetch_base,- te_quant_mode = text_encoder_quant,- target = target,- dtype = dtype,- hf_token = hf_token,- logger = logger,- local_files_only = local_files_only,- dense_source = fetch_base if local_files_only else None,- ).get("text_encoder"),+ text_encoder = krea_components.get("text_encoder"),+ vae = krea_components.get("vae"),)else:pipe_kwargs = {@@ -10339,8 +10478,7 @@ class DiffusionBackend:static_plan: Optional[dict] = Noneif cache_auto:default_steps, _ = default_generation_params(- # FLUX.3's family names its variant; its file names may not (see _generation_defaults_for).- *((fam.name,) if is_flux3_family(fam) else ()),+ *_family_default_ids(fam),gguf_filename,content_variant_hint(repo_id, gguf_filename),repo_id,@@ -10555,7 +10693,7 @@ class DiffusionBackend:raw_grid = _model_index_sample_sigmas(fetch_base, _base_local_dir)if install_sample_sigmas(pipe, raw_grid, logger) is None:# Before from_pipe copies the scheduler.- apply_comfy_flow_shift(+ apply_comfy_schedule(pipe,comfy_flow_shift_for(fam,@@ -10565,6 +10703,7 @@ class DiffusionBackend:display_repo_id,base,),+ getattr(fam, "scheduler_overrides", ()),logger,)# Before the speed optims, so the fused batched tile decode does not replace it.@@ -10750,7 +10889,7 @@ class DiffusionBackend:)try:plan_steps, _ = default_generation_params(- *((fam.name,) if is_flux3_family(fam) else ()),+ *_family_default_ids(fam),gguf_filename,content_variant_hint(repo_id, gguf_filename),repo_id,@@ -11863,6 +12002,21 @@ class DiffusionBackend:check_cancelled()pipe.to(device)return pipe+ if is_anima_family(fam):+ from .diffusion_anima import load_anima_pipeline++ pipe = load_anima_pipeline(+ base_local_dir or base,+ dtype,+ hf_token = hf_token,+ transformer = transformer,+ check_cancelled = check_cancelled,+ local_files_only = local_files_only,+ cache_dir = hub_cache_dir(),+ )+ check_cancelled()+ pipe.to(device)+ return pipeif getattr(fam, "name", None) == MOSS_IMAGE_FAMILY_NAME:from .diffusion_moss_image import load_moss_image_pipeline@@ -11890,6 +12044,14 @@ class DiffusionBackend:check_cancelled = check_cancelled,local_files_only = local_files_only,checkpoint = base,+ vae = supplied_component_pipe_kwargs(+ base,+ dtype = dtype,+ hf_token = hf_token,+ local_files_only = local_files_only,+ family = fam.name,+ logger = logger,+ ).get("vae"),)check_cancelled()pipe.to(device)@@ -11920,6 +12082,14 @@ class DiffusionBackend:check_cancelled = check_cancelled,# ``base_local_dir`` is None if nothing was staged, leaving a repo id; pipe_kwargs guards it too.local_files_only = local_files_only,+ vae = supplied_component_pipe_kwargs(+ base,+ dtype = dtype,+ hf_token = hf_token,+ local_files_only = local_files_only,+ family = fam.name,+ logger = logger,+ ).get("vae"),)check_cancelled()pipe.to(device)@@ -15896,6 +16066,8 @@ def _explicit_pipeline_components(fam: Any) -> Optional[tuple[str, ...]]:name = getattr(fam, "name", None)if is_flux3_family(fam):return FLUX3_COMPONENTS+ if is_anima_family(fam):+ return ANIMA_COMPONENTSif name in (KREA2_FAMILY_NAME, MOSS_IMAGE_FAMILY_NAME):return ("scheduler", "text_encoder", "tokenizer", "transformer", "vae")if name == IDEOGRAM4_FAMILY_NAME:diff --git a/studio/backend/core/inference/diffusion_anima.py b/studio/backend/core/inference/diffusion_anima.pynew file mode 100644index 00000000000..ff7b9190f32--- /dev/null+++ b/studio/backend/core/inference/diffusion_anima.py@@ -0,0 +1,471 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""Anima (Cosmos-Predict2 DiT + ``AnimaTextConditioner`` over Qwen3-0.6B): diffusers ships modular blocks only."""++from __future__ import annotations++import contextlib+from dataclasses import dataclass+from typing import Any, Callable, Optional++from loggers import get_logger++logger = get_logger(__name__)++ANIMA_FAMILY_NAME = "anima"+ANIMA_PIPELINE_CLASS = "AnimaPipeline"+ANIMA_BLOCKS = "AnimaAutoBlocks"+ANIMA_INDEX = "modular_model_index.json"+ANIMA_COMPONENTS = (+ "scheduler",+ "t5_tokenizer",+ "text_conditioner",+ "text_encoder",+ "tokenizer",+ "transformer",+ "vae",+)+ANIMA_COMPONENT_FOLDERS = {+ "text_encoder": ("text_encoder", "transformers", "Qwen3Model"),+ "tokenizer": ("tokenizer", "transformers", "Qwen2Tokenizer"),+ "t5_tokenizer": ("t5_tokenizer", "transformers", "T5Tokenizer"),+ "text_conditioner": ("text_conditioner", "diffusers", "AnimaTextConditioner"),+ "transformer": ("transformer", "diffusers", "CosmosTransformer3DModel"),+ "vae": ("vae", "diffusers", "AutoencoderKLQwenImage"),+ "scheduler": ("scheduler", "diffusers", "FlowMatchEulerDiscreteScheduler"),+}++_CONTAINER_PREFIXES = ("model.diffusion_model.", "diffusion_model.", "net.")+_ADAPTER_PREFIX = "llm_adapter."+# Bookkeeping tensors diffusers' Cosmos converter drops too.+_DROPPED = ("pos_embedder.", "accum_", "_extra_state")+++def anima_available() -> bool:+ try:+ import diffusers+ return all(+ hasattr(diffusers, name)+ for name in ("AnimaAutoBlocks", "AnimaTextConditioner", "CosmosTransformer3DModel")+ )+ except Exception: # noqa: BLE001 -- an unimportable diffusers just means no Anima here+ return False+++def is_anima_family(fam: Any) -> bool:+ return getattr(fam, "name", None) == ANIMA_FAMILY_NAME+++def split_anima_checkpoint(checkpoint: dict) -> tuple[dict, dict]:+ """``(transformer, text_conditioner)`` state dicts; a quantized file raises (codes would load as weights)."""+ from diffusers.loaders.single_file_utils import (+ convert_cosmos_transformer_checkpoint_to_diffusers,+ )++ transformer: dict = {}+ adapter: dict = {}+ for key, value in checkpoint.items():+ for prefix in _CONTAINER_PREFIXES:+ if key.startswith(prefix):+ key = key[len(prefix) :]+ break+ if key.endswith((".comfy_quant", ".weight_scale", ".input_scale")):+ raise ValueError(+ "this Anima file is ComfyUI-quantised (int8 / fp8 codes); load its bf16 / fp16 version"+ )+ if key.startswith(_ADAPTER_PREFIX):+ adapter[key[len(_ADAPTER_PREFIX) :]] = value+ elif key.startswith(_DROPPED):+ continue+ else:+ transformer["net." + key] = value+ if not adapter:+ raise ValueError(+ "not an Anima checkpoint: it has no llm_adapter (text conditioner) weights"+ )+ return convert_cosmos_transformer_checkpoint_to_diffusers(transformer), adapter+++def _block_count(state: dict) -> int:+ return len(+ {+ k.split(".", 2)[1]+ for k in state+ if k.startswith("transformer_blocks.") and k.split(".")[1].isdigit()+ }+ )+++def _assign_on_meta(cls: Any, config: dict, state: dict, dtype) -> Any:+ """``cls`` on meta, ``state`` cast as ``from_pretrained`` casts: init buffers (rotary ``inv_freq``) stay fp32."""+ import torch+ from accelerate import init_empty_weights++ from .diffusion_single_file_converters import charge_cast++ keep = getattr(cls, "_keep_in_fp32_modules", None) or ()+ with init_empty_weights():+ model = cls.from_config(config)+ for key, value in list(state.items()):+ want = torch.float32 if any(m in key.split(".") for m in keep) else dtype+ if value.is_floating_point() and value.dtype != want:+ charge_cast(value, want)+ state[key] = value.to(want)+ model.load_state_dict(state, strict = True, assign = True)+ return model.eval()+++def load_anima_single_file(+ path: str,+ config_source: str,+ dtype,+ *,+ hf_token: Optional[str] = None,+ local_files_only: bool = False,+ cache_dir: Optional[str] = None,+) -> tuple[Any, Any]:+ """``(transformer, text_conditioner)`` on CPU; ``num_layers`` follows the file (40-block 2.9B, 28-block base)."""+ from diffusers import AnimaTextConditioner, CosmosTransformer3DModel+ from safetensors.torch import load_file++ from .diffusion_single_file_converters import HostRamBudget, converted_host_bytes++ common: dict[str, Any] = {"local_files_only": local_files_only}+ if cache_dir:+ common["cache_dir"] = cache_dir+ if hf_token:+ common["token"] = hf_token+ config = CosmosTransformer3DModel.load_config(config_source, subfolder = "transformer", **common)+ conditioner_config = AnimaTextConditioner.load_config(+ config_source, subfolder = "text_conditioner", **common+ )+ budget = HostRamBudget(+ path, f"casting its weights to {str(dtype).replace('torch.', '')}", logger+ )+ budget.check(converted_host_bytes(path, dtype))+ with budget:+ t_state, c_state = split_anima_checkpoint(load_file(path))+ blocks = _block_count(t_state)+ if blocks and blocks != config.get("num_layers"):+ logger.info(+ "diffusion.anima: %s has %d blocks (base config %s)",+ path,+ blocks,+ config.get("num_layers"),+ )+ config = {**config, "num_layers": blocks}+ transformer = _assign_on_meta(CosmosTransformer3DModel, config, t_state, dtype)+ conditioner = _assign_on_meta(AnimaTextConditioner, conditioner_config, c_state, dtype)+ return transformer, conditioner+++@dataclass+class AnimaPipelineOutput:+ images: list+++class _AnimaInterrupted(Exception):+ pass+++_PIPELINE_CLASS: Optional[type] = None+++def anima_pipeline_class() -> type:+ """``AnimaPipeline``, built on first use so importing this module never imports diffusers."""+ global _PIPELINE_CLASS+ if _PIPELINE_CLASS is None:+ from diffusers import DiffusionPipeline++ try:+ from diffusers.loaders import AnimaLoraLoaderMixin as lora+ except ImportError:+ lora = None+ bases = (+ (_AnimaPipelineMixin,) + ((lora,) if lora is not None else ()) + (DiffusionPipeline,)+ )+ _PIPELINE_CLASS = type(ANIMA_PIPELINE_CLASS, bases, {})+ return _PIPELINE_CLASS+++_COMPONENTS = (+ "transformer",+ "text_conditioner",+ "text_encoder",+ "tokenizer",+ "t5_tokenizer",+ "vae",+ "scheduler",+)+++class _AnimaPipelineMixin:+ model_cpu_offload_seq = "text_encoder->text_conditioner->transformer->vae"+ _optional_components: list = []+ _callback_tensor_inputs = ["latents"]++ def __init__(+ self, transformer, text_conditioner, text_encoder, tokenizer, t5_tokenizer, vae, scheduler+ ):+ super().__init__()+ self.register_modules(+ transformer = transformer,+ text_conditioner = text_conditioner,+ text_encoder = text_encoder,+ tokenizer = tokenizer,+ t5_tokenizer = t5_tokenizer,+ vae = vae,+ scheduler = scheduler,+ )+ self._modular = None+ self._interrupt = False++ @property+ def interrupt(self) -> bool:+ return self._interrupt++ def modular_pipeline(self):+ import diffusers++ if self._modular is None:+ self._modular = getattr(diffusers, ANIMA_BLOCKS)().init_pipeline()+ mp = self._modular+ updates = {+ name: getattr(self, name)+ for name in _COMPONENTS+ if getattr(self, name, None) is not None+ and getattr(mp, name, None) is not getattr(self, name)+ }+ if updates:+ mp.update_components(**updates)+ return mp++ def _set_guidance(self, mp, guidance_scale: Optional[float]) -> None:+ if guidance_scale is None:+ return+ guider = getattr(mp, "guider", None)+ if guider is not None and float(getattr(guider.config, "guidance_scale", -1.0)) == float(+ guidance_scale+ ):+ return+ from diffusers import ClassifierFreeGuidance++ mp.update_components(guider = ClassifierFreeGuidance(guidance_scale = float(guidance_scale)))++ def __call__(+ self,+ prompt = None,+ height: Optional[int] = None,+ width: Optional[int] = None,+ num_inference_steps: int = 30,+ guidance_scale: Optional[float] = 4.0,+ negative_prompt = None,+ num_images_per_prompt: int = 1,+ generator = None,+ latents = None,+ output_type: str = "pil",+ return_dict: bool = True,+ callback_on_step_end: Optional[Callable] = None,+ callback_on_step_end_tensor_inputs = ("latents",),+ ):+ self._interrupt = False+ mp = self.modular_pipeline()+ self._set_guidance(mp, guidance_scale)+ prompts = list(prompt) if isinstance(prompt, (list, tuple)) else [prompt]+ if any(not isinstance(p, str) for p in prompts):+ raise ValueError("Anima takes a text prompt (str) per image.")+ generators = list(generator) if isinstance(generator, (list, tuple)) else None+ negatives = list(negative_prompt) if isinstance(negative_prompt, (list, tuple)) else None+ # One image per modular call, so each image keeps its own generator and negative prompt.+ if len(prompts) > 1 or generators is not None:+ count = max(len(prompts), len(generators or ()))+ if len(prompts) == 1:+ prompts = prompts * count+ if generators is not None and len(generators) != count:+ raise ValueError(+ f"Got {len(generators)} generators for {count} images; pass one per image."+ )+ calls = [+ (prompts[i], generators[i] if generators is not None else generator, 1)+ for i in range(count)+ ]+ else:+ calls = [(prompts[0], generator, int(num_images_per_prompt or 1))]+ images: list = []+ try:+ for index, (one_prompt, one_generator, per_prompt) in enumerate(calls):+ kwargs: dict[str, Any] = {+ "prompt": one_prompt,+ "num_inference_steps": int(num_inference_steps),+ "num_images_per_prompt": per_prompt,+ "output_type": output_type,+ }+ if negative_prompt is not None:+ kwargs["negative_prompt"] = (+ negative_prompt+ if negatives is None+ else negatives[index if len(negatives) > 1 else 0]+ )+ if one_generator is not None:+ kwargs["generator"] = one_generator+ if height is not None:+ kwargs["height"] = int(height)+ if width is not None:+ kwargs["width"] = int(width)+ if latents is not None:+ kwargs["latents"] = latents+ with self._step_hooks(+ mp, callback_on_step_end, int(num_inference_steps), index == 0+ ):+ out = mp(**kwargs, output = "images")+ images.extend(out if isinstance(out, list) else [out])+ except _AnimaInterrupted:+ images = []+ # The modular pipeline does not own the hooks enable_model_cpu_offload put on these components.+ self.maybe_free_model_hooks()+ if not return_dict:+ return (images,)+ return AnimaPipelineOutput(images = images)++ def _step_hooks(+ self, mp, callback: Optional[Callable], num_inference_steps: int, first_call: bool+ ):+ """``callback_on_step_end`` per scheduler step; ``progress_bar`` opened at the first denoiser forward."""+ pipe = self++ @contextlib.contextmanager+ def _hooks():+ scheduler = mp.scheduler+ had_own_step = "step" in scheduler.__dict__+ original_step = scheduler.step+ counter = {"i": 0}++ def _step(*args, **kwargs):+ result = original_step(*args, **kwargs)+ i = counter["i"]+ counter["i"] += 1+ if callback is not None:+ latents = result[0] if isinstance(result, tuple) else result.prev_sample+ timestep = args[1] if len(args) > 1 else kwargs.get("timestep")+ callback(pipe, i, timestep, {"latents": latents})+ if pipe._interrupt:+ raise _AnimaInterrupted()+ return result++ handle = None+ transformer = getattr(mp, "transformer", None)+ if (+ first_call+ and transformer is not None+ and hasattr(transformer, "register_forward_pre_hook")+ ):+ fired = {"done": False}++ def _pre_hook(_module, _args):+ if not fired["done"]:+ fired["done"] = True+ try:+ bar = pipe.progress_bar(total = num_inference_steps)+ close = getattr(bar, "close", None)+ if callable(close):+ close()+ except Exception: # noqa: BLE001 -- a phase label must never fail a render+ pass++ handle = transformer.register_forward_pre_hook(_pre_hook)+ scheduler.step = _step+ try:+ yield+ finally:+ if had_own_step:+ scheduler.step = original_step+ else:+ with contextlib.suppress(AttributeError):+ del scheduler.step+ if handle is not None:+ handle.remove()++ return _hooks()+++def _load_tokenizer(auto_tokenizer: Any, repo_id: str, subfolder: str, common: dict) -> Any:+ from .diffusion_offline_source import offline_snapshot_source++ # Offline by repo id, transformers 5.x fails on cached tokenizers (see diffusion_offline_source).+ source = offline_snapshot_source(+ repo_id,+ subfolder,+ local_files_only = common.get("local_files_only", False),+ cache_dir = common.get("cache_dir"),+ )+ return auto_tokenizer.from_pretrained(source, subfolder = subfolder, **common)+++def load_anima_pipeline(+ repo_id: str,+ dtype,+ *,+ hf_token: Optional[str] = None,+ transformer: Any = None,+ text_conditioner: Any = None,+ text_encoder: Any = None,+ vae: Any = None,+ local_files_only: bool = False,+ cache_dir: Optional[str] = None,+ check_cancelled: Optional[Callable[[], None]] = None,+) -> Any:+ """``AnimaPipeline`` from the diffusers repo / folder ``repo_id``, on CPU; handed-in components replace its own."""+ check_cancelled = check_cancelled or (lambda: None)+ check_cancelled()+ if not anima_available():+ raise RuntimeError(+ "Anima needs a diffusers build with the Anima modular blocks (0.39 or newer)."+ )+ import diffusers+ from transformers import AutoTokenizer, Qwen3Model++ common: dict[str, Any] = {"local_files_only": local_files_only}+ if cache_dir:+ common["cache_dir"] = cache_dir+ if hf_token:+ common["token"] = hf_token+ tokenizer, t5_tokenizer = (+ _load_tokenizer(AutoTokenizer, repo_id, subfolder, common)+ for subfolder in ("tokenizer", "t5_tokenizer")+ )+ check_cancelled()+ if text_encoder is None:+ text_encoder = Qwen3Model.from_pretrained(+ repo_id, subfolder = "text_encoder", dtype = dtype, **common+ )+ text_encoder.eval()+ check_cancelled()+ if transformer is None:+ transformer = diffusers.CosmosTransformer3DModel.from_pretrained(+ repo_id, subfolder = "transformer", torch_dtype = dtype, **common+ )+ check_cancelled()+ if text_conditioner is None:+ text_conditioner = diffusers.AnimaTextConditioner.from_pretrained(+ repo_id, subfolder = "text_conditioner", torch_dtype = dtype, **common+ )+ check_cancelled()+ if vae is None:+ vae = diffusers.AutoencoderKLQwenImage.from_pretrained(+ repo_id, subfolder = "vae", torch_dtype = dtype, **common+ )+ check_cancelled()+ scheduler = diffusers.FlowMatchEulerDiscreteScheduler.from_pretrained(+ repo_id, subfolder = "scheduler", **common+ )+ logger.info("diffusion.anima: assembled pipeline from %s per component", repo_id)+ return anima_pipeline_class()(+ transformer = transformer,+ text_conditioner = text_conditioner,+ text_encoder = text_encoder,+ tokenizer = tokenizer,+ t5_tokenizer = t5_tokenizer,+ vae = vae,+ scheduler = scheduler,+ )diff --git a/studio/backend/core/inference/diffusion_cfg_batch.py b/studio/backend/core/inference/diffusion_cfg_batch.pyindex c083d53de4e..59323f5bb9c 100644--- a/studio/backend/core/inference/diffusion_cfg_batch.py+++ b/studio/backend/core/inference/diffusion_cfg_batch.py@@ -52,6 +52,10 @@ NOT_BATCHABLE: dict[str, str] = {"MOSSImageTransformer": "the negative branch skips block 22 (uncond_skip_layers): per-branch compute","Cosmos3OmniTransformer": "each branch packs its own variable-length token sequence","MiniMaxH3Transformer3DModel": "one denoiser call per step (no guidance pair to batch)",+ "ChromaTransformer2DModel": "not measured batched: each branch passes its own T5 attention mask, and Chroma "+ "runs eager",+ "CosmosTransformer3DModel": "Anima's modular guider runs each branch as its own guider batch "+ "(prepare_models before each call)",# Measured (Colab L4, 1024x1024, 8 steps): 1.817 vs 1.454 s/step eager, 1.312 vs 1.078 compiled. A single call# packs each prompt at its own caption length with no mask; the doubled call pads both to the longer one and runs# masked attention.diff --git a/studio/backend/core/inference/diffusion_comfy_components.py b/studio/backend/core/inference/diffusion_comfy_components.pyindex 71342da8942..63844c1a898 100644--- a/studio/backend/core/inference/diffusion_comfy_components.py+++ b/studio/backend/core/inference/diffusion_comfy_components.py@@ -40,6 +40,7 @@ TE_KIND_CLASSES: dict[str, frozenset] = {"qwen3": frozenset({"Qwen3Model", "Qwen3ForCausalLM"}),"qwen2_5_vl": frozenset({"Qwen2_5_VLForConditionalGeneration", "Qwen2_5_VLModel"}),"qwen3_vl": frozenset({"Qwen3VLForConditionalGeneration", "Qwen3VLModel"}),+ "qwen3_5": frozenset({"Qwen3_5Model", "Qwen3_5ForConditionalGeneration", "Qwen3_5ForCausalLM"}),"mistral3": frozenset({"Mistral3ForConditionalGeneration", "Mistral3Model"}),"llama": frozenset({"LlamaForCausalLM", "LlamaModel"}),"gemma2": frozenset({"Gemma2Model", "Gemma2ForCausalLM"}),@@ -246,6 +247,9 @@ def classify_text_encoder(lm_prefix = "model.language_model." if has("model.language_model.layers.") else "model."if not has(lm_prefix + "layers."):return None+ if has(lm_prefix + "layers.0.linear_attn."):+ # Qwen3.5's layer 0 is gated-delta (no q_norm there), so the checks below would read it as Qwen2.5-VL.+ return "qwen3_5"q_norm = has(lm_prefix + "layers.0.self_attn.q_norm.")if has(lm_prefix + "layers.0.pre_feedforward_layernorm."):return (@@ -1196,6 +1200,7 @@ def load_override_modules(missing = [c for c in overrides.files if c not in overrides.modules]if not missing:return dict(overrides.modules)+ from .diffusion_families import MOSS_IMAGE_FAMILY_NAMEfrom .diffusion_text_encoder_trim import family_trims_lm_headfor component in missing:@@ -1209,8 +1214,10 @@ def load_override_modules(cache_dir = cache_dir,)if component == COMPONENT_VAE:+ # MOSS-Image decodes in fp32: a bf16 build first would round its weights.+ vae_dtype = None if family == MOSS_IMAGE_FAMILY_NAME else dtypeoverrides.modules[component] = build_vae(- path, vae_cls = cls, config = config, dtype = dtype, logger = logger+ path, vae_cls = cls, config = config, dtype = vae_dtype, logger = logger)continuetrim = component == "text_encoder" and family_trims_lm_head(family)diff --git a/studio/backend/core/inference/diffusion_comfy_quant.py b/studio/backend/core/inference/diffusion_comfy_quant.pyindex ce93b6a1751..d8f6c14d8b7 100644--- a/studio/backend/core/inference/diffusion_comfy_quant.py+++ b/studio/backend/core/inference/diffusion_comfy_quant.py@@ -27,6 +27,8 @@ FP8_STORAGE_ENV = "UNSLOTH_DIFFUSION_FP8_STORAGE"CONVERSION_RECORD_KEY = "unsloth_comfy_conversion"INT8_TENSORWISE = "int8_tensorwise"+# Unpacked, a ConvRot W4A4 layer is an int8_tensorwise ConvRot layer (run with int8 activations, not int4).+CONVROT_W4A4 = "convrot_w4a4"FP8_E4M3 = "float8_e4m3fn"FP8_FORMATS = {"float8_e4m3fn": "F8_E4M3", "float8_e5m2": "F8_E5M2"}@@ -51,6 +53,8 @@ _CONSUMED = {MXFP8: (".weight_scale", ".input_scale"),}_LEGACY_RENAME = {".scale_weight": ".weight_scale", ".scale_input": ".input_scale"}+# Container prefixes a declaration may omit while its weight carries one.+_DECLARATION_PREFIXES = ("model.diffusion_model.", "diffusion_model.")# Row tag: key index * 2**24 + row, exact in float64 for any real checkpoint._TAG = float(1 << 24)@@ -67,6 +71,8 @@ class ComfyQuantLayer:format: strconvrot: bool = Falsegroup: int = 0+ # ``.weight`` holds packed int4 (K / 2 columns), unpacked on load.+ packed_int4: bool = False@dataclass@@ -109,6 +115,55 @@ def _read_json_tensor(path: str, entry: dict, base: int) -> Any:return json.loads(handle.read(int(end) - int(start)).decode("utf-8"))+def _w4a4_group(raw: Any) -> int:+ params = raw.get("params") if isinstance(raw.get("params"), dict) else {}+ group = raw.get("convrot_groupsize", params.get("convrot_groupsize", 256))+ return int(group) if isinstance(group, (int, float)) else 0+++def _w4a4_layer_problem(+ name: str, raw: Any, weight: Optional[dict], header: dict, keys: set+) -> Optional[str]:+ params = raw.get("params") if isinstance(raw.get("params"), dict) else {}+ linear = raw.get("linear_dtype", params.get("linear_dtype", "int4"))+ group = _w4a4_group(raw)+ if linear not in ("int4", "int8"):+ return f"{CONVROT_W4A4} with linear_dtype {linear!r}"+ if weight is None:+ return f"{CONVROT_W4A4} declared but there is no {name}.weight"+ shape = weight.get("shape") or ()+ if len(shape) != 2 or weight.get("dtype") != "I8":+ return (+ f"{CONVROT_W4A4} weight {weight.get('dtype')} {list(shape)} (expected packed 2-D int8)"+ )+ if not _is_power_of_four(group):+ return f"ConvRot group {group!r} is not a power of 4"+ if (2 * int(shape[1])) % group:+ return f"in_features {2 * int(shape[1])} not divisible by ConvRot group {group}"+ scale = header.get(name + ".weight_scale")+ if scale is None or _numel(scale) != int(shape[0]):+ return f"{CONVROT_W4A4} needs one weight_scale per row ({shape[0]})"+ leftover = [s for s in _SCALE_SUFFIXES if name + s in keys and s != ".weight_scale"]+ if leftover:+ return f"{CONVROT_W4A4} layer carries {', '.join(leftover)}, which this format does not use"+ return None+++def unpack_int4_rows(packed: Any) -> Any:+ """Signed int4 codes, two per byte (low nibble first), as one int8 per code: ``(N, K / 2)`` -> ``(N, K)``."""+ import torch++ from .diffusion_single_file_converters import charge_host_ram++ charge_host_ram(packed.numel() * 10)+ x = packed.to(torch.int16)+ lo = x & 0x0F+ hi = (x >> 4) & 0x0F+ lo = torch.where(lo >= 8, lo - 16, lo)+ hi = torch.where(hi >= 8, hi - 16, hi)+ return torch.stack((lo, hi), dim = -1).reshape(packed.shape[0], -1).to(torch.int8)++def _layer_conf(raw: Any) -> tuple[Optional[str], bool, int]:"""``(format, convrot, group)`` with ComfyUI's own defaults (``params`` nesting, group 256)."""if not isinstance(raw, dict):@@ -176,6 +231,11 @@ def scan_comfy_quant(path: Optional[str]) -> Optional[ComfyQuantScan]:if key.endswith(".scale_weight"):declared.setdefault(key[: -len(".scale_weight")], {"format": fmt})+ for name in [n for n in declared if n + ".weight" not in keys]:+ for prefix in _DECLARATION_PREFIXES:+ if prefix + name + ".weight" in keys and prefix + name not in declared:+ declared[prefix + name] = declared.pop(name)+ breakscaled = {key[: -len(suffix)] for key in keys for suffix in _SCALE_SUFFIXES if key.endswith(suffix)}@@ -203,6 +263,15 @@ def scan_comfy_quant(path: Optional[str]) -> Optional[ComfyQuantScan]:fmt, convrot, group = _layer_conf(raw)weight = header.get(name + ".weight")why = None+ if fmt == CONVROT_W4A4:+ why = _w4a4_layer_problem(name, raw, weight, header, keys)+ if why:+ scan.problems.append(f"{name}: {why}")+ else:+ scan.layers[name] = ComfyQuantLayer(+ name, INT8_TENSORWISE, True, _w4a4_group(raw), packed_int4 = True+ )+ continueif fmt is None:why = "no format"elif fmt not in _CONSUMED:@@ -402,6 +471,8 @@ def comfy_resident_mib())packed = {name + ".weight" for name, layer in scan.layers.items() if layer.format == NVFP4}+ # Packed int4 is half the int8 the loader unpacks it to, kept or dequantized.+ packed_int4 = {name + ".weight" for name, layer in scan.layers.items() if layer.packed_int4}total = 0for key, entry in header.items():if keep_key is not None and not keep_key(key):@@ -413,9 +484,12 @@ def comfy_resident_mib(dtype = str(entry.get("dtype", ""))stored = numel * _DTYPE_BYTES.get(dtype, 2)if key in kept:- total += (- stored if kept[key] else numel * _bytes(key, shape) * (2 if key in packed else 1)- )+ if kept[key]:+ total += stored * (2 if key in packed_int4 else 1)+ else:+ total += (+ numel * _bytes(key, shape) * (2 if key in packed or key in packed_int4 else 1)+ )elif key.endswith(COMFY_QUANT_SUFFIX) or any(key.endswith(s) for s in _SCALE_SUFFIXES):total += storedelif dtype.startswith(("F", "BF")):@@ -1240,7 +1314,7 @@ def load_comfy_quant_transformer(_widened = {layer.name + ".weight": (- (2 if layer.format == NVFP4 else 1)+ (2 if layer.format == NVFP4 or layer.packed_int4 else 1)if not (backends.get(layer.format) or _stored(layer))or (layer.format in BLOCK_SIZES and key_map is not None)else 0@@ -1282,6 +1356,8 @@ def load_comfy_quant_transformer(for layer in scan.layers.values():codes = state.pop(layer.name + ".weight")scale = state.pop(layer.name + ".weight_scale")+ if layer.packed_int4:+ codes = unpack_int4_rows(codes)# int8 / fp8 / mxfp8 activations are quantized per call; only nvfp4 uses its static input_scale.input_scale = state.pop(layer.name + ".input_scale", None)extra = Nonediff --git a/studio/backend/core/inference/diffusion_content.py b/studio/backend/core/inference/diffusion_content.pyindex 83cf4c5b847..03e957d52bf 100644--- a/studio/backend/core/inference/diffusion_content.py+++ b/studio/backend/core/inference/diffusion_content.py@@ -193,6 +193,8 @@ _DIT_PREFIXES = ("model.model.","model.","transformer.",+ # Anima (Cosmos-Predict2 reference checkpoints).+ "net.","",)@@ -262,6 +264,19 @@ def _match_dit(s: dict[str, list[int]]) -> Optional[CheckpointInfo]:return _dit("flux.2-dev", "a FLUX.2 [dev] diffusion transformer", layout)return _dit("flux.2-klein", "a FLUX.2 [klein] diffusion transformer", layout)+ if "distilled_guidance_layer" in tops and (+ {"double_blocks", "single_blocks"} <= tops+ or {"transformer_blocks", "single_transformer_blocks"} <= tops+ ):+ layout = "diffusers" if "transformer_blocks" in tops else "comfy"+ if any(t.startswith("nerf") for t in tops):+ return _dit(+ None,+ "a Chroma1-Radiance (pixel-space) diffusion transformer (not supported)",+ layout,+ )+ return _dit("chroma", "a Chroma diffusion transformer", layout)+if "double_blocks" in tops and "single_blocks" in tops and "vector_in" in tops:in_ch = _dim(s, "img_in.weight", 1)if in_ch not in (None, 64):@@ -300,6 +315,18 @@ def _match_dit(s: dict[str, list[int]]) -> Optional[CheckpointInfo]:"diffusers" if "time_caption_embed" in tops else "comfy",)+ if {+ "layers",+ "text_embedder",+ "shared_block_modulation",+ "video_embedder",+ "video_head_modulation",+ } <= tops:+ return _dit("moss-image", "a MOSS-Image diffusion transformer", "comfy")++ if {"blocks", "llm_adapter", "x_embedder", "t_embedder", "final_layer"} <= tops:+ return _dit("anima", "an Anima diffusion transformer", "comfy")+if {"txtfusion", "tmlp", "first"} <= tops:return _dit("krea-2", "a Krea-2 diffusion transformer", "comfy")if {"text_fusion", "time_mod_proj", "transformer_blocks"} <= tops:diff --git a/studio/backend/core/inference/diffusion_dynamic_text.py b/studio/backend/core/inference/diffusion_dynamic_text.pyindex 106ccb2ccb1..f41c1f8931f 100644--- a/studio/backend/core/inference/diffusion_dynamic_text.py+++ b/studio/backend/core/inference/diffusion_dynamic_text.py@@ -130,6 +130,8 @@ PROMPT_LENGTH_POLICY: dict[str, Any] = {"QwenImage21Transformer2DModel": _QWEN_IMAGE_21_SOURCES,"ZImageTransformer2DModel": _ZIMAGE_SOURCES,"Krea2Transformer2DModel": FIXED_LENGTH, # padded to max_sequence_length 512+ "ChromaTransformer2DModel": FIXED_LENGTH, # T5 padded to max_sequence_length 512+ "CosmosTransformer3DModel": FIXED_LENGTH, # Anima: the text conditioner pads to min_sequence_length 512"Lumina2Transformer2DModel": FIXED_LENGTH, # Gemma padded to max_sequence_length 256"HunyuanImageTransformer2DModel": FIXED_LENGTH, # padded to the tokenizer max length"HiDreamImageTransformer2DModel": FIXED_LENGTH, # T5 / Llama padded to max_sequence_length 128diff --git a/studio/backend/core/inference/diffusion_families.py b/studio/backend/core/inference/diffusion_families.pyindex c8cef9e0d93..89f292b66b6 100644--- a/studio/backend/core/inference/diffusion_families.py+++ b/studio/backend/core/inference/diffusion_families.py@@ -95,7 +95,9 @@ class DiffusionFamily:# True for families needing MULTIPLE denoisers no single file carries (Ideogram 4), so only a full pipeline load# is valid.pipeline_only: bool = False- # Transformer-only files (GGUF) load only via sd.cpp; diffusers has no single-file loader (MOSS-Image).+ # False: no GGUF loader on either engine (Anima).+ gguf_loadable: bool = True+ # Transformer-only GGUFs load only via sd.cpp (MOSS-Image); its .safetensors single files load on diffusers.native_transformer_files_only: bool = False# Optional diffusers pipeline classes for image-conditioned workflows, built via ``Pipeline.from_pipe`` (no# reload). None = unsupported.@@ -137,6 +139,8 @@ class DiffusionFamily:comfy_flow_shift_variants: tuple[tuple[str, Optional[float]], ...] = field(default_factory = tuple)+ # Scheduler config set after the static shift (Chroma's beta schedule).+ scheduler_overrides: tuple[tuple[str, Any], ...] = field(default_factory = tuple)# ComfyUI shift node (diffusion_flow_shift SHIFT_NODE_*); None = no Shift control. ``_variants``: (id substring, node), first match wins.comfy_shift_node: Optional[str] = Nonecomfy_shift_node_variants: tuple[tuple[str, Optional[str]], ...] = field(default_factory = tuple)@@ -385,6 +389,7 @@ _KREA2_SD_CPP_ARCH_MARKER = "Krea2"# Keyed by architecture, not per variant: the base repo is read from the HF base_model tag at load time, so one entry# covers Turbo/full, schnell/dev.MOSS_IMAGE_FAMILY_NAME = "moss-image"+ANIMA_FAMILY_NAME = "anima"# MOSS-Image keep-list: text_embedder, timestep MLP, AdaLN stay bf16 (LPIPS 0.058 vs 0.077 generic)._MOSS_IMAGE_QUANT_KEEP: tuple[str, ...] = ("text_embedder", "time_embedding", "modulation")_MOSS_IMAGE_CONVROT_SUFFIXES = (@@ -1195,6 +1200,31 @@ _FAMILIES: tuple[DiffusionFamily, ...] = (aliases = ("lumina-image-2.0", "lumina-image-2", "lumina2"),fp16_incompatible = True,),+ # Chroma: shift 1 on the beta schedule; linear spacing (shift 1 or the shipped 3) letterboxes some prompts.+ DiffusionFamily(+ name = "chroma",+ comfy_shift_node = "sd3",+ label = "Chroma",+ # Quantized activations drift Chroma (fp8 letterboxes some seeds): fp8 and GGUF weights widen to bf16.+ profile = FamilyProfile(scheme_deny = frozenset({"fp8", "int8", "nvfp4", "mxfp8"})),+ pipeline_class = "ChromaPipeline",+ transformer_class = "ChromaTransformer2DModel",+ base_repo = "lodestones/Chroma1-HD",+ comfy_flow_shift = 1.0,+ scheduler_overrides = (("use_beta_sigmas", True),),+ aliases = ("chroma1", "chroma1-hd", "chroma-hd"),+ fp16_incompatible = True,+ ),+ DiffusionFamily(+ name = ANIMA_FAMILY_NAME,+ label = "Anima",+ pipeline_class = "AnimaModularPipeline",+ transformer_class = "CosmosTransformer3DModel",+ base_repo = "circlestone-labs/Anima-Base-v1.0-Diffusers",+ aliases = ("anima-base", "anima-2.9b"),+ gguf_loadable = False,+ fp16_incompatible = True,+ ),# HunyuanImage 2.1: a 17B dual-stream DiT with a Qwen2.5-VL encoder, a ByT5 glyph encoder and the 32x HunyuanImage# VAE.# HiDream-I1: a 17B MoE DiT with FOUR text encoders. The repos ship CLIP-L/CLIP-G/T5-XXL but NOT the Llama-3.1-8B@@ -2135,6 +2165,9 @@ _GENERATION_DEFAULTS: tuple[tuple[str, int, float], ...] = (("sdxl-turbo", 1, 0.0),("stable-diffusion-xl", 25, 7.0),("sdxl", 25, 7.0),+ # Keyed by base repo: a bare "anima" would match Animagine XL (SDXL) files first.+ ("circlestone-labs/anima", 30, 4.0),+ ("chroma", 26, 3.5),)# Unrecognised model: distilled few-step / no-CFG shape, matching the UI fallback._GENERATION_DEFAULT_FALLBACK = (9, 0.0)@@ -2355,6 +2388,7 @@ _PIPELINE_MIN_DIFFUSERS: dict[str, str] = {"Flux3ModularPipeline": "0.42.0","Flux3DistilledModularPipeline": "0.42.0","Krea2Pipeline": "0.39.0",+ "AnimaModularPipeline": "0.39.0",# Older than the 0.35 baseline, but listed anyway: the packaging leaves an UNCONSTRAINED diffusers installable# below 3.10, so an already-present ancient one satisfies the pin, and quoting the 0.39 floor at a family that has# existed since 0.30 is the same wrong remedy.@@ -2363,6 +2397,7 @@ _PIPELINE_MIN_DIFFUSERS: dict[str, str] = {"QwenImageInpaintPipeline": "0.35.0","FluxKontextPipeline": "0.35.0","HiDreamImagePipeline": "0.34.0",+ "ChromaPipeline": "0.34.0",# WanPipeline arrived with Wan2.1 in 0.33.0. The shipped Wan2.2 family wants weights only 0.35 carries, but this# table answers class presence, like the attribute probe before it."WanPipeline": "0.33.0",@@ -2647,6 +2682,7 @@ _DIFFUSERS_MAIN_MIN_PYTHON = (3, 11)_PIPELINE_PROBE_FILES: dict[str, str] = {"Flux3ModularPipeline": "modular_pipelines/flux3/modular_pipeline.py","Flux3DistilledModularPipeline": "modular_pipelines/flux3/modular_pipeline.py",+ "AnimaModularPipeline": "modular_pipelines/anima/modular_pipeline.py",}@@ -2994,7 +3030,7 @@ def pipeline_available_family_names() -> tuple[str, ...]:def family_gguf_loadable(fam: DiffusionFamily) -> bool:"""A single-file-pipeline family or a multi-denoiser family has no transformer-only GGUF to load."""- return not fam.single_file_is_pipeline and not fam.pipeline_only+ return not fam.single_file_is_pipeline and not fam.pipeline_only and fam.gguf_loadabledef family_mlx_supported(fam: Optional[DiffusionFamily]) -> bool:diff --git a/studio/backend/core/inference/diffusion_flow_shift.py b/studio/backend/core/inference/diffusion_flow_shift.pyindex 30b13c11a2c..f43dbb9a8c0 100644--- a/studio/backend/core/inference/diffusion_flow_shift.py+++ b/studio/backend/core/inference/diffusion_flow_shift.py@@ -100,6 +100,19 @@ def apply_scheduler_overrides(return True+def apply_comfy_schedule(+ pipe: Any,+ shift: Optional[float],+ overrides: Any = (),+ logger: Any = None,+) -> bool:+ """``shift``, then scheduler ``overrides``; the opt-out keeps the shipped scheduler. True when it changed."""+ if not comfy_sigmas_enabled():+ return False+ shifted = apply_comfy_flow_shift(pipe, shift, logger)+ return apply_scheduler_overrides(pipe, overrides, logger) or shifted++# A pipeline config's fixed sampling grid, terminal sigma excluded (QwenImage21Pipeline, huggingface/diffusers#14950).SAMPLE_SIGMAS_KEY = "sample_sigmas"diff --git a/studio/backend/core/inference/diffusion_krea2.py b/studio/backend/core/inference/diffusion_krea2.pyindex 3559a0c358b..750131583fc 100644--- a/studio/backend/core/inference/diffusion_krea2.py+++ b/studio/backend/core/inference/diffusion_krea2.py@@ -147,6 +147,7 @@ def load_krea2_pipeline(text_encoder = None,local_files_only: bool = False,check_cancelled: Optional[Callable[[], None]] = None,+ vae = None,):"""local_files_only raises rather than fetching a component after the resident pipeline was evicted."""check_cancelled = check_cancelled or (lambda: None)@@ -192,15 +193,16 @@ def load_krea2_pipeline(cache_dir = cache_dir,)check_cancelled()- vae = diffusers.AutoencoderKLQwenImage.from_pretrained(- repo_id,- subfolder = "vae",- torch_dtype = dtype,- token = token,- local_files_only = local_files_only,- cache_dir = cache_dir,- )- check_cancelled()+ if vae is None:+ vae = diffusers.AutoencoderKLQwenImage.from_pretrained(+ repo_id,+ subfolder = "vae",+ torch_dtype = dtype,+ token = token,+ local_files_only = local_files_only,+ cache_dir = cache_dir,+ )+ check_cancelled()if transformer is None and with_transformer:transformer = diffusers.Krea2Transformer2DModel.from_pretrained(repo_id,diff --git a/studio/backend/core/inference/diffusion_moss_image.py b/studio/backend/core/inference/diffusion_moss_image.pyindex 0e5909c0e47..2a907729b14 100644--- a/studio/backend/core/inference/diffusion_moss_image.py+++ b/studio/backend/core/inference/diffusion_moss_image.py@@ -1090,6 +1090,7 @@ def load_moss_image_pipeline(check_cancelled: Optional[Callable[[], None]] = None,vae_dtype: Any = None,checkpoint: Optional[str] = None,+ vae: Any = None,) -> MOSSImagePipeline:"""A ready ``MOSSImagePipeline`` for ``repo_id`` (a repo id or a local diffusers folder), on CPU.@@ -1125,9 +1126,12 @@ def load_moss_image_pipeline()check_cancelled()transformer.eval()- vae = diffusers.AutoencoderKLFlux2.from_pretrained(- repo_id, subfolder = "vae", torch_dtype = vae_dtype or torch.float32, **common- )+ if vae is None:+ vae = diffusers.AutoencoderKLFlux2.from_pretrained(+ repo_id, subfolder = "vae", torch_dtype = vae_dtype or torch.float32, **common+ )+ else:+ vae = vae.to(vae_dtype or torch.float32)check_cancelled()scheduler = MOSSImageScheduler.from_pretrained(repo_id, subfolder = "scheduler", **common)logger.info("diffusion.moss_image: assembled pipeline from %s per component", repo_id)diff --git a/studio/backend/core/inference/diffusion_single_file_converters.py b/studio/backend/core/inference/diffusion_single_file_converters.pyindex e0f883cd3da..ef9fd965b76 100644--- a/studio/backend/core/inference/diffusion_single_file_converters.py+++ b/studio/backend/core/inference/diffusion_single_file_converters.py@@ -119,6 +119,38 @@ def krea2_checkpoint_to_diffusers(checkpoint: Any = None, **kwargs: Any) -> dictreturn converted+_MOSS_QKV_RE = re.compile(r"^(layers\.\d+\.proj\.)qkv\.(weight|bias)$")+++def moss_image_checkpoint_to_diffusers(checkpoint: Any = None, **kwargs: Any) -> dict:+ """Reference-layout MOSS-Image -> the in-tree names: split the fused ``proj.qkv`` (equal q, k, v thirds), drop the+ ``comfy_attention.config`` hint."""+ converted: dict = {}+ for raw_key, value in (checkpoint or {}).items():+ key = _strip_prefix(raw_key)+ if key.endswith(".comfy_attention.config"):+ continue+ match = _MOSS_QKV_RE.match(key)+ if match is None:+ converted[key] = value+ continue+ stem, kind = match.groups()+ rows = int(value.shape[0])+ if rows % 3:+ raise ValueError(f"{raw_key}: {rows} rows do not split into q, k and v")+ for part, piece in zip(("q", "k", "v"), _split_rows(raw_key, value, (rows // 3,) * 3)):+ converted[f"{stem}{part}.{kind}"] = piece+ config = kwargs.get("config") or {}+ if "rope.bands" not in converted and config.get("dim") and config.get("num_heads"):+ # Some converters drop the RoPE band buffer; it is a function of the config (_RoPE._default_bands).+ import torch++ bands = int(config["dim"]) // int(config["num_heads"]) // 8+ exponent = torch.arange(bands, dtype = torch.float32) / bands+ converted["rope.bands"] = 1 / (float(config.get("rope_base", 10000.0)) ** exponent)+ return converted++_HYIMG_TOP = {"img_in.proj": "x_embedder.proj","time_in.in_layer": "time_guidance_embed.timestep_embedder.linear_1",@@ -343,6 +375,7 @@ def _cat_rows(first: Any, second: Any) -> Any:CONVERTERS: dict = {"Krea2Transformer2DModel": krea2_checkpoint_to_diffusers,+ "MOSSImageTransformer": moss_image_checkpoint_to_diffusers,"HunyuanImageTransformer2DModel": hunyuanimage_checkpoint_to_diffusers,}diff --git a/studio/backend/hub/utils/comfy_models.py b/studio/backend/hub/utils/comfy_models.pyindex 35ccdb0a8ef..6b89166fd2e 100644--- a/studio/backend/hub/utils/comfy_models.py+++ b/studio/backend/hub/utils/comfy_models.py@@ -342,11 +342,18 @@ def loose_diffusion_checkpoints(folder: Path, *, entry_limit: Optional[int] = Nodef _single_file_loadable(image_fam, video_fam, filename: str) -> bool:- """Mirrors the loaders' single-file refusals (pipeline-only, dual-expert, unnamed MiniMax-H3)."""+ """Mirrors the loaders' single-file refusals (pipeline-only, dual-expert, unnamed MiniMax-H3, a native-only+ family's non-safetensors file, a GGUF of a family with no GGUF loader)."""if image_fam is not None:- return not (- image_fam.pipeline_only or getattr(image_fam, "native_transformer_files_only", False)- )+ if image_fam.pipeline_only:+ return False+ if str(filename or "").lower().endswith(".gguf") and not getattr(+ image_fam, "gguf_loadable", True+ ):+ return False+ if getattr(image_fam, "native_transformer_files_only", False):+ return str(filename or "").lower().endswith(".safetensors")+ return Truefrom core.inference.video_families import PIPELINE_ONLY_VIDEO_FAMILIESif video_fam is None or video_fam.is_moe or video_fam.name in PIPELINE_ONLY_VIDEO_FAMILIES:diff --git a/studio/backend/tests/fixtures/diffusion_autoopt_parity.json b/studio/backend/tests/fixtures/diffusion_autoopt_parity.jsonindex c5f51e65322..46731dca3f0 100644--- a/studio/backend/tests/fixtures/diffusion_autoopt_parity.json+++ b/studio/backend/tests/fixtures/diffusion_autoopt_parity.json@@ -1,5 +1,5 @@{- "meta": {"base": "origin/main 5f38afbc2d (before diffusion_autoopt)", "dtypes": ["bfloat16", "float16"], "families": ["image|flux.1", "image|flux.1-kontext", "image|flux.2-dev", "image|flux.2-klein", "image|flux.3-klein", "image|flux.3-klein-base", "image|hidream-i1", "image|hunyuanimage-2.1", "image|ideogram-4", "image|krea-2", "image|lumina-2", "image|moss-image", "image|qwen-image", "image|qwen-image-2.1", "image|qwen-image-edit", "image|qwen-image-layered", "image|sdxl", "image|z-image", "video|cosmos3-edge", "video|cosmos3-nano", "video|hunyuanvideo-1.5", "video|hunyuanvideo-1.5-720p", "video|ltx-2", "video|ltx-2.5", "video|minimax-h3", "video|wan2.1-t2v-1.3b", "video|wan2.1-t2v-14b", "video|wan2.2-t2v-a14b", "video|wan2.2-ti2v-5b"], "speeds": ["off", "eager", "default", "max"]},+ "meta": {"base": "origin/main 5f38afbc2d (before diffusion_autoopt)", "dtypes": ["bfloat16", "float16"], "families": ["image|anima", "image|chroma", "image|flux.1", "image|flux.1-kontext", "image|flux.2-dev", "image|flux.2-klein", "image|flux.3-klein", "image|flux.3-klein-base", "image|hidream-i1", "image|hunyuanimage-2.1", "image|ideogram-4", "image|krea-2", "image|lumina-2", "image|moss-image", "image|qwen-image", "image|qwen-image-2.1", "image|qwen-image-edit", "image|qwen-image-layered", "image|sdxl", "image|z-image", "video|cosmos3-edge", "video|cosmos3-nano", "video|hunyuanvideo-1.5", "video|hunyuanvideo-1.5-720p", "video|ltx-2", "video|ltx-2.5", "video|minimax-h3", "video|wan2.1-t2v-1.3b", "video|wan2.1-t2v-14b", "video|wan2.2-t2v-a14b", "video|wan2.2-ti2v-5b"], "speeds": ["off", "eager", "default", "max"]},"cases": {"image|flux.1-kontext|default|bfloat16|offload=0|gguf=0": {"applied":[["compiled","cuda_graph","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":false,"compile_calls":[{"dynamic":true,"fullgraph":true}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},"image|flux.1-kontext|default|bfloat16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},@@ -752,6 +752,70 @@"image|moss-image|off|float16|offload=0|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},"image|moss-image|off|float16|offload=0|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},"image|moss-image|off|float16|offload=1|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},- "image|moss-image|off|float16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}}+ "image|moss-image|off|float16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|bfloat16|offload=0|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|bfloat16|offload=0|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|bfloat16|offload=1|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|bfloat16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|float16|offload=0|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|float16|offload=0|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|float16|offload=1|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|off|float16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|bfloat16|offload=0|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|bfloat16|offload=0|gguf=1": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|bfloat16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|bfloat16|offload=1|gguf=1": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|float16|offload=0|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|float16|offload=0|gguf=1": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|eager|float16|offload=1|gguf=1": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|bfloat16|offload=0|gguf=0": {"applied":[["compiled","cuda_graph","cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":false,"compile_calls":[{"dynamic":true,"fullgraph":true}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|bfloat16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|bfloat16|offload=1|gguf=0": {"applied":[["compiled","cudnn_benchmark","fp16_accum"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":false,"compile_calls":[{"dynamic":true,"fullgraph":false}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|bfloat16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark","fp16_accum"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|float16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|float16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|default|float16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|bfloat16|offload=0|gguf=0": {"applied":[["compiled","cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[{"dynamic":null,"fullgraph":true,"mode":"max-autotune-no-cudagraphs"}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|bfloat16|offload=0|gguf=1": {"applied":[["compiled","cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[{"dynamic":null,"fullgraph":true,"mode":"max-autotune-no-cudagraphs"}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|bfloat16|offload=1|gguf=0": {"applied":[["compiled","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[{"dynamic":null,"fullgraph":false,"mode":"max-autotune-no-cudagraphs"}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|bfloat16|offload=1|gguf=1": {"applied":[["compiled","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[{"dynamic":null,"fullgraph":false,"mode":"max-autotune-no-cudagraphs"}],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|float16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|float16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|chroma|max|float16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|bfloat16|offload=0|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|bfloat16|offload=0|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|bfloat16|offload=1|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|bfloat16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|float16|offload=0|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|float16|offload=0|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|float16|offload=1|gguf=0": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|off|float16|offload=1|gguf=1": {"applied":[[]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|bfloat16|offload=0|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|bfloat16|offload=0|gguf=1": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|bfloat16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|bfloat16|offload=1|gguf=1": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|float16|offload=0|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|float16|offload=0|gguf=1": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|eager|float16|offload=1|gguf=1": {"applied":[["cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":null,"keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|bfloat16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":false,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|bfloat16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark","fp16_accum"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|bfloat16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":false,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|bfloat16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark","fp16_accum"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|float16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|float16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|default|float16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|bfloat16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|bfloat16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|bfloat16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|bfloat16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":true,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|float16|offload=0|gguf=0": {"applied":[["cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|float16|offload=0|gguf=1": {"applied":[["compiled_dequant","cuda_graph","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":false,"graph_reason":"eligible","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|float16|offload=1|gguf=0": {"applied":[["cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}},+ "image|anima|max|float16|offload=1|gguf=1": {"applied":[["compiled_dequant","cudnn_benchmark","fp16_accum","tf32"]],"graph_after_placement":true,"graph_reason":"armed after placement","keys":[["channels_last","compiled","compiled_dequant","compiled_vae_decode","cuda_graph","cudnn_benchmark","fp16_accum","fused_qkv","int8_gemm","rocm_query_chunks","tf32","vae_fp16_decode","vae_fused","vae_single_frame"]],"modules":{"transformer":{"auto_dynamic":null,"compile_calls":[],"int8_gemm":false,"static":false}},"patches":{"arch_fusions":true,"eager_fusions":true,"flux2_rope":false,"fp16_eager_rmsnorm":false,"qwenimage21_fast_step":false,"rocm_fused":false}}}}diff --git a/studio/backend/tests/fixtures/diffusion_family_data_freeze.json b/studio/backend/tests/fixtures/diffusion_family_data_freeze.jsonindex a6b8c70ccea..995a01aa0a1 100644--- a/studio/backend/tests/fixtures/diffusion_family_data_freeze.json+++ b/studio/backend/tests/fixtures/diffusion_family_data_freeze.json@@ -1,5 +1,11 @@{"auto_static_skip_by_base": {+ "anima": {+ "circlestone-labs/Anima-Base-v1.0-Diffusers": null+ },+ "chroma": {+ "lodestones/Chroma1-HD": null+ },"cosmos3-edge": {"nvidia/Cosmos3-Edge": null},@@ -119,6 +125,14 @@}},"defaults": {+ "anima": [+ 30,+ 4.0+ ],+ "chroma": [+ 26,+ 3.5+ ],"cosmos3-edge": {"fields": [20,@@ -303,6 +317,18 @@]},"flags": {+ "anima": {+ "cudnn_benchmark": true,+ "filter_reduction_configs": false,+ "filter_reduction_configs_archs": [],+ "vae_fused_encoder": true+ },+ "chroma": {+ "cudnn_benchmark": true,+ "filter_reduction_configs": false,+ "filter_reduction_configs_archs": [],+ "vae_fused_encoder": true+ },"cosmos3-edge": {"cudnn_benchmark": false,"filter_reduction_configs": false,@@ -976,6 +1002,206 @@"preview_key": "qwen_image","te_int8_effective": "fp8"},+ "anima": {+ "auto": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "auto_bf16_when_resident": null,+ "bf16": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "convrot_default_on": false,+ "fp8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "int8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [+ "norm",+ "_mod",+ "modulation",+ "timestep_embed",+ "guidance_embed",+ "time_text_embed",+ "pooled",+ "time_embed"+ ],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "mxfp8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "nvfp4": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "page": "image",+ "preview_key": null,+ "te_int8_effective": "fp8"+ },+ "chroma": {+ "auto": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "auto_bf16_when_resident": null,+ "bf16": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "convrot_default_on": false,+ "fp8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "int8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [+ "norm",+ "_mod",+ "modulation",+ "timestep_embed",+ "guidance_embed",+ "time_text_embed",+ "pooled",+ "time_embed"+ ],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "mxfp8": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "nvfp4": {+ "convrot_filename": null,+ "convrot_repo": null,+ "convrot_spec": [+ 0,+ []+ ],+ "convrot_variant_repos": [],+ "exclude": [],+ "pad": [],+ "runtime_quant": [],+ "streamed_weight_only": [],+ "zero_row": []+ },+ "page": "image",+ "preview_key": null,+ "te_int8_effective": "fp8"+ },"cosmos3-edge": {"auto": {"convrot_filename": null,@@ -4304,6 +4530,12 @@}},"family_scheme_deny": {+ "chroma": [+ "fp8",+ "int8",+ "mxfp8",+ "nvfp4"+ ],"flux.3-klein": ["nvfp4"],@@ -4561,6 +4793,8 @@]},"train_family_labels": {+ "anima": "Anima",+ "chroma": "Chroma","flux.1": "FLUX.1-dev","flux.2-dev": "FLUX.2-dev","flux.2-klein": "FLUX.2 Klein",@@ -4593,6 +4827,7 @@"black-forest-labs/flux.2-klein-9b","black-forest-labs/flux.2-klein-base-4b","black-forest-labs/flux.2-klein-base-9b",+ "circlestone-labs/anima-base-v1.0-diffusers","hidream-ai/hidream-i1-dev","hidream-ai/hidream-i1-fast","hidream-ai/hidream-i1-full",@@ -4602,6 +4837,7 @@"ideogram-ai/ideogram-4-nf4-diffusers","krea/krea-2-raw","krea/krea-2-turbo",+ "lodestones/chroma1-hd","openmoss-team/moss-image-base","openmoss-team/moss-image-sft","qwen/qwen-image",diff --git a/studio/backend/tests/fixtures/vae_tile_configs.json b/studio/backend/tests/fixtures/vae_tile_configs.jsonindex ca5a738a341..4f97dbde697 100644--- a/studio/backend/tests/fixtures/vae_tile_configs.json+++ b/studio/backend/tests/fixtures/vae_tile_configs.json@@ -764,6 +764,111 @@"use_quant_conv": false}},+ "chroma": {+ "kind": "image",+ "repo": "lodestones/Chroma1-HD",+ "revision": "0e0c60ece1e82b17cb7f77342d765ba5024c40c0",+ "config": {+ "_class_name": "AutoencoderKL",+ "_diffusers_version": "0.35.1",+ "_name_or_path": "/home/ubuntu/FLUX.1-schnell",+ "act_fn": "silu",+ "block_out_channels": [+ 128,+ 256,+ 512,+ 512+ ],+ "down_block_types": [+ "DownEncoderBlock2D",+ "DownEncoderBlock2D",+ "DownEncoderBlock2D",+ "DownEncoderBlock2D"+ ],+ "force_upcast": true,+ "in_channels": 3,+ "latent_channels": 16,+ "latents_mean": null,+ "latents_std": null,+ "layers_per_block": 2,+ "mid_block_add_attention": true,+ "norm_num_groups": 32,+ "out_channels": 3,+ "sample_size": 1024,+ "scaling_factor": 0.3611,+ "shift_factor": 0.1159,+ "up_block_types": [+ "UpDecoderBlock2D",+ "UpDecoderBlock2D",+ "UpDecoderBlock2D",+ "UpDecoderBlock2D"+ ],+ "use_post_quant_conv": false,+ "use_quant_conv": false+ }+ },+ "anima": {+ "kind": "image",+ "repo": "circlestone-labs/Anima-Base-v1.0-Diffusers",+ "revision": "073c3a9db359c31ad0e8aa268d15775473c2176c",+ "config": {+ "_class_name": "AutoencoderKLQwenImage",+ "_diffusers_version": "0.39.0.dev0",+ "attn_scales": [],+ "base_dim": 96,+ "dim_mult": [+ 1,+ 2,+ 4,+ 4+ ],+ "dropout": 0.0,+ "input_channels": 3,+ "latents_mean": [+ -0.7571,+ -0.7089,+ -0.9113,+ 0.1075,+ -0.1745,+ 0.9653,+ -0.1517,+ 1.5508,+ 0.4134,+ -0.0715,+ 0.5517,+ -0.3632,+ -0.1922,+ -0.9497,+ 0.2503,+ -0.2921+ ],+ "latents_std": [+ 2.8184,+ 1.4541,+ 2.3275,+ 2.6558,+ 1.2196,+ 1.7708,+ 2.6052,+ 2.0743,+ 3.2687,+ 2.1526,+ 2.8652,+ 1.5579,+ 1.6382,+ 1.1253,+ 2.8251,+ 1.916+ ],+ "num_res_blocks": 2,+ "temperal_downsample": [+ false,+ true,+ true+ ],+ "z_dim": 16+ }+ },"hunyuanimage-2.1": {"kind": "image","repo": "hunyuanvideo-community/HunyuanImage-2.1-Diffusers",diff --git a/studio/backend/tests/test_diffusion_backend.py b/studio/backend/tests/test_diffusion_backend.pyindex 44dcb7f2411..52936fca9c8 100644--- a/studio/backend/tests/test_diffusion_backend.py+++ b/studio/backend/tests/test_diffusion_backend.py@@ -5957,6 +5957,7 @@ def test_assemble_pipe_routes_krea2_per_component(monkeypatch):hf_token = None,transformer = None,text_encoder = None,+ vae = None,# Spelled out, not **kwargs: pins the exact production signature incl. local_files_only.local_files_only = False,check_cancelled = None,@@ -5964,6 +5965,7 @@ def test_assemble_pipe_routes_krea2_per_component(monkeypatch):assert callable(check_cancelled)calls["base"] = basecalls["transformer"] = transformer+ calls["vae"] = vaecalls["local_files_only"] = local_files_onlyreturn Pipe()@@ -5990,6 +5992,7 @@ def test_assemble_pipe_routes_krea2_per_component(monkeypatch):assert calls == {"base": "unsloth/Krea-2-Turbo","transformer": marker,+ "vae": None,"device": "cuda:0","local_files_only": False,}diff --git a/studio/backend/tests/test_diffusion_comfy_block.py b/studio/backend/tests/test_diffusion_comfy_block.pyindex c2b30d9233b..3bae65e903e 100644--- a/studio/backend/tests/test_diffusion_comfy_block.py+++ b/studio/backend/tests/test_diffusion_comfy_block.py@@ -235,7 +235,7 @@ def test_untiled_block_scales_are_refused(tmp_path):cq.refuse_comfy_quant(path)[email protected]("fmt", ["convrot_w4a4", "asym_w4a8_int8", "w6a8_int8", "brand_new"])[email protected]("fmt", ["asym_w4a8_int8", "w6a8_int8", "brand_new"])def test_remaining_formats_keep_the_refusal(tmp_path, fmt):path = _save(tmp_path / "r.safetensors",diff --git a/studio/backend/tests/test_diffusion_comfy_community_files.py b/studio/backend/tests/test_diffusion_comfy_community_files.pynew file mode 100644index 00000000000..49cd675d1ce--- /dev/null+++ b/studio/backend/tests/test_diffusion_comfy_community_files.py@@ -0,0 +1,581 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""Reference-layout single files of Anima, Chroma and MOSS-Image, and the ConvRot W4A4 int4 layout."""++from __future__ import annotations++import json++import pytest++torch = pytest.importorskip("torch")+safetensors_torch = pytest.importorskip("safetensors.torch")++import core.inference.diffusion_comfy_quant as cq # noqa: E402+from core.inference.diffusion_convrot import build_convrot_hadamard # noqa: E402+++def _conf(**conf) -> torch.Tensor:+ return torch.tensor(list(json.dumps(conf).encode("utf-8")), dtype = torch.uint8)+++def _save(+ path,+ tensors: dict,+ metadata: dict | None = None,+) -> str:+ safetensors_torch.save_file(+ {k: v.contiguous() for k, v in tensors.items()}, str(path), metadata = metadata+ )+ return str(path)+++# ConvRot W4A4: rotate, symmetric per-row int4 (max 7), two codes per byte, low nibble first.+def _w4a4(weight: torch.Tensor, group: int = 256) -> tuple:+ h = build_convrot_hadamard(group)+ w = (weight.float().reshape(weight.shape[0], -1, group) @ h.T).reshape(weight.shape)+ scale = w.abs().amax(dim = 1, keepdim = True).clamp_min(1e-10) / 7.0+ q = torch.round(w / scale).clamp(-7, 7).to(torch.int32)+ packed = ((q[:, 0::2] & 0x0F) | ((q[:, 1::2] & 0x0F) << 4)).to(torch.int8)+ return packed, scale.reshape(-1), q.to(torch.int8)+++def test_convrot_w4a4_loads_as_int8_convrot(tmp_path):+ weight = torch.randn(16, 512)+ packed, scale, codes = _w4a4(weight)+ path = _save(+ tmp_path / "w4.safetensors",+ {+ "a.weight": packed,+ "a.weight_scale": scale,+ "a.comfy_quant": _conf(+ format = "convrot_w4a4", convrot_groupsize = 256, linear_dtype = "int4"+ ),+ },+ )+ scan = cq.scan_comfy_quant(path)+ assert scan.problems == []+ layer = scan.layers["a"]+ assert (layer.format, layer.convrot, layer.group, layer.packed_int4) == (+ "int8_tensorwise",+ True,+ 256,+ True,+ )+ unpacked = cq.unpack_int4_rows(packed)+ assert torch.equal(unpacked, codes)+ restored = cq._dequant(unpacked, scale, 256, torch.float32)+ # int4 rounding error only: at most half a step per element, in the rotated basis.+ assert (restored - weight).abs().max() <= scale.max() * 0.5 * 16**0.5 + 1e-5+ assert cq.comfy_quant_error(scan) is None+++def test_convrot_w4a4_refuses_a_malformed_layer(tmp_path):+ path = _save(+ tmp_path / "bad.safetensors",+ {+ "a.weight": torch.zeros(+ 8, 100, dtype = torch.int8+ ), # K = 200: not a multiple of the group+ "a.weight_scale": torch.ones(8),+ "a.comfy_quant": _conf(format = "convrot_w4a4", convrot_groupsize = 256),+ },+ )+ with pytest.raises(ValueError, match = "not divisible by ConvRot group 256"):+ cq.refuse_comfy_quant(path)+++def test_declarations_without_the_container_prefix_match_their_weights(tmp_path):+ w8 = torch.ones(8, 512, dtype = torch.int8)+ path = _save(+ tmp_path / "p.safetensors",+ {+ "model.diffusion_model.a.weight": w8,+ "model.diffusion_model.a.weight_scale": torch.ones(8, 1),+ "a.comfy_quant": _conf(format = "int8_tensorwise", convrot = True, convrot_groupsize = 256),+ },+ )+ scan = cq.scan_comfy_quant(path)+ assert scan.problems == []+ assert list(scan.layers) == ["model.diffusion_model.a"]+++def _anima_state(prefix: str, blocks: int = 2) -> dict:+ t = lambda *s: torch.zeros(*s) # noqa: E731+ state = {+ f"{prefix}x_embedder.proj.1.weight": t(4, 68),+ f"{prefix}t_embedder.1.linear_1.weight": t(4, 4),+ f"{prefix}t_embedding_norm.weight": t(4),+ f"{prefix}final_layer.linear.weight": t(4, 4),+ f"{prefix}llm_adapter.embed.weight": t(8, 4),+ f"{prefix}llm_adapter.blocks.0.self_attn.q_proj.weight": t(4, 4),+ f"{prefix}pos_embedder.dim_spatial_range": t(1),+ }+ for i in range(blocks):+ state[f"{prefix}blocks.{i}.self_attn.q_proj.weight"] = t(4, 4)+ state[f"{prefix}blocks.{i}.mlp.layer1.weight"] = t(4, 4)+ return state++[email protected]("prefix", ["net.", "model.diffusion_model.", "diffusion_model."])+def test_anima_file_splits_into_transformer_and_text_conditioner(prefix):+ pytest.importorskip("diffusers")+ from core.inference.diffusion_anima import _block_count, split_anima_checkpoint++ transformer, adapter = split_anima_checkpoint(_anima_state(prefix, blocks = 3))+ assert sorted(adapter) == ["blocks.0.self_attn.q_proj.weight", "embed.weight"]+ assert "transformer_blocks.2.attn1.to_q.weight" in transformer+ assert "transformer_blocks.0.ff.net.0.proj.weight" in transformer+ assert "patch_embed.proj.weight" in transformer+ assert not any("pos_embedder" in k or "llm_adapter" in k for k in transformer)+ assert _block_count(transformer) == 3+++def test_anima_refuses_a_quantized_or_adapterless_file():+ pytest.importorskip("diffusers")+ from core.inference.diffusion_anima import split_anima_checkpoint++ state = _anima_state("net.")+ with pytest.raises(ValueError, match = "ComfyUI-quantised"):+ split_anima_checkpoint(+ {**state, "net.blocks.0.self_attn.q_proj.weight_scale": torch.ones(1)}+ )+ with pytest.raises(ValueError, match = "no llm_adapter"):+ split_anima_checkpoint({k: v for k, v in state.items() if "llm_adapter" not in k})+++# diffusers -> Cosmos-Predict2 names: diffusers' converter renames, undone in reverse order.+_TO_COSMOS = (+ ("proj_out", "final_layer.linear"),+ ("norm_out.linear_2", "final_layer.adaln_modulation.2"),+ ("norm_out.linear_1", "final_layer.adaln_modulation.1"),+ ("patch_embed.proj", "x_embedder.proj.1"),+ ("ff.net.2", "mlp.layer2"),+ ("ff.net.0.proj", "mlp.layer1"),+ ("norm_k", "k_norm"),+ ("norm_q", "q_norm"),+ ("to_out.0", "output_proj"),+ ("to_v", "v_proj"),+ ("to_k", "k_proj"),+ ("to_q", "q_proj"),+ ("attn2", "cross_attn"),+ ("attn1", "self_attn"),+ ("norm3.linear_2", "adaln_modulation_mlp.2"),+ ("norm3.linear_1", "adaln_modulation_mlp.1"),+ ("norm2.linear_2", "adaln_modulation_cross_attn.2"),+ ("norm2.linear_1", "adaln_modulation_cross_attn.1"),+ ("norm1.linear_2", "adaln_modulation_self_attn.2"),+ ("norm1.linear_1", "adaln_modulation_self_attn.1"),+ ("transformer_blocks", "blocks"),+ ("time_embed.norm", "t_embedding_norm"),+ ("time_embed.t_embedder", "t_embedder.1"),+)+++def _tiny_anima(tmp_path):+ from diffusers import AnimaTextConditioner, CosmosTransformer3DModel++ torch.manual_seed(0)+ transformer = CosmosTransformer3DModel(+ in_channels = 4,+ out_channels = 4,+ num_attention_heads = 2,+ attention_head_dim = 16,+ num_layers = 2,+ mlp_ratio = 2.0,+ text_embed_dim = 16,+ adaln_lora_dim = 4,+ max_size = (2, 8, 8),+ patch_size = (1, 2, 2),+ rope_scale = (1.0, 1.0, 1.0),+ concat_padding_mask = True,+ extra_pos_embed_type = None,+ )+ conditioner = AnimaTextConditioner(+ source_dim = 16,+ target_dim = 16,+ model_dim = 16,+ num_layers = 1,+ num_attention_heads = 2,+ target_vocab_size = 32,+ min_sequence_length = 8,+ )+ base = tmp_path / "base"+ transformer.save_config(base / "transformer")+ conditioner.save_config(base / "text_conditioner")+ return str(base), transformer, conditioner+++def _comfy_layout(transformer, conditioner) -> dict:+ state = {}+ for key, value in transformer.state_dict().items():+ for new, old in _TO_COSMOS:+ key = key.replace(new, old)+ state["net." + key] = value+ for key, value in conditioner.state_dict().items():+ state["net.llm_adapter." + key] = value+ state["net.pos_embedder.seq"] = torch.zeros(1)+ return state+++def test_anima_single_file_loads_on_meta_and_matches_its_weights(tmp_path, monkeypatch):+ pytest.importorskip("diffusers")+ import core.inference.diffusion_single_file_converters as converters+ from core.inference.diffusion_anima import load_anima_single_file, split_anima_checkpoint++ base, transformer, conditioner = _tiny_anima(tmp_path)+ comfy = _comfy_layout(transformer, conditioner)+ assert set(split_anima_checkpoint(dict(comfy))[0]) == set(transformer.state_dict())+ path = _save(tmp_path / "anima.safetensors", comfy)++ init_devices = set()+ reset = torch.nn.Linear.reset_parameters++ def _reset(self):+ init_devices.add(self.weight.device.type)+ return reset(self)++ charged = []+ monkeypatch.setattr(torch.nn.Linear, "reset_parameters", _reset)+ monkeypatch.setattr(converters, "charge_host_ram", charged.append)+ loaded, loaded_conditioner = load_anima_single_file(+ path, base, torch.bfloat16, local_files_only = True+ )+ assert init_devices == {"meta"}+ assert sum(charged) == 2 * sum(v.numel() for k, v in comfy.items() if "pos_embedder" not in k)+ for model, ref in ((loaded, transformer), (loaded_conditioner, conditioner)):+ assert not model.training+ got = model.state_dict()+ assert set(got) == set(ref.state_dict())+ for key, value in ref.state_dict().items():+ assert got[key].dtype == torch.bfloat16+ assert torch.equal(got[key], value.to(torch.bfloat16)), key+ for (name, buf), (_, ref_buf) in zip(+ loaded_conditioner.named_buffers(), conditioner.named_buffers()+ ):+ assert buf.dtype == ref_buf.dtype and torch.equal(buf, ref_buf), name+++class _AnimaScheduler:+ def step(+ self,+ noise_pred,+ t,+ latents,+ return_dict = False,+ ):+ return (latents + 1,)+++class _AnimaModular:+ def __init__(self):+ self.scheduler = _AnimaScheduler()+ self.transformer = None++ def __call__(+ self,+ output = None,+ **kwargs,+ ):+ latents = 0+ for i in range(kwargs["num_inference_steps"]):+ latents = self.scheduler.step(None, 1000 - i, latents)[0]+ return [f"img:{kwargs['prompt']}"] * kwargs["num_images_per_prompt"]+++def test_every_anima_render_frees_the_offload_hooks():+ # diffusers' contract for enable_model_cpu_offload: else the VAE stays on the GPU into the next image.+ from core.inference.diffusion_anima import _AnimaPipelineMixin++ class Face(_AnimaPipelineMixin):+ def __init__(self):+ self._interrupt = False+ self.mp = _AnimaModular()+ self.freed = 0++ def modular_pipeline(self):+ return self.mp++ def _set_guidance(self, mp, guidance_scale):+ pass++ def maybe_free_model_hooks(self):+ self.freed += 1++ def interrupt(pipe, i, t, kwargs):+ pipe._interrupt = True+ return kwargs++ face = Face()+ assert face(prompt = "a", num_inference_steps = 2).images == ["img:a"]+ assert face.freed == 1+ assert face(prompt = "a", num_inference_steps = 3, callback_on_step_end = interrupt).images == []+ assert face.freed == 2+++def test_every_anima_image_is_its_own_generation_chunk():+ from core.inference.diffusion import _generation_chunks+ from core.inference.diffusion_families import detect_family++ jobs = [("a", 1), ("a", 2), ("b", 3)]+ assert _generation_chunks(detect_family("", override = "anima"), jobs, 1) == [[j] for j in jobs]+++def _shapes(keys) -> dict:+ return {k: [4, 4] for k in keys}+++def test_headers_name_anima_chroma_and_moss():+ from core.inference.diffusion_content import classify_tensors++ anima = classify_tensors(_shapes(_anima_state("net.")))+ assert (anima.family, anima.layout) == ("anima", "comfy")+ civitai_anima = classify_tensors(_shapes(_anima_state("model.diffusion_model.")))+ assert civitai_anima.family == "anima"+ chroma = classify_tensors(+ _shapes(+ [+ "double_blocks.0.img_attn.qkv.weight",+ "single_blocks.0.linear1.weight",+ "distilled_guidance_layer.in_proj.weight",+ "img_in.weight",+ "txt_in.weight",+ "final_layer.linear.weight",+ ]+ )+ )+ assert (chroma.family, chroma.layout) == ("chroma", "comfy")+ radiance = classify_tensors(+ _shapes(+ [+ "double_blocks.0.img_attn.qkv.weight",+ "single_blocks.0.linear1.weight",+ "distilled_guidance_layer.in_proj.weight",+ "nerf_image_embedder.embedder.0.weight",+ ]+ )+ )+ assert radiance.family is None+ moss = classify_tensors(+ _shapes(+ [+ "model.diffusion_model.layers.0.proj.qkv.weight",+ "model.diffusion_model.text_embedder.proj.weight",+ "model.diffusion_model.shared_block_modulation.weight",+ "model.diffusion_model.video_embedder.weight",+ "model.diffusion_model.video_head_modulation.weight",+ ]+ )+ )+ assert moss.family == "moss-image"+++def test_moss_converter_splits_fused_qkv_and_rebuilds_rope_bands():+ from core.inference.diffusion_single_file_converters import moss_image_checkpoint_to_diffusers++ qkv = torch.arange(9 * 2, dtype = torch.float32).reshape(9, 2)+ out = moss_image_checkpoint_to_diffusers(+ checkpoint = {+ "model.diffusion_model.layers.0.proj.qkv.weight": qkv,+ "model.diffusion_model.layers.0.proj.o.weight": torch.ones(3, 3),+ "model.diffusion_model.layers.0.comfy_attention.config": torch.zeros(+ 3, dtype = torch.uint8+ ),+ },+ config = {"dim": 3072, "num_heads": 24, "rope_base": 10000.0},+ )+ assert torch.equal(out["layers.0.proj.q.weight"], qkv[:3])+ assert torch.equal(out["layers.0.proj.v.weight"], qkv[6:])+ assert "layers.0.proj.o.weight" in out+ assert not any("comfy_attention" in k for k in out)+ bands = 3072 // 24 // 8+ expected = 1 / (10000.0 ** (torch.arange(bands, dtype = torch.float32) / bands))+ assert torch.allclose(out["rope.bands"], expected)+++def test_family_entries():+ from core.inference.diffusion_families import default_generation_params, detect_family++ chroma = detect_family("", override = "chroma")+ assert chroma.pipeline_class == "ChromaPipeline"+ assert chroma.comfy_flow_shift == 1.0+ assert dict(chroma.scheduler_overrides) == {"use_beta_sigmas": True}+ assert {"fp8", "int8", "nvfp4", "mxfp8"} <= chroma.profile.scheme_deny+ anima = detect_family("", override = "anima")+ assert anima.pipeline_class == "AnimaModularPipeline"+ assert default_generation_params("oneObsession_anima29BV2.safetensors", anima.base_repo) == (+ 30,+ 4.0,+ )+ # "anima" is a substring of Animagine XL, an SDXL checkpoint: its defaults stay SDXL's.+ assert default_generation_params(+ "animagineXL40_v4Opt.safetensors", "stabilityai/stable-diffusion-xl-base-1.0"+ ) == (25, 7.0)+++def test_a_local_anima_load_gets_the_anima_defaults():+ from core.inference.diffusion import _generation_defaults_for+ from core.inference.diffusion_families import detect_family++ anima = detect_family("", override = "anima")+ local = "/models/Anima-Base-v1.0-Diffusers"+ expected = {"steps": 30, "guidance": 4.0}+ assert _generation_defaults_for(local, None, local, family = anima) == expected+ assert (+ _generation_defaults_for("/models/comfy", "anima-v1.safetensors", local, family = anima)+ == expected+ )+ sdxl = detect_family("", override = "sdxl")+ assert _generation_defaults_for(+ "/models/sdxl",+ "animagineXL40_v4Opt.safetensors",+ "stabilityai/stable-diffusion-xl-base-1.0",+ family = sdxl,+ ) == {"steps": 25, "guidance": 7.0}+++def test_the_comfy_schedule_switches_to_beta_sigmas_unless_opted_out(monkeypatch):+ pytest.importorskip("diffusers")+ pytest.importorskip("scipy") # diffusers' beta sigmas need it+ from diffusers import FlowMatchEulerDiscreteScheduler++ from core.inference.diffusion_flow_shift import COMFY_SIGMAS_ENV, apply_comfy_schedule++ def schedule():+ pipe = type("P", (), {})()+ pipe.scheduler = FlowMatchEulerDiscreteScheduler(shift = 3.0)+ changed = apply_comfy_schedule(pipe, 1.0, (("use_beta_sigmas", True),))+ return changed, pipe.scheduler.config.shift, pipe.scheduler.config.use_beta_sigmas++ assert schedule() == (True, 1.0, True)+ monkeypatch.setenv(COMFY_SIGMAS_ENV, "0")+ assert schedule() == (False, 3.0, False)+++def test_krea2_pipeline_takes_a_supplied_vae():+ import inspect++ from core.inference.diffusion_krea2 import load_krea2_pipeline+ assert "vae" in inspect.signature(load_krea2_pipeline).parameters+++def test_qwen3_5_text_encoder_is_classified_and_fits_moss():+ from core.inference.diffusion_comfy_components import TE_KIND_CLASSES, classify_text_encoder++ keys = [+ "model.language_model.layers.0.linear_attn.in_proj_qkv.weight",+ "model.language_model.layers.3.self_attn.q_norm.weight",+ "model.visual.blocks.0.attn.qkv.weight",+ "lm_head.weight",+ ]+ assert classify_text_encoder(keys) == "qwen3_5"+ assert "Qwen3_5Model" in TE_KIND_CLASSES["qwen3_5"]+ assert classify_text_encoder(+ ["model.layers.0.self_attn.q_proj.weight", "visual.blocks.0.attn.qkv.weight"]+ ) == ("qwen2_5_vl")+++def test_moss_pipeline_takes_a_supplied_vae():+ pytest.importorskip("diffusers")+ import inspect++ from core.inference.diffusion_moss_image import load_moss_image_pipeline++ assert "vae" in inspect.signature(load_moss_image_pipeline).parameters+++def test_a_supplied_moss_vae_keeps_its_fp32_weights(tmp_path):+ pytest.importorskip("diffusers")+ from diffusers import AutoencoderKLFlux2++ from core.inference.diffusion_comfy_components import (+ ComponentFileRef,+ ComponentOverrides,+ load_override_modules,+ )++ torch.manual_seed(0)+ reference = AutoencoderKLFlux2(+ block_out_channels = (32, 32),+ down_block_types = ("DownEncoderBlock2D",) * 2,+ up_block_types = ("UpDecoderBlock2D",) * 2,+ layers_per_block = 1,+ latent_channels = 4,+ norm_num_groups = 8,+ )+ reference.save_config(tmp_path / "base" / "vae")+ path = _save(tmp_path / "vae.safetensors", reference.state_dict())++ def built(family):+ overrides = ComponentOverrides(+ files = {"vae": ComponentFileRef(spec = path, local_path = path)},+ paths = {"vae": path},+ classes = {"vae": "AutoencoderKLFlux2"},+ )+ modules = load_override_modules(+ overrides,+ base = str(tmp_path / "base"),+ dtype = torch.bfloat16,+ family = family,+ local_files_only = True,+ )+ return modules["vae"].state_dict()++ moss = built("moss-image")+ for key, value in reference.state_dict().items():+ assert moss[key].dtype == value.dtype and torch.equal(moss[key], value), key+ other = built("krea-2")+ assert other["decoder.conv_out.weight"].dtype == torch.bfloat16+++def test_anima_gguf_is_neither_offered_nor_loaded():+ from core.inference.diffusion import DiffusionBackend+ from core.inference.diffusion_families import detect_family, family_gguf_loadable+ from hub.utils.comfy_models import _single_file_loadable++ anima = detect_family("", override = "anima")+ assert not family_gguf_loadable(anima)+ assert not _single_file_loadable(anima, None, "anima-base-v1.0-Q8_0.gguf")+ assert _single_file_loadable(anima, None, "anima-base-v1.0.safetensors")+ with pytest.raises(ValueError, match = "GGUF files are not supported"):+ DiffusionBackend().validate_load_request(+ "someone/Anima-Base-GGUF", gguf_filename = "anima-base-v1.0-Q8_0.gguf", model_kind = "gguf"+ )+ assert family_gguf_loadable(detect_family("", override = "chroma"))+++def test_an_anima_single_file_takes_only_configs_for_what_it_carries(tmp_path):+ from core.inference.diffusion import DiffusionBackend, _single_file_components+ from core.inference.diffusion_anima import ANIMA_COMPONENT_FOLDERS+ from core.inference.diffusion_families import detect_family++ anima = detect_family("", override = "anima")+ assert _single_file_components(anima, "single_file") == ("text_conditioner",)+ assert _single_file_components(anima, "pipeline") == ()+ assert _single_file_components(detect_family("", override = "krea-2"), "single_file") == ()+ base = tmp_path / "base"+ index = {"_class_name": "AnimaModularPipeline", "_blocks_class_name": "AnimaAutoBlocks"}+ for name, (folder, lib, cls) in ANIMA_COMPONENT_FOLDERS.items():+ (base / folder).mkdir(parents = True)+ index[name] = [lib, cls, {"subfolder": folder, "type_hint": [lib, cls]}]+ if "tokenizer" in name:+ (base / folder / "tokenizer.json").write_text("{}")+ (base / folder / "tokenizer_config.json").write_text("{}")+ elif name == "scheduler":+ (base / folder / "scheduler_config.json").write_text("{}")+ else:+ (base / folder / "config.json").write_text("{}")+ for folder in ("text_encoder", "vae"):+ (base / folder / "model.safetensors").write_bytes(b"\0" * 16)+ (base / "modular_model_index.json").write_text(json.dumps(index))+ files = tmp_path / "files"+ files.mkdir()+ (files / "anima.safetensors").write_bytes(b"\0" * 16)+ DiffusionBackend().validate_load_request(+ str(files),+ gguf_filename = "anima.safetensors",+ family_override = "anima",+ model_kind = "single_file",+ base_repo = str(base),+ )diff --git a/studio/backend/tests/test_diffusion_comfy_quant.py b/studio/backend/tests/test_diffusion_comfy_quant.pyindex e122388c19a..abd20ad0cfc 100644--- a/studio/backend/tests/test_diffusion_comfy_quant.py+++ b/studio/backend/tests/test_diffusion_comfy_quant.py@@ -93,7 +93,7 @@ def test_unsupported_formats_are_refused_by_name(tmp_path, fmt):def test_header_quantization_metadata_is_read_and_refused(tmp_path):"""Comfy-Org files declare formats only in the header, with no per-layer tensors."""- meta = {cq.QUANT_METADATA_KEY: json.dumps({"layers": {"a": {"format": "convrot_w4a4"}}})}+ meta = {cq.QUANT_METADATA_KEY: json.dumps({"layers": {"a": {"format": "asym_w4a8_int8"}}})}path = _save(tmp_path / "m.safetensors",{@@ -106,7 +106,7 @@ def test_header_quantization_metadata_is_read_and_refused(tmp_path):)scan = cq.scan_comfy_quant(path)assert scan is not None and not scan.layers- with pytest.raises(ValueError, match = "'convrot_w4a4'"):+ with pytest.raises(ValueError, match = "'asym_w4a8_int8'"):cq.refuse_comfy_quant(path)diff --git a/studio/backend/tests/test_diffusion_image_te_default.py b/studio/backend/tests/test_diffusion_image_te_default.pyindex 6cad97a90a6..66dc820e74e 100644--- a/studio/backend/tests/test_diffusion_image_te_default.py+++ b/studio/backend/tests/test_diffusion_image_te_default.py@@ -54,7 +54,17 @@ EXPECTED = {}# Measured and deliberately left on the bf16 encoder by default: a small encoder (about 5B or less) stays bf16 unless# ComfyUI's template quantizes it (FLUX.1's T5, Z-Image, Lumina-2, klein), and HiDream / Ideogram 4 missed the bar.-KEEP_BF16 = ("flux.1", "z-image", "lumina-2", "flux.2-klein", "hidream-i1", "ideogram-4", "sdxl")+KEEP_BF16 = (+ "flux.1",+ "z-image",+ "lumina-2",+ "flux.2-klein",+ "hidream-i1",+ "ideogram-4",+ "sdxl",+ "chroma",+ "anima",+)def _fam(name):diff --git a/studio/backend/tests/test_diffusion_moss_image.py b/studio/backend/tests/test_diffusion_moss_image.pyindex d13181df0b4..e924cf50bef 100644--- a/studio/backend/tests/test_diffusion_moss_image.py+++ b/studio/backend/tests/test_diffusion_moss_image.py@@ -721,5 +721,6 @@ def test_loader_records_the_checkpoint_and_diffusion_passes_the_base_repo(moss):source = (_BACKEND / "core" / "inference" / "diffusion.py").read_text(encoding = "utf-8")calls = source.split("load_moss_image_pipeline(")[1:]calls = [c for c in calls if "dtype" in c.split(")")[0] or "dtype," in c[:200]]- assert len(calls) == 2- assert all("checkpoint = base," in c[:900] for c in calls)+ # Full pipeline, single-file and pre-quantized assemblies.+ assert len(calls) == 3+ assert all("checkpoint = base," in c[:1600] for c in calls)diff --git a/studio/backend/tests/test_diffusion_offline_source.py b/studio/backend/tests/test_diffusion_offline_source.pyindex fef7619e61f..645b7433f47 100644--- a/studio/backend/tests/test_diffusion_offline_source.py+++ b/studio/backend/tests/test_diffusion_offline_source.py@@ -241,3 +241,17 @@ def test_a_downloaded_krea_tokenizer_really_loads_offline(monkeypatch, tmp_path,_live_cache(monkeypatch, tmp_path)tokenizer = diffusion_krea2.load_krea2_tokenizer(REPO, local_files_only = True)assert tokenizer("hello world")["input_ids"] == [1, 2]+++def test_the_anima_tokenizers_really_load_offline(monkeypatch, tmp_path, online):+ pytest.importorskip("transformers")+ from transformers import AutoTokenizer++ from core.inference import diffusion_anima++ snapshot = _fake_cache(tmp_path, subfolders = ("tokenizer", "t5_tokenizer"))+ common = {"local_files_only": True, "cache_dir": str(tmp_path)}+ for subfolder in ("tokenizer", "t5_tokenizer"):+ _write_real_tokenizer(snapshot / subfolder)+ tokenizer = diffusion_anima._load_tokenizer(AutoTokenizer, REPO, subfolder, common)+ assert tokenizer("hello world")["input_ids"] == [1, 2]diff --git a/studio/backend/tests/test_diffusion_shift_override.py b/studio/backend/tests/test_diffusion_shift_override.pyindex 87ed0afcb0d..68502f5f6b0 100644--- a/studio/backend/tests/test_diffusion_shift_override.py+++ b/studio/backend/tests/test_diffusion_shift_override.py@@ -61,7 +61,9 @@ EXPECTED_NODES = {"hunyuanimage-2.1": SHIFT_NODE_SD3,"hidream-i1": SHIFT_NODE_SD3,"moss-image": SHIFT_NODE_SD3,- # Not offered: Ideogram 4 runs its own mu/std preset, SDXL is not flow matching.+ "chroma": SHIFT_NODE_SD3, # the template's ModelSamplingAuraFlow is the same time_snr_shift+ # Not offered: Ideogram 4 runs its own mu/std preset, SDXL is not flow matching, Anima keeps its shift 3.+ "anima": None,"ideogram-4": None,"sdxl": None,}diff --git a/studio/backend/tests/test_image_fetch_ids_unsloth.py b/studio/backend/tests/test_image_fetch_ids_unsloth.pyindex 05ef10f714d..0466cc4a89a 100644--- a/studio/backend/tests/test_image_fetch_ids_unsloth.py+++ b/studio/backend/tests/test_image_fetch_ids_unsloth.py@@ -28,12 +28,17 @@ from core.inference.diffusion_families import (upstream_is_gated,)-# The ONLY vendor repos an image load may still fetch, each with the licence clause that forbids a mirror.+# Vendor repos an image load may still fetch because a licence clause forbids a mirror._LICENCE_BLOCKED: dict[str, str] = {# Tencent Hunyuan Community License: "Territory" means the worldwide territory, excluding the territory of the# European Union, United Kingdom and South Korea. A public Hub mirror cannot honour a territorial limit."hunyuanvideo-community/hunyuanimage-2.1-diffusers": "territory-restricted licence",}+# Bases fetched from upstream because no unsloth mirror of them is made.+_UNMIRRORED: dict[str, str] = {+ "lodestones/chroma1-hd": "Chroma",+ "circlestone-labs/anima-base-v1.0-diffusers": "Anima",+}# Third-party DENOISER artifacts the catalog still offers. Not a companion fetch and not licence-blocked: there is# simply no unsloth GGUF of FLUX.1 Krea dev yet. Its companions already come from unsloth/FLUX.1-Krea-dev.@@ -121,7 +126,8 @@ def _fetch_id(repo: str) -> str:def _allowed(repo: str) -> bool:if _is_comfy(repo):return False- return repo.lower().startswith("unsloth/") or repo.lower() in _LICENCE_BLOCKED+ r = repo.lower()+ return r.startswith("unsloth/") or r in _LICENCE_BLOCKED or r in _UNMIRROREDdef _family_fetch_ids() -> list[tuple[str, str, str, str]]:@@ -283,6 +289,9 @@ def test_licence_allowlist_is_still_needed():for repo in _LICENCE_BLOCKED:assert repo in ids, f"{repo} is no longer fetched; drop it from _LICENCE_BLOCKED"assert mirror_repo(repo) is None, f"{repo} is mirrored now; drop it from _LICENCE_BLOCKED"+ for repo in _UNMIRRORED:+ assert repo in ids, f"{repo} is no longer fetched; drop it from _UNMIRRORED"+ assert mirror_repo(repo) is None, f"{repo} is mirrored now; drop it from _UNMIRRORED"rows = {r.lower() for _h, r in _catalog_rows()}for repo in _THIRD_PARTY_DENOISER_ROWS:assert (diff --git a/studio/backend/tests/test_sd_cpp_moss_image.py b/studio/backend/tests/test_sd_cpp_moss_image.pyindex 35c46ccc98a..2cc18282aee 100644--- a/studio/backend/tests/test_sd_cpp_moss_image.py+++ b/studio/backend/tests/test_sd_cpp_moss_image.py@@ -208,20 +208,21 @@ def test_the_route_validation_passes_a_gguf_native_can_take(monkeypatch, tmp_patassert r.family_buildable_here(fam, model_kind = "pipeline") == r.family_pipeline_available(fam)-def test_diffusers_refuses_a_moss_single_file_transformer(monkeypatch, tmp_path):+def test_diffusers_takes_a_moss_safetensors_single_file(monkeypatch, tmp_path):from core.inference.diffusion import DiffusionBackend- # Even with a capable native build: sd.cpp takes only the GGUF, so a loose transformer file has no engine._set_device(monkeypatch, "cuda")_set_runnable(monkeypatch)_set_binary(monkeypatch, _binary(tmp_path, "sd-cli", marker = True))- with pytest.raises(ValueError, match = "single-file transformer only on the native"):- DiffusionBackend().validate_load_request(- _REPO, gguf_filename = "MOSS-Image-SFT-INT8.safetensors", model_kind = "single_file"- )+ fam = DiffusionBackend().validate_load_request(+ _REPO, gguf_filename = "MOSS-Image-SFT-INT8.safetensors", model_kind = "single_file"+ )+ assert fam.name == "moss-image"-def test_a_loose_moss_safetensors_is_not_offered():+def test_a_loose_moss_safetensors_is_offered():from hub.utils.comfy_models import _single_file_loadable- assert not _single_file_loadable(_moss(), None, "MOSS-Image-SFT-INT8.safetensors")++ assert _single_file_loadable(_moss(), None, "MOSS-Image-SFT-INT8.safetensors")+ assert not _single_file_loadable(_moss(), None, "MOSS-Image-SFT-Q4_K_M.gguf")assert _single_file_loadable(detect_family("z-image"), None, "z_image_turbo_bf16.safetensors")