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

fix for pnginfo_saver, when extension is disabled, #177 #648

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlUlkesh
Copy link

@AlUlkesh AlUlkesh commented Oct 2, 2023

There are cases when a Template and Negative Template line are added to the end of the pnginfo of a file. This breaks extensions that use the SendTo functionality (like PNG Info inside a1111 or the Image Browser extension).

This happens when Dynamic Prompts are installed, but not enabled.

The reason for this is, that the default here is True:

class PngInfoSaver:
    def __init__(self):
        self._enabled = True

But the following code exits the function before it can be set to its current False value:

        if not is_enabled:
            logger.debug("Dynamic prompts disabled - exiting")
            return p

        ignore_whitespace = opts.dp_ignore_whitespace

        self._pnginfo_saver.enabled = opts.dp_write_raw_template
        self._prompt_writer.enabled = opts.dp_write_prompts_to_file

This PR fixes that.

adieyal added a commit that referenced this pull request Nov 6, 2023
Ensure that callbacks (apart from settings and wildcards manager), only run when dynamic prompts is enabled. This builds on #648
adieyal added a commit that referenced this pull request Nov 8, 2023
Ensure that callbacks (apart from settings and wildcards manager), only run when dynamic prompts is enabled. This builds on #648
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

Successfully merging this pull request may close these issues.

1 participant