Skip to content

Commit 333f6ed

Browse files
committed
CoxXL edit: fix reference image embeddings
1 parent 733fafe commit 333f6ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stable-diffusion.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,12 @@ sd_image_t* img2img(sd_ctx_t* sd_ctx,
18401840
} else if (sd_version_is_edit(sd_ctx->sd->version)) {
18411841
// Not actually masked, we're just highjacking the masked_latent variable since it will be used the same way
18421842
if (!sd_ctx->sd->use_tiny_autoencoder) {
1843-
masked_latent = sd_ctx->sd->get_first_stage_encoding_mode(work_ctx, init_moments);
1843+
if (sd_ctx->sd->is_using_edm_v_parameterization) {
1844+
// for CosXL edit
1845+
masked_latent = sd_ctx->sd->get_first_stage_encoding(work_ctx, init_moments);
1846+
} else {
1847+
masked_latent = sd_ctx->sd->get_first_stage_encoding_mode(work_ctx, init_moments);
1848+
}
18441849
} else {
18451850
masked_latent = init_latent;
18461851
}

0 commit comments

Comments
 (0)