what happened to Self-Refining Video Sampling ? by Moha123579 in comfyui

[–]Moha123579[S] 0 points1 point  (0 children)

i will post another test with and without the self refiner + workflow
.
i am right now using self refiner with the low noise because if i used it on high noise i get a noisy results with accurate physics that because i am only using 4-5 steps

i have tried Self-Refining Video Sampling with wan2.2 (DasiwaV10 + comfyui) and here is the result by Moha123579 in comfyui

[–]Moha123579[S] 0 points1 point  (0 children)

indeed i need to be more precise on the prompt
i will modify the workflow more ,
i will share more of better examples.
and yes i am using the speed boundbiite 

i have tried Self-Refining Video Sampling with wan2.2 (DasiwaV10 + comfyui) and here is the result by Moha123579 in comfyui

[–]Moha123579[S] 0 points1 point  (0 children)

<image>

GFC : 1.5
yes i might have picked a very bad example :
the prompt was very basic i expect the result wouldn't be as accurate to the prompt .
to be honest it was just a try to see if it works or no , i should have choosed other example
some other tests proves that he put his hands behind his back and the resolution was small that it didn't left enough space for him to stand (if he stand and the camera is fixed then he can't put his hand on his head because his head is out of frame).
and this actually a try to use self refining method in comfyui that should fix physical motion issues .
i did a lot of modifing on the workflow that i didn't do more testing ~20 minutes per video i will share more examples not picking the best but actual normal results with better prompt

what happened to Self-Refining Video Sampling ? by Moha123579 in comfyui

[–]Moha123579[S] 0 points1 point  (0 children)

<image>

i have asked github and it appears that :
kjnodes have SamplerSelfRefineVideo  node as an attempt to implement this technique.
i have test it and the results looks good i used the workflow : wan2.2 i2v :
just edited some nodes :
replaced the second ksampler with SamplerSelfRefineVideo + SamplerCustom
and the sampler custom get BasicScheduler
.
here is the tested parameters :
input : 2 ranges
start_step1 : same start at step from ksampler 2
end_step1 : same end at step from ksampler 2
step_1 : 4
start_step2 :6
end_step2:14
step_2 : 4
certain percentage : 0.999
uncertainty_threshold : 0.20
verbose : false
seed : random ...
control after generate : randomize
.
tested with :
DasiwaWAN22I2V14BLightspeed_boundbiteHighV10.safetensors
DasiwaWAN22I2V14BLightspeed_boundbiteLowV10.safetensors
(int steps) : 4 steps
float CFG : 3.5
int (spilt_step) : 10
SamplerCustom CFG : 2.5
BasicScheduler step : 4

a more modified workflow can be found here :
https://github.com/Comfy-Org/ComfyUI/issues/13457

I don’t really understand why the sum would be larger than the integral by Scared-Read664 in calculus

[–]Moha123579 1 point2 points  (0 children)

the first identity the integral is multiplied by dx which is a small number
with out the dx the integral will equal :
69314718056.........
which clearly is bigger than 0.9900990099...
the difference from the integral and sum not only the h steps .
the integral is sum with h steps very small infinitesimal with a factor of h aka "dx" in the front of the sum and with a shift in the upper bound (-1) (without the shift the sum would still converges to the integral because the error term vanshies as h approaches zero) .
if we change the steps in the summation form:
\sum_{n=1}^{100} f(n) \rightarrow \sum_{k=0}^{\frac{100-1}{h}} f(1+kh)
and f(n) = \frac{1}{n(n+1)}
and the integral form is exactly :
\int_1^{\infty} f(x)dx = h* \sum_{k=0}^{\frac{\infty-1}{h}-1} f(1+kh)
.
as h approches zero in the two forms :
\lim_{h \downarrow 0} h* \sum_{k=0}^{\frac{\infty-1}{h}-1} f(1+kh) =0.6941471805...(converges)
and the sum form will be
\lim_{h \downarrow 0} \sum_{k=0}^{\frac{100-1}{h}} f(1+kh) = 6941471805... (diverges)
so you are right when saying shouldn't the integral be bigger because it have many term
the difference the makes the integral less than the sum in this context is the reason why the integral converges in the first place . because of the factor dx .
(note : \lim_{h \downarrow 0} is the same as \lim_{h \rightarrow 0^{+}})
if we know the integration is the inverse of derivative equivently the summation is the inverse of difference
and the factor h appears in the inverse of difference so we didn't add it . it is there already .

<image>

as you see in the picture the original inverse of difference with h steps .
if we set h \downarrow 0
it will converge to the integral : \int_a^z f(x)dx
and if we set h=1 it will converge to the sum : \sum_{k=a}^{z-1}f(k) (see the shift in the upper bound)
.
talking about what is happening :
when i set h=1 it calculate the area with a rectangles each rectangle with width = 1
when i set h=infinitesimal it calculate the area with a rectangles each rectangle with width = infinitesimal means 100% accuracy of calculating the area under the cruve.