Acly / krita-ai-diffusion

Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required.
https://www.interstice.cloud
GNU General Public License v3.0
6.91k stars 339 forks source link

Bug: ZSNR applied to all vpred models #1108

Open PseudoChmod opened 2 months ago

PseudoChmod commented 2 months ago

The way the extension's config settings work enables Zero Terminal SNR in the generated ComfyUI workflow when a model is marked as using vpred. The problem is that not all vpred models use zsnr (such as EasyFluff v11.2 and its many merges) and using it on those burns/artifacts the output. A hacky solution I found was to edit workflow.py so that the generated ModelSamplingDiscrete node has zsnr disabled:

    if checkpoint.v_prediction_zsnr:
        model = w.model_sampling_discrete(model, "v_prediction", zsnr=False)
        model = w.rescale_cfg(model, 0.7)

Ideally adding another setting beneath vpred to enable/disable zsnr in the model config would be best. It should be enabled by default to leave default configs untouched and have a disclaimer to disable it if images have noticeable warping and/or AI artifacting.