Conversation
| if (sd_version_is_inpaint(sd_ctx->sd->version)) { | ||
| latents.denoise_mask = std::move(latent_mask); |
There was a problem hiding this comment.
I believe it should be if (!sd_version_is_inpaint(sd_ctx->sd->version)) here instead, Otherwise inpainting with non-inpaint models becomes impossible, and it adds some slight artifacts to the outputs of inpaint models (#1357 will hopefully fix that once I'm done rebasing it on the new codebase)
There was a problem hiding this comment.
If we change it this way, the inpaint model won’t be able to apply the mask. Perhaps we should always use a denoise mask whenever a mask image is specified.
There was a problem hiding this comment.
The inpaint models have access to the mask via the concat_latent.
Without the denoise_mask , the inpaint models are still able to keep the unmasked area approximately intact, but there can be some slight color shift. With the denoise_mask, there can be some more or less noricable artifacts near the edges of the masked areas. When I first implemented inpainting I concluded that it was overall perferable to have sometimes some color shifting across all the image rather than artifacts.
In #1357 I found a way to deal with the artifats (by inflating the denoise_mask by 1 latent pixel) so Inpaint models can use both the concat_latent and denoise_mask and get rid of the color shift.
No description provided.