{"id":23177276,"url":"https://github.com/haoming02/sd-webui-prompt-format","last_synced_at":"2025-04-07T13:07:48.951Z","repository":{"id":161620750,"uuid":"636242187","full_name":"Haoming02/sd-webui-prompt-format","owner":"Haoming02","description":"An Extension for Automatic1111 Webui that helps cleaning up prompts","archived":false,"fork":false,"pushed_at":"2025-03-14T02:55:47.000Z","size":162,"stargazers_count":80,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T11:08:02.795Z","etag":null,"topics":["stable-diffusion-webui","stable-diffusion-webui-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Haoming02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-04T12:17:01.000Z","updated_at":"2025-03-21T05:00:12.000Z","dependencies_parsed_at":"2024-03-23T13:39:09.356Z","dependency_job_id":"2a0ce60b-8982-4484-a8a7-b7c4c57a1aa2","html_url":"https://github.com/Haoming02/sd-webui-prompt-format","commit_stats":{"total_commits":47,"total_committers":4,"mean_commits":11.75,"dds":0.1063829787234043,"last_synced_commit":"b32df6ecfcd4ce50b68c21fc3d1f551109b5e951"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-prompt-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-prompt-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-prompt-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-prompt-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Haoming02","download_url":"https://codeload.github.com/Haoming02/sd-webui-prompt-format/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["stable-diffusion-webui","stable-diffusion-webui-plugin"],"created_at":"2024-12-18T06:32:38.899Z","updated_at":"2025-04-07T13:07:48.925Z","avatar_url":"https://github.com/Haoming02.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# SD Webui Prompt Format\n[English|[中文](README_ZH.md)]\n\nThis is an Extension for the [Automatic1111 Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui), which helps formatting prompts.\n\n\u003e Also supports [SD.Next](https://github.com/vladmandic/automatic) and [Forge](https://github.com/lllyasviel/stable-diffusion-webui-forge) out of the box!\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"sample.jpg\" width=512\u003e\u003c/p\u003e\n\nSometimes, when you type too fast or copy prompts from all over the places, you end up with duplicated **spaces** or **commas**. This simple Extension helps removing them whenever you click **Generate**.\n\n## Features\n- [x] Works in both `txt2img` and `img2img`\n- [x] Works in both `Positive` and `Negative`, as well as `Hires. fix` prompts\n- [x] Remove extra **spaces** and **commas**\n- [x] Fix misplaced **brackets** and **commas**\n- [x] Enable `Remove Duplicates` to remove identical tags found in the prompts\n  - **Note:** Only works for tag-based prompt, not sentence-based prompt\n    - **eg.** `1girl, solo, smile, 1girl` will become `1girl, solo, smile`\n    - **eg.** `a girl smiling, a girl standing` will not be changed\n- [x] Enable `Remove Underscores` to replace `_` with `space`\n- [x] Respect line breaks\n  - `Remove Duplicates` only checks within the same line\n- [x] Append a comma before a line break\n- [x] Toggle between auto formatting and manual formatting\n  - In `Auto` mode: The process is ran whenever you click on **Generate**\n  - In `Manual` mode: The process is only ran when you click the **Format** button\n- [x] **New:** Trigger the formatting on the pasted text\n- [x] Toggle whether the above features are enabled / disabled by default in the `Prompt Format` section under the \u003cins\u003eSystem\u003c/ins\u003e category of the **Settings** tab\n- [x] Pressing `Alt` + `Shift` + `F` can also trigger formatting\n- [x] Assign \"[alias](#tag-alias)\" that counts as duplicates for the specified tags\n- [x] Exclude specific tags from `Remove Underscores`\n- [x] Click `Reload` to cache new cards\n  - By default, the `ExtraNetwork` cards are cached once at the start, to be excluded from `Remove Underscores`. If you added more cards while the Webui is already running, click this button to re-cache again.\n\n### Tag Alias\n- In the `Prompt Format` settings, there is a new field for **Tag Alias**\n- You can assign other tags that count as the same as the main tag, and thus get removed during `Remove Duplicates`\n- The syntax is in the format of `main tag: alias1, alias2, alias3`\n  - **example:**\n    ```\n    1girl: girl, woman, lady\n    ```\n    - If you type `girl`, it will get converted into `1girl`, and if you already have `1girl`, then the future ones will get removed.\n\n- The pattern for alias uses **Regular Expression**, so certain symbols *(**eg.** `(`, `)`)* will need to be escaped *(**ie.** `\\(`, `\\)`)*\n  - Comma is not supported, as it is used to separate multiple patterns\n  - Check out [RegExr](https://regexr.com/) for cheatsheet\n  - **example:**\n    ```regex\n    adult: \\d*\\s*(y\\.?o\\.?|[Yy]ear[s]? [Oo]ld)\n    ```\n    - It will convert `15 yo`, `20 y.o.`, `25 years old`, `30 Year Old` all into `adult`\n\n\u003chr\u003e\n\n### Note\n1. Since the formatting in `Auto` mode is triggered at the same time as the generation, the immediate image might not have its prompts updated.\n\n2. Some Extensions *(**eg.** [tagcomplete](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete))* listen to the text editing event, meaning the formatting will cause them to be triggered. You can disable updating the actual prompts in the `Prompt Format` settings to prevent this. Though you may need to manually type something else for the prompt to get actually updated.\n\n\u003chr\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eBooru\u003c/b\u003e\u003c/summary\u003e\n\n- [x] Automatically clean up unwanted texts\n  - Currently supports [gelbooru](https://gelbooru.com/) and [danbooru](https://safebooru.donmai.us/)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"booru.png\" width=512\u003e\u003c/p\u003e\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoming02%2Fsd-webui-prompt-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaoming02%2Fsd-webui-prompt-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoming02%2Fsd-webui-prompt-format/lists"}