mcmonkeyprojects / sd-dynamic-thresholding

Dynamic Thresholding (CFG Scale Fix) for Stable Diffusion (eSwarmUI, ComfyUI, and Auto WebUI)
MIT License
1.1k stars 103 forks source link

When used with ComfyUI's smZNodes custom node produces noisy images. #81

Closed toyxyz closed 10 months ago

toyxyz commented 10 months ago

I used smZNodes custom node in Comfyui to get the same result as A1111 webui. However, when I used it with dynamic-thresholding, it produced a noisy image unlike the webui.

smZNodes : https://github.com/shiimizu/ComfyUI_smZNodes#smznodes ComfyUI workflow : test.json

image workflow (28)

mcmonkey4eva commented 10 months ago

Does this only happen with smZNodes -- by which I mean, if you replace those to the standard cliptextencode nodes, does it work normally?

toyxyz commented 10 months ago

Does this only happen with smZNodes -- by which I mean, if you replace those to the standard cliptextencode nodes, does it work normally?

In my tests, the results are different from the webui even when using the standard cliptextencode. In webui, the lighting is generally smoother, but in ComfyUI it seems to be darker or noisier. Could this be due to an update to ComfyUI's sampler?

image

Noise is more visible when using a higher CFG (standard cliptextencode)

image image

mcmonkey4eva commented 10 months ago

After some investigating, I've realized that ComfyUI actually processes sampling in a fundamentally different way than autowebui does (Auto uses the Denoised conditioning, Comfy uses the Predicted Noise).

So in effect right now the comfy node for dynthresh is operating in reverse of what it should be. (I... should have tested more carefully when I first published the comfy version. Eck.)

I'm at a bit of a loss for how to correct for that within ComfyUI, so I've reached out to comfy himself to ask for help on that.

mcmonkey4eva commented 10 months ago

Comfy updated the code to fix the core issue -- https://github.com/comfyanonymous/ComfyUI/commit/1777b54d0217e77a6a64b0a587b9b11a48e3bf02 so if you update Comfy and try again, it should work?

Let me know if anything's still different from expected results.

toyxyz commented 10 months ago

Comfy updated the code to fix the core issue -- comfyanonymous/ComfyUI@1777b54 so if you update Comfy and try again, it should work?

Let me know if anything's still different from expected results.

Thank you! it's working now. image