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

issue: scheulder overriding (AYS) #207

Closed
ltdrdata opened this issue Jun 19, 2024 · 7 comments
Closed

issue: scheulder overriding (AYS) #207

ltdrdata opened this issue Jun 19, 2024 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ltdrdata
Copy link

samplers.SCHEDULER_NAMES = samplers.SCHEDULER_NAMES + ["AYS SD1", "AYS SDXL", "AYS SVD"]

The calculate_sigmas function should only be overridden when TSC_KSampler is called. Overriding the scheduler globally will cause issues for users who select AYS and call KSampler.

@ltdrdata ltdrdata changed the title issue: scheulder overriding issue: scheulder overriding (AYS) Jun 19, 2024
@brayevalerien
Copy link

Indeed, I came to report that. When running the default workflow, changing the scheduler to AYS SD1 raises the following issue:

Error occurred when executing KSampler:

local variable 'sigmas' referenced before assignment

File "C:\...\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\...\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\...\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\...\ComfyUI\nodes.py", line 1371, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "C:\...\ComfyUI\nodes.py", line 1341, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "C:\...\ComfyUI\comfy\sample.py", line 41, in sample
sampler = comfy.samplers.KSampler(model, steps=steps, device=model.load_device, sampler=sampler_name, scheduler=scheduler, denoise=denoise, model_options=model.model_options)
File "C:\...\ComfyUI\comfy\samplers.py", line 744, in __init__
self.set_steps(steps, denoise)
File "C:\...\ComfyUI\comfy\samplers.py", line 765, in set_steps
self.sigmas = self.calculate_sigmas(steps).to(self.device)
File "C:\...\ComfyUI\comfy\samplers.py", line 756, in calculate_sigmas
sigmas = calculate_sigmas(self.model.get_model_object("model_sampling"), self.scheduler, steps)
File "C:\...\ComfyUI\comfy\samplers.py", line 717, in calculate_sigmas
return sigmas

@jags111 jags111 self-assigned this Jun 22, 2024
@jags111 jags111 added the documentation Improvements or additions to documentation label Jun 22, 2024
@jags111
Copy link
Owner

jags111 commented Jun 22, 2024

sure and thanks on the update and repairing same.

@jags111
Copy link
Owner

jags111 commented Jun 22, 2024

@ltdrdata Any specific recommendation on the code changes and would be happy to implement same in the samplers.

@tchesket
Copy link

Same issue

@ltdrdata
Copy link
Author

I submitted a PR for this issue.

@jags111
Copy link
Owner

jags111 commented Jun 23, 2024

thanks a lot

@jags111
Copy link
Owner

jags111 commented Jun 23, 2024

completed the change and updated the patch. thanks a lot for this support.

@jags111 jags111 closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants