pamparamm / ComfyUI-ppm

Fixed AttentionCouple/NegPip(negative weights in prompts), more CFG++ samplers, etc.
GNU Affero General Public License v3.0
56 stars 4 forks source link

Different results with the integration of AYS vs the aligned scheduler #2

Closed Extraltodeus closed 2 months ago

Extraltodeus commented 2 months ago

Hello! :D

I was trying it all out and got surprised to notice that I would obtain completely different results with the schedulers.

Aligned scheduler:

01460UI_00001_

The implemented version:

01461UI_00001_

~Now I don't even know why because I went through the code and can't figure why~

So I check and graphed them both (second one is matching the AYS steps):

01480UI_00001_01481UI_00001_

And it seems that it's the call to the scheduler that makes the difference.

Original, right after the call to the simple scheduler:

14.614641189575195 6.318448543548584 3.768178939819336 2.181148052215576 1.340524435043335 0.8620721101760864 0.5550693273544312 0.37985408306121826 0.2332364171743393 0.11141882091760635 0.029167158529162407

the different result:

14.614641189575195 13.515695571899414 10.721358299255371 7.640371322631836 5.253568649291992 3.1917672157287598 1.956911325454712 1.2110940217971802 0.7460969090461731 0.46511557698249817 0.029167158529162407

Which, given the proximity of the two first steps, seems to be starting by the end of the scheduler.

So if here you replace:

    sigmas  = comfy.samplers.calculate_sigmas(model.get_model_object("model_sampling"), "simple", 1000)[indices]

by:

    sigmas = simple_scheduler(model_sampling, 1000).flip(dims=[0])[1:][indices].flip(dims=[0])

Sliced to ignore the comfy added zero.

It gives:

14.614641189575195 6.318448543548584 3.768178939819336 2.181148052215576 1.340524435043335 0.8620721101760864 0.5550693273544312 0.37985408306121826 0.2332364171743393 0.11141882091760635 0.029167158529162407

Which is exactly the same :)

I'm not making a PR since it is just a line and I suppose that you may want to write it in a more pythonic way.

Regards

pamparamm commented 2 months ago

Thanks! AYS and aligned scheduler node should produce same images now.