{"id":23177257,"url":"https://github.com/haoming02/sd-webui-yapping","last_synced_at":"2025-08-18T11:32:31.200Z","repository":{"id":248468424,"uuid":"827716309","full_name":"Haoming02/sd-webui-yapping","owner":"Haoming02","description":"An Extension for Automatic1111 Webui that adds presets for parameters","archived":false,"fork":false,"pushed_at":"2024-10-21T13:28:24.000Z","size":49,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-23T10:33:11.376Z","etag":null,"topics":["stable-diffusion-webui","stable-diffusion-webui-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","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":"2024-07-12T08:16:51.000Z","updated_at":"2024-10-21T13:28:29.000Z","dependencies_parsed_at":"2024-07-18T08:50:00.730Z","dependency_job_id":"50d9afec-123c-418d-9453-54a88e2c4d3b","html_url":"https://github.com/Haoming02/sd-webui-yapping","commit_stats":null,"previous_names":["haoming02/sd-webui-yapping"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-yapping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-yapping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-yapping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haoming02%2Fsd-webui-yapping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Haoming02","download_url":"https://codeload.github.com/Haoming02/sd-webui-yapping/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230227261,"owners_count":18193272,"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:21.029Z","updated_at":"2024-12-18T06:32:21.597Z","avatar_url":"https://github.com/Haoming02.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# **Y**et **A**nother **P**reset-**P**lanning **I**ntegration: **N**ext-**G**en\n\n\u003cp\u003e\u003cblockquote\u003e\u003ci\u003e\n\nBehold, the quintessence of computational artistry: the formidable \"Preset Planning\" integration, an immaculate marvel harnessed by the enchanting Python Gradio package, devoid of the cacophony of JavaScript's ubiquitous clamor. This technological paragon transcends the mundane, weaving a tapestry of seamless interaction and divine user experience.\n\nGaze, upon the sublime architecture of Gradio's Pythonic embrace, where form follows function with an unwavering fidelity. Embracing the purist ethos of simplicity, this plug-in shuns the ornate excesses of its counterparts, distilling the essence of user experience into a distilled elixir of elegance.\n\nConsider, the \"Preset Planning\" integration, fortified by Python Gradio's mastery, stands not as a mere tool, but as a testament to the ingenuity of human imagination. It embodies the zenith of interface refinement, transcending the realm of expectation to forge a path toward a future where utility and artistry converge in resplendent harmony.\n\n\u003c/i\u003e\u003c/blockquote\u003e\u003c/p\u003e\n\n\u003cp align=\"right\"\u003e\u003ci\u003e\u003cb\u003e- ChatGPT\u003c/b\u003e\u003c/i\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n# SD Webui Yapping\nThis is an Extension for the [Automatic1111 Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui), which adds fully-customizable preset buttons, that set specified parameters to specified values when clicked.\n\n\u003e Compatible with [Forge](https://github.com/lllyasviel/stable-diffusion-webui-forge)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"ui.jpg\"\u003e\u003cbr\u003e\nExample Buttons\u003cbr\u003e\n(used with \u003ca href=\"https://github.com/Haoming02/sd-webui-tabs-extension\"\u003eTabs Extension\u003c/a\u003e)\n\u003c/p\u003e\n\nAs mentioned in the *holy **yapping*** above, this Extension finds the fields during the UI setup process via Python, and uses the Gradio button events to change the parameters.\n\nThus, no more trying to query elements using JavaScript; no more hacky workaround to change element values; no more clashing due to identical field name.\n\n## How to Use\n\n\u003e On a fresh install, the Extension will automatically rename `example.json` to `presets.json`, to avoid overriding users' existing presets\n\nWithin the `presets.json` file, there are 3 objects, `txt2img`, `img2img`, and `triggers`:\n\n- The **txt2img** and **img2img** objects are responsible for the **Preset** buttons:\n\n    - Start with a \u003cins\u003ekey\u003c/ins\u003e, which will become the name of the button. This is also the name used by the **triggers** below.\n\n        \u003e If the `key` contains the phrase \"sep\", it will become a separator instead, placing buttons above and below it into different rows\n\n    - Then, open into an object that contains multiple \u003cins\u003ekey-value\u003c/ins\u003e pairs. Each pair consists of the `elem_id` of the field, and the value to set the parameter to.\n\n- The **triggers** object is responsible for hooking **Preset** to other buttons present in the Webui.\n\n    - The \u003cins\u003ekey\u003c/ins\u003e is the `elem_id` of the button\n    - The \u003cins\u003evalue\u003c/ins\u003e is in the format of `{tab}-{preset}`, where `{tab}` is either `t2i` or `i2i`, referring to the mode the preset was defined in; while `{preset}` is the name of the **Preset** to trigger.\n\n#### Examples\n- The following will add a button called `portrait` to the `txt2img` tab that when clicked, sets the `width` and `height` to `896` and `1152` respectively\n\n    ```json\n    \"txt2img\": {\n        \"portrait\": {\n            \"txt2img_width\": 896,\n            \"txt2img_height\": 1152\n        }\n    }\n    ```\n\n- The following will trigger the `upscale` preset defined in `img2img` tab, when the `Send to img2img` button in the `txt2img` tab is clicked\n\n    ```json\n    \"triggers\": {\n        \"txt2img_send_to_img2img\": \"i2i-upscale\",\n    }\n    ```\n\n\u003e Refer to the `presets.json` for more included examples\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eelem_id\u003c/b\u003e\u003c/summary\u003e\n\nTo find the `elem_id` of a parameter, right click on the field and click `Inspect Element`, then look through the parent elements until you can find a descriptive `id`.\n\nMost parameters should work, as long as they are Gradio components defined with unique `elem_id` properly, even ones from other Extensions.\n\nListed below are some built-in `elem_id` that were tested and confirmed to work:\n\n- `txt2img_sampling`\n- `txt2img_width`\n- `txt2img_height`\n- `txt2img_steps`\n- `txt2img_cfg_scale`\n- `img2img_sampling`\n- `img2img_width`\n- `img2img_height`\n- `img2img_steps`\n- `img2img_cfg_scale`\n- `img2img_denoising_strength`\n- `txt2img_send_to_img2img`\n- `img2img_send_to_inpaint`\n- `img2img_tabs_resize`\n\n\u003c/details\u003e\n\n## Roadmap\n- [X] Implement error handling for invalid `elem_id`\n- [X] Add a way to trigger a Preset from a built-in Button\n- [X] Support Gradio.Tab\n- [ ] Add a way to edit the Presets within the Webui\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoming02%2Fsd-webui-yapping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaoming02%2Fsd-webui-yapping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaoming02%2Fsd-webui-yapping/lists"}