Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

similar samplers #1

Open
Krek12 opened this issue Oct 7, 2024 · 19 comments
Open

similar samplers #1

Krek12 opened this issue Oct 7, 2024 · 19 comments

Comments

@Krek12
Copy link

Krek12 commented Oct 7, 2024

Can you add samplers from this repository?

Judging by the name, this is the same sampler you added yesterday, plus a couple more with the same structure.
https://github.com/rabidcopy/Euler-Smea-Dyn-Sampler
rabidcopy/Euler-Smea-Dyn-Sampler@d78ff55

@DenOfEquity
Copy link
Owner

Not the same, though much of the code for these variants is the same.
Added implementations for Euler Dy CFG++ and Euler SMEA Dy CFG++. The rabidcopy implementation uses a method that I found didn't work with new Forge, so re-worked.
I won't copy over the other variants, you can install those from the original repo.

@Enferlain
Copy link

Enferlain commented Oct 10, 2024

Can you do the other 2 samplers from the euler-smea one? The negative dy one is one of the better ones from those imo. Also it would be nice to figure out the rest of the cfgpp stuff from comfy side. For the cond scale multiplier, like you said it could be put into the cfg_denoiser script or whatever its called, but I'm not sure about how it exactly needs to be, but that would let you still use any cfg since the scale would be adjusted on a per sampler basis as it is currently? As for the comfy versions, I'm not really sure how it works even though I tried to do the same thing in the forge scripts since a lot were already there

@DenOfEquity
Copy link
Owner

You can try the 'neg' branch. I'm not totally convinced of the value, so not in main branch (yet).
I think the cond-scale-multiplier is a mistake, it's a hidden factor that could easily result in guidance < 1, which is bad. CFG++ does want lower guidance, but it's better to get a feel for it yourself IMO. Also, models that work better with lower CFG may not need as big an adjustment. And it seems like there is value in combining with APG, where APG controls the too-high guidance.

@Enferlain
Copy link

Enferlain commented Oct 11, 2024

yeah not sure, it was from the ddim cfgpp implementation that was added to a1111 initially and that's how they did it there and it got moved over to forge as well (without the cfg denoiser modifications). figured it would be better to be able to use the scale normally with a multiplier instead of being restricted to sub 2 values but I wasn't able to test it out in the jerry rig I tried. didn't see the other branch, I'll try it later

@Enferlain
Copy link

yoinked these from @yoinked-h https://pastebin.com/nW2s2uKQ

also from comfy

def get_sigmas_vp(n, beta_d=19.9, beta_min=0.1, eps_s=1e-3, device='cpu'):
    """Constructs a continuous VP noise schedule."""
    t = torch.linspace(1, eps_s, n, device=device)
    sigmas = torch.sqrt(torch.exp(beta_d * t ** 2 / 2 + beta_min * t) - 1)
    return append_zero(sigmas)
def get_sigmas_laplace(n, sigma_min, sigma_max, mu=0., beta=0.5, device='cpu'):
    """Constructs the noise schedule proposed by Tiankai et al. (2024). """
    epsilon = 1e-5 # avoid log(0)
    x = torch.linspace(0, 1, n, device=device)
    clamp = lambda x: torch.clamp(x, min=sigma_min, max=sigma_max)
    lmb = mu - beta * torch.sign(0.5-x) * torch.log(1 - 2 * torch.abs(0.5-x) + epsilon)
    sigmas = clamp(torch.exp(lmb))
    return sigmas

just some stuff to look at

@yoinked-h
Copy link

cfgpp on a1111-like.... its over..... (cfgpp is not possible on a1111 without severe modifications)

@DenOfEquity
Copy link
Owner

Thanks for those.
get_sigmas_vp has been included in the webui source for a long time, but never available as an option
laplace seems worthwhile, perhaps a couple of the Karras variants too
neg branch updated

@Enferlain
Copy link

cfgpp on a1111-like.... its over..... (cfgpp is not possible on a1111 without severe modifications)

Why not help make it work 4head

@yoinked-h
Copy link

yoinked-h commented Oct 13, 2024

cfgpp on a1111-like.... its over..... (cfgpp is not possible on a1111 without severe modifications)

Why not help make it work 4head

id help but i dont work with much inference-side code, more so sampler-side

@Enferlain
Copy link

reforge does this too

image

@Enferlain
Copy link

Some samplers from clybius, haven't tried them though

https://github.com/Clybius/ComfyUI-Extra-Samplers

@DenOfEquity
Copy link
Owner

Refined Exponential Solver looks good from initial tests. TTM doesn't work for me, fails when JIT compiling. Haven't explored others yet.
Updated 'neg' branch with RES.
Any opinions on usefulness of the last set?

@Enferlain
Copy link

Enferlain commented Oct 26, 2024

image

Yeah I haven't checked, gonna try later res later but apparently these are good from what he said

Edit
Tried res today, was pretty good

@Krek12
Copy link
Author

Krek12 commented Oct 29, 2024

https://github.com/Kittensx/Simple_KES

new shedule

@Krek12
Copy link
Author

Krek12 commented Oct 30, 2024

https://github.com/Kittensx/Simple_KES

new shedule

has been tested and can be used

@DenOfEquity
Copy link
Owner

Wonderfully over-engineered way to generate a list of decreasing numbers.
I wonder if that's a college project that has requirements to do things in certain ways: config via YAML file with watcher, instead of using settings in webUI; install by patching webUI files instead of written as extension.
I'm not going to include it, because it looks to be under continued development and has requirements that I will not add (and I don't want to rewrite it).

@Krek12
Copy link
Author

Krek12 commented Nov 9, 2024

any idea how to work this 1111?
https://github.com/dfl/comfyui-tcd-scheduler

@DenOfEquity
Copy link
Owner

There's a webUI extension for TCD. I haven't tried it, looks like DDPM, so I tried that with TCD loras and it worked very well.
And I've read somewhere that the diffusers implementation of TCD is essentially DDPM sampler with DDIM scheduler.

@Krek12
Copy link
Author

Krek12 commented Nov 14, 2024

There's a webUI extension for TCD. I haven't tried it, looks like DDPM, so I tried that with TCD loras and it worked very well. And I've read somewhere that the diffusers implementation of TCD is essentially DDPM sampler with DDIM scheduler.

interesing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants