krita-ai-diffusion icon indicating copy to clipboard operation
krita-ai-diffusion copied to clipboard

Bug: ZSNR applied to all vpred models

Open PseudoChmod opened this issue 1 year ago • 0 comments

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.

PseudoChmod avatar Aug 24 '24 15:08 PseudoChmod