"""Wan-specific subclass of Any4DConfig.

The base ``Any4DConfig`` carries EDM-style defaults (``val_sigma_max=80``,
``val_sigma_min=0.002``, ``val_cfg_scale=0.0``) that are correct for the
original ``Any4DModel`` (Cosmos / EDM forward process) but produce
out-of-distribution input on the very first sampling step when handed to
Wan's flow-match scheduler (which lives in ``s ∈ [0, 1]``).

``Any4DWanConfig`` simply overrides those three defaults with Wan-correct
values, so callers using the Wan backbone don't need to remember to stamp
them at runtime. Per-experiment / per-CLI overrides still flow through
because they are passed in via ``__init__`` kwargs.
"""

import attrs

from custom.any4d.a4d_config import Any4DConfig


# ``Any4DConfig`` is an ``@attrs.define`` class. Without decorating the
# subclass, attrs uses the *parent's* registered field defaults at __init__
# time, and our class-level overrides below get silently shadowed by the
# instance attributes attrs writes from the parent's defaults. Decorating
# here re-runs attrs field collection so the new defaults stick.
@attrs.define(slots=False)
class Any4DWanConfig(Any4DConfig):
    """Drop-in replacement for ``Any4DConfig`` when using ``Any4DWanModel``.

    Overrides only the inference σ / CFG defaults. All other fields keep
    their parent values; the user-facing API is identical so existing
    experiment configs and CLI flags work unchanged.
    """

    val_sigma_max: float = 1.0
    val_sigma_min: float = 0.003
    val_cfg_scale: float = 5.0
