Skip to content

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