You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking for the purpose of the PAG adaptive scale? Because I was passing a value in it, for example 5.0, and passing 3.0 in the PAG scale, according to the implemented code we will have a negative number and the scale will return 0 and the PAG will not be applied and I did not find an explanation about this parameter in the documentation.
So i found it on an ComfyUI documentation: "This dampening factor reduces the effect of PAG during the later stages of the denoising process, speeding up the overall sampling. A value of 0.0 means no penalty, while 1.0 completely removes PAG"
Then I realized that I was passing values above 1.0, however when I pass values of 0.2 it is enough for it not to apply the PAG. I suspect this could be a problem.
If you run the code below, you will see that in the third image where I pass a scale of 0.2 in adaptive_scale it practically invalidates the PAG in the first generation steps.
And inside every PAG pipeline, we need change "t" variable for "i" variable is passed with param on this function, to receive the number of current step.
With this, the logic will not be that the higher the adaptive scale value, the faster the PAG will be disabled, but quite the opposite. The scale will tell you exactly at what point in the process the PAG will be disabled. If the scale exceeds 0.5 in a 30-step generation, the PAG will be disabled from step 15 onwards. The scale applied will be the same until the moment of the cut and will not be a variable scale.
I don't know if this was the original purpose of this parameter, but it works well for me.
Describe the bug
I am looking for the purpose of the PAG adaptive scale? Because I was passing a value in it, for example 5.0, and passing 3.0 in the PAG scale, according to the implemented code we will have a negative number and the scale will return 0 and the PAG will not be applied and I did not find an explanation about this parameter in the documentation.
So i found it on an ComfyUI documentation: "This dampening factor reduces the effect of PAG during the later stages of the denoising process, speeding up the overall sampling. A value of 0.0 means no penalty, while 1.0 completely removes PAG"
Then I realized that I was passing values above 1.0, however when I pass values of 0.2 it is enough for it not to apply the PAG. I suspect this could be a problem.
If you run the code below, you will see that in the third image where I pass a scale of 0.2 in adaptive_scale it practically invalidates the PAG in the first generation steps.
I propose a possible solution:
After this code:
diffusers/src/diffusers/pipelines/pag/pag_utils.py
Line 93 in 5c94937
We can change for:
And inside every PAG pipeline, we need change "t" variable for "i" variable is passed with param on this function, to receive the number of current step.
diffusers/src/diffusers/pipelines/pag/pipeline_pag_sd_xl.py
Line 1253 in 5c94937
With this, the logic will not be that the higher the adaptive scale value, the faster the PAG will be disabled, but quite the opposite. The scale will tell you exactly at what point in the process the PAG will be disabled. If the scale exceeds 0.5 in a 30-step generation, the PAG will be disabled from step 15 onwards. The scale applied will be the same until the moment of the cut and will not be a variable scale.
I don't know if this was the original purpose of this parameter, but it works well for me.
Reproduction
Logs
System Info
Who can help?
@yiyixuxu , @asomoza
The text was updated successfully, but these errors were encountered: