• Stefy Lanza (nextime / spora )'s avatar
    let two configs share one image checkpoint (v0.4.97) · 2b96373b
    Stefy Lanza (nextime / spora ) authored
    set_image_model keys config by path:
    
        self.config[f"image:{model_name}"] = config or {}
    
    so a second image_models entry for the same checkpoint overwrote the first and
    said nothing. Two configs of one checkpoint is not an odd thing to want -- the
    same base served with a different transformer, quantization or step count --
    and text models have supported it for a long time, addressing the second under
    its alias and skipping an unaliased duplicate with a message. Image models had
    none of that.
    
    The symptom is worse than losing an entry, because nothing looks lost: both
    entries still appear in /v1/models and both register their aliases, so a
    request for EITHER is answered with whichever config was registered last.
    Found while testing two configs of Qwen-Image-Edit-2511, one with a GGUF
    transformer and one with a fine-tuned transformer quantized at load: a request
    for the GGUF config was served by the 4-bit one, and the only clue was
    "Registered image model: Qwen/Qwen-Image-Edit-2511" appearing twice in the
    startup log.
    
    So the image path now does what the text path does: a sibling sharing a
    checkpoint is registered under its alias, which gives it a config key of its
    own, and is NOT aliased back to the shared path -- that mapping is what
    collapses the two again. An unaliased duplicate is skipped with the same
    explanation text models give.
    
    `path` now travels in every image config, because a sibling is addressed by an
    alias and an alias is not something from_pretrained can open: the config has to
    be able to say which checkpoint it is a config OF. _load_diffusers_pipeline
    prefers it when it differs from the name it was called with, and for a primary
    entry the two are the same string.
    
    Needs a restart to take effect, registration being a startup act: a collision
    that has already happened cannot be undone in the running process's config
    dict.
    
    Full suite 4558 passed with the same 15 pre-existing failures as 0.4.91 (diff
    empty).
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01S8LAP3ueNzQJtwzhgVbq66
    2b96373b
main.py 82.7 KB