Fooocus
Fooocus copied to clipboard
Adding support to inline prompt references
Objective:
- To allow to specify LoRAS using the prompt string.
Implementation:
- Removed circular reference on utils.py by moving the function
get_files_from_folder
to another file. - Removed circular reference on modules/sdxl_styles.py by moving the function
apply_wildcards
tomodules.config
. - Adds a function that parses prompt tokens, assuming comma delimited entries.
- A regular expression captures the groups for a Lora name and weight
- Adds an initial md meant to be used as a guideline for development
- Added a
tests
directory
Limitations
- LoRAS references in wildcards strings are not supported
Usage
key_word1, keyword2, <lora:some-lora:1>, <lora:another-lora:0.34>
@mashb1t Inputs are welcome
@cantor-set Fooocus aims for simplicity and ease of use. and LoRA activation can already be done using the select inputs. What's your reasoning for the LoRA reading functionality from prompt strings?
@cantor-set Fooocus aims for simplicity and ease of use. and LoRA activation can already be done using the select inputs. What's your reasoning for the LoRA reading functionality from prompt strings?
The reasoning is convenience for advance users. Faster adjustment and setting of multiple LoRAs without having to swap windows or clicking away to search and drop down menu selection, minimizing the number of steps to accomplish the same objective. Specially when the user knows which LoRa needs to be applied.
Additionally, it does not interferes with the normal flow of operations, it just adds more options for advance users.
@cantor-set Fooocus aims for simplicity and ease of use. and LoRA activation can already be done using the select inputs. What's your reasoning for the LoRA reading functionality from prompt strings?
Another issue is that "slider" loras can often use numbers greater than 2 and lower than -2. The current UI only allows for -2 to 2, and using inline you can edit it to any amount beyond the min and max as well as any step in between.
https://civitai.com/models/112552/weight-slider-lora -3 to 3 https://civitai.com/models/228180/diablo-sliders-ntcaixyz examples shown uses 5
More importantly for me, it also allows for wildcards to use loras. without inline lora , you cannot use wildcards and prompts together in anyway.
@cantor-set @ujl123 thank you for the feedback, i can see why this can be useful. Feel free to finalize the implementation and mark it as ready to review.
@mashb1t @lllyasviel Ready for review and suggestions.
@cantor-set please check again with the latest version 2.2.0 and pull it to your branch.
@cantor-set please check again with the latest version 2.2.0 and pull it to your branch. @mashb1t Done. Added an additional change that fixes a circular dependency on
utils.py
.