Give Krea-2-Raw its undistilled 52-step recipe instead of the distilled default
Krea-2-Raw is in _TRUSTED_NON_GGUF_REPOS, so it is inference-loadable, but the generic "krea" generation-defaults key matched it too and applied Turbo's distilled 8-step / no-CFG recipe, producing degraded output on the undistilled base. Add a more specific krea-2-raw key (52 steps, guidance 3.5 per the model card) ahead of the generic one, in both the backend table and the frontend MODEL_DEFAULTS so the Studio UI and the OpenAI images route agree.
This commit is contained in:
parent
2d974219bf
commit
9ab68825ee
3 changed files with 16 additions and 7 deletions
|
|
@ -461,9 +461,13 @@ def resolve_base_repo(fam: DiffusionFamily, base_repo: Optional[str]) -> str:
|
|||
# (studio/frontend/src/features/images/images-page.tsx); keep the two in sync.
|
||||
_GENERATION_DEFAULTS: tuple[tuple[str, int, float], ...] = (
|
||||
("z-image-turbo", 9, 0.0),
|
||||
# Krea 2 Turbo is distilled (TDM): 8 steps, no CFG -- matching the Create UI seed, so
|
||||
# the OpenAI /v1/images/generations route uses the documented recipe instead of falling
|
||||
# through to the generic (9, 0.0). "krea" collides with no other model id.
|
||||
# Krea 2 Raw is the undistilled base (both Turbo and Raw are in _TRUSTED_NON_GGUF_REPOS, so
|
||||
# either is inference-loadable): its model card runs 52 steps at guidance 3.5. It must precede
|
||||
# the generic "krea" key, or the distilled recipe below would degrade a Raw load to garbage.
|
||||
("krea-2-raw", 52, 3.5),
|
||||
# Krea 2 Turbo is distilled (TDM): 8 steps, no CFG -- matching the Create UI seed, so the
|
||||
# OpenAI /v1/images/generations route uses the documented recipe instead of falling through
|
||||
# to the generic (9, 0.0). "krea" then covers Turbo and any other krea id but Raw (above).
|
||||
("krea", 8, 0.0),
|
||||
("flux.1-schnell", 4, 0.0),
|
||||
# Kontext (editing) before the generic flux.1: ~28 steps, lower guidance (~2.5).
|
||||
|
|
|
|||
|
|
@ -155,9 +155,10 @@ def test_krea2_family_wiring():
|
|||
assert fam.deploy_base_repo == "krea/Krea-2-Turbo"
|
||||
# The OpenAI /v1/images/generations route reads (steps, guidance) from this table; Krea
|
||||
# Turbo is distilled (8 steps, no CFG), matching the Create UI seed instead of the
|
||||
# generic (9, 0.0) fallback.
|
||||
# generic (9, 0.0) fallback. Raw is the undistilled base (also inference-loadable) and runs
|
||||
# its full 52-step / CFG 3.5 recipe, so its more specific key must win over the "krea" one.
|
||||
assert default_generation_params("krea/Krea-2-Turbo") == (8, 0.0)
|
||||
assert default_generation_params("krea/Krea-2-Raw") == (8, 0.0)
|
||||
assert default_generation_params("krea/Krea-2-Raw") == (52, 3.5)
|
||||
|
||||
|
||||
# ── training wiring ──────────────────────────────────────────────────────────
|
||||
|
|
|
|||
|
|
@ -211,8 +211,12 @@ const DEFAULT_GEN = { steps: 9, guidance: 0 };
|
|||
|
||||
const MODEL_DEFAULTS: Array<{ match: string; steps: number; guidance: number }> = [
|
||||
{ match: "z-image-turbo", steps: 9, guidance: 0 },
|
||||
// Krea 2 Turbo is distilled (TDM): 8 steps, no CFG (the base/midtrain checkpoints
|
||||
// would want ~28 steps + CFG 4.5, but only Turbo is curated today).
|
||||
// Krea 2 Raw is the undistilled base (also inference-loadable): its card runs 52 steps at
|
||||
// guidance 3.5, so it must precede the distilled "krea-2" key below or a Raw load would run
|
||||
// the 8-step recipe and produce garbage.
|
||||
{ match: "krea-2-raw", steps: 52, guidance: 3.5 },
|
||||
// Krea 2 Turbo is distilled (TDM): 8 steps, no CFG. "krea-2" then covers Turbo (and any
|
||||
// other krea id) but Raw, which is matched more specifically above.
|
||||
{ match: "krea-2", steps: 8, guidance: 0 },
|
||||
{ match: "flux.1-schnell", steps: 4, guidance: 0 },
|
||||
// Kontext (editing) before the generic flux.1: ~28 steps, lower guidance (~2.5).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue