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

scripting sampler test? #38

Closed
kalkal11 opened this issue Aug 31, 2022 · 3 comments
Closed

scripting sampler test? #38

kalkal11 opened this issue Aug 31, 2022 · 3 comments

Comments

@kalkal11
Copy link

image

I'm attempting to modify the sampler/scale script to make something that outputs the example image above, but it's crashing when I try to run it.

For the few it does work on, it's unclear which sampler is which, would anyone be able to help please? -

steps = [20,40,80,120,240]
sampler_index= [4,5,6,7]

def cell(x, y, p=p):
	p.steps = x
	p.sampler_index = y
	return process_images(p).images[0]

images = [draw_xy_grid(
	xs = steps,
	ys = sampler_index,
	x_label = lambda x: f'Steps = {x}',
	y_label = lambda y: f'CFG = {y}',
	cell = cell
)]

save_image(images[0], 'test/gnomeplot', 'gnome6')
display(images)
@AUTOMATIC1111
Copy link
Owner

if the program is crashing you must post a stack trace for me to help.

Ultimately if you want to use scripting to interact with the main program, you need to read the main program.

Samplers are in the global variable samplers:

steps = [2,4,8,12]
sampler_index= [4,5,6,7]
#alternatively:
#sampler_index = [i for i, x in enumerate(samplers) if x.name in ['Euler a', 'Euler', 'LMS']]

def cell(x, y, p=p):
	p.steps = x
	p.sampler_index = y
	return process_images(p).images[0]

images = [draw_xy_grid(
	xs = steps,
	ys = sampler_index,
	x_label = lambda x: f'Steps = {x}',
	y_label = lambda y: f'Sampler = {samplers[y].name}',
	cell = cell
)]

save_image(images[0], 'test/asdf', 'asdf')
display(images)

asdf

Actually no need for crash log. I broke PLMS. It was crashing when you used PLMS.

@orionaskatu
Copy link
Contributor

image

I'm attempting to modify the sampler/scale script to make something that outputs the example image above, but it's crashing when I try to run it.

For the few it does work on, it's unclear which sampler is which, would anyone be able to help please? -

steps = [20,40,80,120,240]
sampler_index= [4,5,6,7]

def cell(x, y, p=p):
	p.steps = x
	p.sampler_index = y
	return process_images(p).images[0]

images = [draw_xy_grid(
	xs = steps,
	ys = sampler_index,
	x_label = lambda x: f'Steps = {x}',
	y_label = lambda y: f'CFG = {y}',
	cell = cell
)]

save_image(images[0], 'test/gnomeplot', 'gnome6')
display(images)

If you need a quick reference, the actual order is :

0 : Euler Ancestral
1 : Euler
2 : LMS
3 : Heun
4 : DPM2
5 : DPM2 Ancestral
6 : DDIM
7 : PLMS

@kalkal11
Copy link
Author

kalkal11 commented Aug 31, 2022

if the program is crashing you must post a stack trace for me to help.

Ultimately if you want to use scripting to interact with the main program, you need to read the main program.

Samplers are in the global variable samplers:

steps = [2,4,8,12]
sampler_index= [4,5,6,7]
#alternatively:
#sampler_index = [i for i, x in enumerate(samplers) if x.name in ['Euler a', 'Euler', 'LMS']]

def cell(x, y, p=p):
	p.steps = x
	p.sampler_index = y
	return process_images(p).images[0]

images = [draw_xy_grid(
	xs = steps,
	ys = sampler_index,
	x_label = lambda x: f'Steps = {x}',
	y_label = lambda y: f'Sampler = {samplers[y].name}',
	cell = cell
)]

save_image(images[0], 'test/asdf', 'asdf')
display(images)

asdf

Actually no need for crash log. I broke PLMS. It was crashing when you used PLMS.

Not being a coder myself (in the slightest) it's a miracle that I got as far as I did but your example is exactly what I wanted so thank you so much.

vt-idiot pushed a commit to vt-idiot/stable-diffusion-webui that referenced this issue May 16, 2023
cabelo pushed a commit to cabelo/stable-diffusion-webui that referenced this issue Nov 29, 2023
…ip/gitpython-3.1.34

Bump gitpython from 3.1.32 to 3.1.34
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

3 participants