Commit a7dcb11
committed
feat(api): expose sampler_mode and 4 DiT params on /release_task HTTP API
Five GenerationParams fields that were only accessible via Gradio's
direct Python path are now accepted by the /release_task HTTP endpoint:
- sampler_mode: "euler" (default) or "heun" sampler selection
- velocity_norm_threshold: velocity prediction norm clamping (0=off)
- velocity_ema_factor: velocity EMA smoothing (0=off)
- latent_shift: additive shift on DiT latents before VAE decode
- latent_rescale: multiplicative rescale on DiT latents before VAE decode
All five already exist on the internal GenerationParams dataclass and
are wired through the diffusion loop. This change adds them to:
- GenerateMusicRequest (Pydantic request model)
- PARAM_ALIASES (camelCase alias support)
- build_generate_music_request (request builder)
- build_generation_setup (GenerationParams wiring)
Default values match the existing GenerationParams defaults, so
omitting them preserves current behavior. Non-target code paths
(Gradio UI, training, CLI) are unchanged.1 parent 82252c2 commit a7dcb11
4 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
| |||
0 commit comments