Archived
krea2: rebalance presets balanced, detail and subtle at the taps' measured RMS
`rebalance` takes a preset's name beside true/false: "balanced", "detail" and "subtle" are comfyui-krea2-conditioning's presets with renormalize on at multiplier 1, "legacy" is true (ConditioningKrea2Rebalance's defaults, about 9x the taps' RMS). The node renormalises by s = sqrt(sum m_t / sum w_t^2 m_t) per prompt, m_t tap t's mean square; the plugin holds s as a constant per preset, m_t averaged over twenty prompts through krea/Krea-2-Turbo's text encoder (scripts/krea2_rebalance_calib.py: balanced 0.44109, detail 0.35702, subtle 0.84759; per prompt s stayed within 1.7 % of it). The gains are fixed per tap, so the presets reuse #187's chan_affine into te.h2 with their own `mul`, one declared op per preset and tap. The preset rides in RAD_GEN_COND_REBALANCE_PRESET, bits 8 to 15 of cond_opts beside RAD_GEN_COND_REBALANCE, which a plugin declares when it has presets; the driver accepts both bits, and the server refuses a preset's name on a model whose rebalance declares none. A row the plugin does not know scales nothing. Enum values only, so no ABI bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6efffe2a59
commit
aa5dfaec19
9 files changed
+252
-47
No files matched your search
+4
-3
@@ -119,10 +119,11 @@ int Driver::init(const Program& prog, IKVManager* kv, const std::vector<RankIO>&
|
||||
kv_ = kv;
|
||||
ranks_ = ranks;
|
||||
table_ = DiscreteTable{};
|
||||
if (decl_.cond_opts & ~(uint32_t)RAD_GEN_COND_REBALANCE) {
|
||||
if (decl_.cond_opts & ~(uint32_t)(RAD_GEN_COND_REBALANCE | RAD_GEN_COND_REBALANCE_PRESET)) {
|
||||
RAD_ERR("image generator: '%s' declares conditioning options 0x%x, and this engine knows "
|
||||
"only RAD_GEN_COND_REBALANCE (0x%x)", decl_.name ? decl_.name : "",
|
||||
(unsigned)decl_.cond_opts, (unsigned)RAD_GEN_COND_REBALANCE);
|
||||
"only RAD_GEN_COND_REBALANCE (0x%x) and its preset (0x%x)",
|
||||
decl_.name ? decl_.name : "", (unsigned)decl_.cond_opts, (unsigned)RAD_GEN_COND_REBALANCE,
|
||||
(unsigned)RAD_GEN_COND_REBALANCE_PRESET);
|
||||
return RAD_E_UNSUPPORTED;
|
||||
}
|
||||
if (discrete()) {
|
||||
|
||||
Reference in new issue
Block a user