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

Connecting the sampler_name, scheduler_name and model_name nodes to KSampler throws errors. #20

Open
sawasy opened this issue Mar 11, 2024 · 2 comments

Comments

@sawasy
Copy link

sawasy commented Mar 11, 2024

Return type mismatch between linked nodes: sampler_name, ['euler', 'euler_ancestral', 'heun', 'heunpp2', 'dpm_2', 'dpm_2_ancestral', 'lms', 'dpm_fast', 'dpm_adaptive', 'dpmpp_2s_ancestral', 'dpmpp_sde', 'dpmpp_sde_gpu', 'dpmpp_2m', 'dpmpp_2m_sde', 'dpmpp_2m_sde_gpu', 'dpmpp_3m_sde', 'dpmpp_3m_sde_gpu', 'ddpm', 'lcm', 'ddim', 'uni_pc', 'uni_pc_bh2'] != COMBO

This is the same with scheduler_name and model_name nodes.

m!

@water2891
Copy link

water2891 commented Apr 20, 2024

Referring to my code below, modify the nodes.py file. sampler_name, scheduler_name can be modified like this

class SamplerSelector:
    CATEGORY = 'ImageSaver/utils'
    RETURN_TYPES = ("COMBO",)    # <--fix here
    RETURN_NAMES = ("sampler_name",)
    FUNCTION = "get_names"

    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {"sampler_name": (comfy.samplers.KSampler.SAMPLERS,)}}

    def get_names(self, sampler_name):
        return ([sampler_name],)    # <--and here: return an array

@darkpixel
Copy link

There appears to be a bit more to this.

If I connect it to KSampler, select "Auto Queue" in Comfy, and then click "Queue Prompt" it works and it works forever apparently.

But the moment I don't have "Auto Queue" enabled, and I click "Queue Prompt" multiple times...then it throws the error.

There's some sort of validation that happens when you queue up multiple runs that doesn't happen when there's only one item in the queue at a time.

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