Skip to content

reference-image editing now works after the decode-only VAE fix #123

Description

@khcd

a small issue while using ConfigBuilder::ref_images(...) for reference-only editing (FLUX.2-klein): a request with ref_images but no init_img loaded a decode-only VAE, so stable-diffusion.cpp aborted when it tried to encode the reference:

vae.hpp:719: GGML_ASSERT(!decode_only || decode_graph) failed
The cause was that gen_img_maybe_progress in src/api.rs chose decode-only based solely on init_img:

let is_decode_only = !has_init_image && config.ref_images.is_empty();

Including ref_images in that check fixes it since Config.ref_images is already wired through to the native params.

Appreciate the library. Close this once read.

System apple silicon. AI was used to track down the exact issue when I ran into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions