[PR #1] [MERGED] fixes simplification improvements #1

Closed
opened 2026-10-31 21:16:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/power88/webui-fooocus-prompt-expansion/pull/1
Author: @w-e-w
Created: 6/9/2024
Status: ✅ Merged
Merged: 6/9/2024
Merged by: @power88

Base: master ← Head: master


📝 Commits (10+)

📊 Changes

3 files changed (+91 additions, -171 deletions)

View changed files

➕ .gitignore (+1 -0)
➖ install.py (+0 -23)
📝 scripts/expansion.py (+90 -148)

📄 Description

fixes the model download destination
model on first use as opposed to install.py

best try not to use install.py for anyting when possible
simplify the UI design combining the checkbox and accordion into just InputAccordion
extension is disabled and collapsed by default

reading this section of unused code
github.com/power88/webui-fooocus-prompt-expansion@c57db7e4dd/scripts/expansion.py (L242-L249)

I assume that you trying to achieve some sort of generate the prompt and then apply the prompt prompy box functionality
I've implemented this for you in Implement preview UI
remove it if it's not your intention

I also implemented so that if you read your prompt firm infotax it will automatically disable extension
reason being since the prompt is directly modified when you read infotext you will
already have the prompt inside the prompt and don't need the extension to be enabled

as a result is deterministic it make sense to lru_cache create_positive
the expansion prompt is cached so that if the input prompt and the seed is the same it immediately returns the results as opposed to calculated again

maximum of cached result is set to 1024, to be honest it's probably okay to set it to unlimited as this is just strings

it's also solves the issue when you have assuming that all prompts are the same it will basically have to calculate the same thing multiple times wasting compute when len(p.all_prompts) > 0

simplify device selection operation
I can see that you clearly copied your code from fooocus, which contain lots of code that are completely not applicable


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/power88/webui-fooocus-prompt-expansion/pull/1 **Author:** [@w-e-w](https://github.com/w-e-w) **Created:** 6/9/2024 **Status:** ✅ Merged **Merged:** 6/9/2024 **Merged by:** [@power88](https://github.com/power88) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`8a38384`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/8a383844bf9fede11f7197b357b7b98852ac6f9b) .gitignore __pycache__/ - [`7486e59`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/7486e593a5749c7f3a639c58d5a9ae62b36ba6ee) reformat - [`979e5e6`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/979e5e69daf23f08691a165fc84b04ce548c5363) fix models_path - [`483fdc4`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/483fdc433055b4b30c6b5a90d9224e93ebab7e20) download the model on first use - [`c59d9d1`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/c59d9d103292b1d91cf1ed9abdc093978fa8e473) use InputAccordion - [`90ace75`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/90ace756632af8e423dbb3e69bb21a05a2a7043d) disable ext on apply infotext - [`3b7cb8d`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/3b7cb8d8b30c22d7ae3938f270f5a97e1642b365) lru_cache create_positive - [`211e563`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/211e563e7160d679f98351a173edf86feaebb14b) simplify device - [`68b1975`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/68b1975a5bfd4929cd1f9e8cbd1b73280efff391) Implement preview UI - [`22e7b1c`](https://github.com/power88/webui-fooocus-prompt-expansion/commit/22e7b1ced3fceaf53c51be665bdf8e171f3cc9f0) simplifies and remove unused code ### 📊 Changes **3 files changed** (+91 additions, -171 deletions) <details> <summary>View changed files</summary> ➕ `.gitignore` (+1 -0) ➖ `install.py` (+0 -23) 📝 `scripts/expansion.py` (+90 -148) </details> ### 📄 Description fixes the model download destination model on first use as opposed to install.py > best try not to use install.py for anyting when possible simplify the UI design combining the checkbox and accordion into just `InputAccordion` > extension is disabled and collapsed by default reading this section of unused code https://github.com/power88/webui-fooocus-prompt-expansion/blob/c57db7e4dde20116c94da5d22d8b46c5d85c51ac/scripts/expansion.py#L242-L249 I assume that you trying to achieve some sort of generate the prompt and then apply the prompt prompy box functionality I've implemented this for you in [Implement preview UI](https://github.com/power88/webui-fooocus-prompt-expansion/commit/68b1975a5bfd4929cd1f9e8cbd1b73280efff391) remove it if it's not your intention I also implemented so that if you read your prompt firm infotax it will automatically disable extension reason being since the prompt is directly modified when you read infotext you will already have the prompt inside the prompt and don't need the extension to be enabled as a result is deterministic it make sense to [lru_cache create_positive](https://github.com/power88/webui-fooocus-prompt-expansion/commit/3b7cb8d8b30c22d7ae3938f270f5a97e1642b365) the expansion prompt is cached so that if the input prompt and the seed is the same it immediately returns the results as opposed to calculated again > maximum of cached result is set to 1024, to be honest it's probably okay to set it to unlimited as this is just strings it's also solves the issue when you have assuming that all prompts are the same it will basically have to calculate the same thing multiple times wasting compute when `len(p.all_prompts) > 0` simplify device selection operation I can see that you clearly copied your code from fooocus, which contain lots of code that are completely not applicable --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 21:16:01 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
power88/webui-fooocus-prompt-expansion#1
No description provided.