Skip to content

Commit 0bb0355

Browse files
committed
fix preview with unet inpaint models
1 parent fd9e5ee commit 0bb0355

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stable-diffusion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,9 @@ class StableDiffusionGGML {
817817

818818
} else if (dim == 4) {
819819
// 4 channels VAE
820-
if (version == VERSION_SDXL) {
820+
if (sd_version_is_sdxl(version)) {
821821
latent_rgb_proj = sdxl_latent_rgb_proj;
822-
} else if (version == VERSION_SD1 || version == VERSION_SD2) {
822+
} else if (sd_version_is_sd1(version) || sd_version_is_sd2(version)) {
823823
latent_rgb_proj = sd_latent_rgb_proj;
824824
} else {
825825
// unknown model
@@ -1676,7 +1676,7 @@ sd_image_t* txt2img(sd_ctx_t* sd_ctx,
16761676
if (sd_ctx->sd->stacked_id) {
16771677
params.mem_size += static_cast<size_t>(10 * 1024 * 1024); // 10 MB
16781678
}
1679-
if (preview_mode!=SD_PREVIEW_NONE && preview_mode!=SD_PREVIEW_PROJ) {
1679+
if (preview_mode != SD_PREVIEW_NONE && preview_mode != SD_PREVIEW_PROJ) {
16801680
params.mem_size *= 2;
16811681
}
16821682
params.mem_size += width * height * 3 * sizeof(float);

0 commit comments

Comments
 (0)