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

Resetting variables whenever a new prompt is sampled. #96

Open
adieyal opened this issue Aug 19, 2023 · 0 comments
Open

Resetting variables whenever a new prompt is sampled. #96

adieyal opened this issue Aug 19, 2023 · 0 comments

Comments

@adieyal
Copy link
Owner

adieyal commented Aug 19, 2023

This relates to this issue: adieyal/sd-dynamic-prompts#517

Here is the relevant code:
https://github.com/adieyal/dynamicprompts/blob/main/src/dynamicprompts/samplers/base.py#L71-L75

    def _get_sequence(
        self,
        command: SequenceCommand,
        context: SamplingContext,
    ) -> StringGen:
        tokens, context = context.process_variable_assignments(command.tokens)
        sub_generators = [context.generator_from_command(c) for c in tokens]


        while True:
            yield rotate_and_join(sub_generators, separator=command.separator)

variable_assignment takes place outside of the while loop. Without creating the sub_generators, I'm not sure how to make this work. Any suggestions? @akx

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

1 participant