Feature Proposal: Always Random Wildcards #2761
Replies: 6 comments 2 replies
-
The "Disable seed increment" option is very useful when used with the array prompt syntax introduced in PR #1503 and is not intended to be used in combination with wildcards. |
Beta Was this translation helpful? Give feedback.
-
Yes, as I mentioned at the top of this proposal, "Disable seed increment... When used with arrays, it works very nicely to produce a variety of results based on the same seed" and I do appreciate that. This modification does not affect the operation of arrays. Again with the same seed as before, this time using an array to replicate what the wildcard produced in the last example, this is the test prompt: With an Image Number of 5, using the same seed, without incrementing that seed and with my modification in effect, the array exactly replicated the wildcard results I achieved previously, as shown in this extract from the console window: Loading 1 new model I very often use both arrays and wildcards in my projects. There is no reason that "Disable seed increment" could not be just as useful for wildcards, for very similar reasons to its usefulness for arrays. In this example, arbitrarily specifying five ethnicities in an array is at odds with my typical purpose of randomly diversifying images of people as much as possible. While Fooocus wildcard randomness is not ideal, it is a lot better than the randomness that I can come up with just out of my head! In async_worker.py, we are looking at the addition of one line of code and the change of a variable name in the next line. Logically this will not affect the integrity of seed production, but I have tested to ensure that it does not. The introduction of this small enhancement would enrich the Fooocus experience for a very small overhead, and would likely forestall future bewilderment as to why wildcards do not work in certain situations - precisely at the time when one would count on them to work. |
Beta Was this translation helpful? Give feedback.
-
I have discovered that my modification slightly alters the Prompt Expansion added by Fooocus V2. This makes it impossible to exactly replicate a previously created image. So if we were to go ahead with this enhancement, I would likely need a bit of help - perhaps just a hint - in discovering why this is so. I have no idea at the moment how this modification could change the Prompt Expansion. 😞 |
Beta Was this translation helpful? Give feedback.
-
I slightly adjusted my coding and now the modification does not affect the Fooocus V2 Prompt Expansion. 🙂 |
Beta Was this translation helpful? Give feedback.
-
@mashb1t I really hesitate to bring this back to your attention because I don't want to distract you from incorporating your branch into mainstream Fooocus! There has been no support for this feature here but I did have someone track me down on Facebook to ask me for this patch. I actually don't use it myself because I much more interested in keeping my Fooocus completely current and not missing out on anything new! 😉 |
Beta Was this translation helpful? Give feedback.
-
I have added a PR to my fork. I cannot remember how to bring that into the main PRs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I really appreciate the new "Disable seed increment" option in the Developer Debug Mode Debug Tools section.
When used with arrays, it works very nicely to produce a variety of results based on the same seed.
But currently there is a problem in that "Disable seed increment" prevents wildcards from being chosen randomly.
So in this example prompt:
"portrait of an ethnic woman"
(where the ethnic wildcard is a list of 330 worldwide ethnicities)
and an Image Number of 5, using the same seed and without incrementing that seed, Fooocus will produce five completely identical results, as shown in this extract from the console window:
[Fooocus] Processing prompts ...
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Fooocus] Preparing Fooocus text #1 ...
With some minor changes to async_worker.py, wildcard random number generation is no longer affected by the "Disable seed increment" value, as shown:
[Fooocus] Processing prompts ...
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Ugandan woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Herzegovinian woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Corsican woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Sioux woman
[Wildcards] processing: portrait of an ethnic woman
[Wildcards] portrait of an Assyrian woman
[Fooocus] Preparing Fooocus text #1 ...
So with this modification, Fooocus produces five different images from the same seed, allowing for a project theme to be developed using similar image composition or subject poses or perhaps an identical character that is doing different activities or is dressed differently based on changes in wildcard keywords.
I cannot imagine when you would want to run wildcards with a frozen seed because that defeats the purpose of wildcards. Subject to approval as usual, I would like to create a PR for this change.
Beta Was this translation helpful? Give feedback.
All reactions