-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Display improvements to PNG Info tab #16415
base: dev
Are you sure you want to change the base?
Display improvements to PNG Info tab #16415
Conversation
Text on PNG Info tab is parsed and colorized in a way that makes it easier to read. Parameter values can be copied by clicking on them. - High performance regex used for parsing - Normal values are displayed in blue, but string content is displayed in orange to improve readability (i.e. adetailer prompts) - Clicking to copy uses a pointer cursor and a green color animation to show something is happening - Color choices configured differently for dark mode in order to optimize readability - Copying strings with \n automatically converts to newlines during copy operation - Settings that don't follow normal conventions are not parsed, but displayed in the old style (i.e. dynamic prompt templates) - If there are parsing issues (or exceptions), defaults to the old display mode
Lint run against python and javascript
@w-e-w , thank you for taking the time to review my PR. I fixed the problem with no negative prompt. I like the idea of adding a way to copy text, but want to make sure I understand the problem you are describing. I copied the entire text manually and I think the newlines make the info text more readable, and so are beneficial. What do you mean by "it can also cause certain syntax to break"? Thanks! |
- Handled no negative prompt scenario - Include new lines in positive/negative prompts - Added links to the top to copy png info sections (all/positive/negative/settings)
readable does not mean that it's "the same" if someone has an extension that adds extra scripting functionality to prompts input, then for there syntex newline could have special meanings, so adding a extra newline could potentially break ther syntax or change the output there are other use cases that are very sensitive to minor changes |
@w-e-w , I followed your suggestion and added some links to copy text. The "All" button copies text that should be identical to the previous manual copy. Please let me know if this works? Thanks again! |
found a rather hilarious issue 2024-08-25.07_11_47_017.chrome.mp4once the copy button is clicked, it flashes every time you switch to the tab |
@w-e-w thank you, that's a good catch. I'll see if I can fix it. |
@w-e-w fixed it! Thanks again. Really appreciate that you are finding these issues. |
All to Copy Positive to Prompt
@w-e-w , renamed some of the quick links to make it more obvious what is going on. Finished with all changes, now. |
Description
PNG Info tab text display currently looks like a big block of text, which makes it hard to find specific settings, and is a pain when you are trying to copy a setting. This improvement parses PNG Info settings and displays them in a format that makes it easier to read, and also allows a setting to be copied to the clipboard with a simple click.
Features
Code changes
** Non-standard settings identified by a newline outside of quotes, using dynamic prompts as a reference
** Utilized existing formatting methods when possible
** Introduced for formatting, copy to clipboard, and copy animations
** Preserved existing formatting when there is a parsing error
** No changes to plain text format returned by method
** Uses existing CSS variables whenever possible
** Support for dark mode
** Uses @Keyframes animation
** Copies element text to clipboard
** Starts copy animation
Passed python and javascript linting. Passed test process.
Checklist: