kandinsky6_sr ¶
Config of the Kandinsky6 SR latent-upscaler bank (latent_upscaler/config.json).
The component config is {"models": [{"target_scale": "4x" | "2x", "model": {...}}, ...], "scaling_factor": f}. Each model mapping describes one cascaded 2x+2x upsampler. Only the architecture of the released checkpoints is implemented, so every key that would select a different architecture must carry its released value; a value that is not supported raises a ValueError naming the key instead of silently building something else.
Classes¶
fastvideo.configs.models.upsamplers.kandinsky6_sr.Kandinsky6SRLatentUpscalerConfig dataclass ¶
Kandinsky6SRLatentUpscalerConfig(arch_config: ArchConfig = ArchConfig(), models: list[Kandinsky6SRLatentUpscalerEntryConfig] = list(), scaling_factor: float = 1.0, scales: tuple[int, ...] = (2, 4), *, _resolved_attention_backend: AttentionBackendEnum | None = None)
Bases: UpsamplerConfig
latent_upscaler/config.json: one entry per served scale, plus the VAE latent scaling_factor.
models accepts the raw config.json entries and is normalised to :class:Kandinsky6SRLatentUpscalerEntryConfig in __post_init__ (also re-run by update_model_config).
fastvideo.configs.models.upsamplers.kandinsky6_sr.Kandinsky6SRLatentUpscalerEntryConfig dataclass ¶
Kandinsky6SRLatentUpscalerEntryConfig(target_scale: int, in_channels: int, hidden_channels: int, stage_channels: tuple[int, int, int], num_pre_blocks: int, num_mid_blocks: int, num_post_blocks: int, expand_ratio: int, enable_x2_entry: bool = False, x2_adapter_blocks: int = 0)
One bank entry: a cascaded 2x+2x upsampler serving target_scale.
stage_channels are the widths at the 1x, 2x and 4x latent grids. With enable_x2_entry the entry also has a private x2 path (its own input stem, x2_adapter_blocks residual blocks at 1x, and private copies of the mid stage and second stage) that upsamples by 2 instead of 4.
Methods:¶
fastvideo.configs.models.upsamplers.kandinsky6_sr.Kandinsky6SRLatentUpscalerEntryConfig.from_dict classmethod ¶
from_dict(spec: Any, index: int = 0) -> Kandinsky6SRLatentUpscalerEntryConfig
Validate one models[index] entry of latent_upscaler/config.json.
Source code in fastvideo/configs/models/upsamplers/kandinsky6_sr.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |