+79
-2
@@ -13,6 +13,10 @@ sys.path.append(onebuttonprompt_path)
|
||||
from build_dynamic_prompt import *
|
||||
from csv_reader import *
|
||||
|
||||
from one_button_presets import OneButtonPresets
|
||||
OBPresets = OneButtonPresets()
|
||||
allpresets = list(OBPresets.opb_presets.keys())
|
||||
|
||||
artists = ["all", "all (wild)", "none", "popular", "greg mode", "3D", "abstract", "angular", "anime" ,"architecture", "art nouveau", "art deco", "baroque", "bauhaus", "cartoon", "character", "children's illustration", "cityscape", "cinema", "clean", "cloudscape", "collage", "colorful", "comics", "cubism", "dark", "detailed", "digital", "expressionism", "fantasy", "fashion", "fauvism", "figurativism", "gore", "graffiti", "graphic design", "high contrast", "horror", "impressionism", "installation", "landscape", "light", "line drawing", "low contrast", "luminism", "magical realism", "manga", "melanin", "messy", "monochromatic", "nature", "nudity", "photography", "pop art", "portrait", "primitivism", "psychedelic", "realism", "renaissance", "romanticism", "scene", "sci-fi", "sculpture", "seascape", "space", "stained glass", "still life", "storybook realism", "street art", "streetscape", "surrealism", "symbolism", "textile", "ukiyo-e", "vibrant", "watercolor", "whimsical"]
|
||||
imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portrait", "anime key visual", "only other types", "only templates mode", "art blaster mode", "quality vomit mode", "color cannon mode", "unique art mode", "massive madness mode", "photo fantasy mode", "subject only mode", "fixed styles mode", "the tokinator"]
|
||||
subjects =["all", "object", "animal", "humanoid", "landscape", "concept"]
|
||||
@@ -435,6 +439,78 @@ class SavePromptToFile:
|
||||
|
||||
return ("done")
|
||||
|
||||
class OneButtonPreset:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
|
||||
return {
|
||||
"required": {
|
||||
"OneButtonPreset": (allpresets, {"default": "Standard"}),
|
||||
},
|
||||
"optional": {
|
||||
"seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFFFFFFFFFF}),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
RETURN_NAMES = ("prompt",)
|
||||
|
||||
FUNCTION = "Comfy_OBP_OneButtonPreset"
|
||||
|
||||
#OUTPUT_NODE = False
|
||||
|
||||
CATEGORY = "OneButtonPrompt"
|
||||
|
||||
def Comfy_OBP_OneButtonPreset(self, OneButtonPreset, seed):
|
||||
# load the stuff
|
||||
selected_opb_preset = OBPresets.get_obp_preset(OneButtonPreset)
|
||||
|
||||
insanitylevel=selected_opb_preset["insanitylevel"]
|
||||
subject=selected_opb_preset["subject"]
|
||||
artist=selected_opb_preset["artist"]
|
||||
chosensubjectsubtypeobject=selected_opb_preset["chosensubjectsubtypeobject"]
|
||||
chosensubjectsubtypehumanoid=selected_opb_preset["chosensubjectsubtypehumanoid"]
|
||||
chosensubjectsubtypeconcept=selected_opb_preset["chosensubjectsubtypeconcept"]
|
||||
chosengender=selected_opb_preset["chosengender"]
|
||||
imagetype=selected_opb_preset["imagetype"]
|
||||
imagemodechance=selected_opb_preset["imagemodechance"]
|
||||
givensubject=selected_opb_preset["givensubject"]
|
||||
smartsubject=selected_opb_preset["smartsubject"]
|
||||
givenoutfit=selected_opb_preset["givenoutfit"]
|
||||
prefixprompt=selected_opb_preset["prefixprompt"]
|
||||
suffixprompt=selected_opb_preset["suffixprompt"]
|
||||
giventypeofimage=selected_opb_preset["giventypeofimage"]
|
||||
antistring=selected_opb_preset["antistring"]
|
||||
|
||||
generatedprompt = build_dynamic_prompt(insanitylevel=insanitylevel,
|
||||
forcesubject=subject,
|
||||
artists=artist,
|
||||
subtypeobject=chosensubjectsubtypeobject,
|
||||
subtypehumanoid=chosensubjectsubtypehumanoid,
|
||||
subtypeconcept=chosensubjectsubtypeconcept,
|
||||
gender=chosengender,
|
||||
imagetype=imagetype,
|
||||
imagemodechance=imagemodechance,
|
||||
givensubject=givensubject,
|
||||
smartsubject=smartsubject,
|
||||
overrideoutfit=givenoutfit,
|
||||
prefixprompt=prefixprompt,
|
||||
suffixprompt=suffixprompt,
|
||||
giventypeofimage=giventypeofimage,
|
||||
antivalues=antistring,
|
||||
advancedprompting=False,
|
||||
hardturnoffemojis=True,
|
||||
seed=seed
|
||||
)
|
||||
|
||||
|
||||
return (generatedprompt,)
|
||||
|
||||
class AutoNegativePrompt:
|
||||
|
||||
|
||||
@@ -486,20 +562,21 @@ class AutoNegativePrompt:
|
||||
|
||||
return (generatedprompt,)
|
||||
|
||||
|
||||
|
||||
# A dictionary that contains all nodes you want to export with their names
|
||||
# NOTE: names should be globally unique
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"OneButtonPrompt": OneButtonPrompt,
|
||||
"OneButtonPreset": OneButtonPreset,
|
||||
"CreatePromptVariant": CreatePromptVariant,
|
||||
"SavePromptToFile": SavePromptToFile,
|
||||
"AutoNegativePrompt": AutoNegativePrompt,
|
||||
|
||||
}
|
||||
|
||||
# A dictionary that contains the friendly/humanly readable titles for the nodes
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"OneButtonPrompt": "One Button Prompt",
|
||||
"OneButtonPreset": "One Button Preset",
|
||||
"CreatePromptVariant": "Create Prompt Variant",
|
||||
"SavePromptToFile": "Save Prompt To File",
|
||||
"AutoNegativePrompt": "Auto Negative Prompt",
|
||||
|
||||
@@ -23,6 +23,7 @@ More of a Fooocus fan? Take a look at this excellent fork called [RuinedFooocus]
|
||||
# Features
|
||||
- __Full prompt generation__ with the click of a button. ==> [guide to my first generation](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/my_first_generation.md)
|
||||
- Supports __TXT2IMG, IMG2IMG, ControlNET, inpainting and latent couple__. ==> [guide to IMG2IMG and ControlNET](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/the_next_generation_img2img_and_controlnet.md)
|
||||
- Save your favorite generation settings with __presets__. ==> [One Button Presets](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/one_butten_presets.md)
|
||||
- __Workflow assist__, generate multiple prompts with One Button. Create __prompt variants__ with ease. ==> [guide to workflow assist and prompt variant mode](workflow_assist_and_prompt_variant_mode.md)
|
||||
- Create __infinite variations__ of a __chosen subject__. ==> [guide to override subject](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/override_subject_and_infinite_variations.md)
|
||||
- Fully __automated generation, classification and upscaling__. ==> [guide to one_button_run_and_upscale](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/one_button_run_and_upscale.md)
|
||||
@@ -33,10 +34,18 @@ More of a Fooocus fan? Take a look at this excellent fork called [RuinedFooocus]
|
||||
- Has multiple __prompt generation modes__ to choose from ==> [guide to prompt generation modes](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/prompt_generation_modes.md)
|
||||
- Stay in control, and fine-tune One Button Prompt with a __config__ file ==> [config file](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/config_file.md)
|
||||
|
||||
## How to use in automatic1111
|
||||
## Important Notice
|
||||
|
||||
One Button Prompt had a recent large change in the UI when Presets were introduced. This might be confusing for long time users.
|
||||
|
||||
If you are not finding the settings, change the __"One Button Preset"__ to __"Custom..."__.
|
||||
|
||||
<img src="https://github.com/AIrjen/OneButtonPrompt/assets/130234949/6d821c82-edf9-4496-867f-ac01dda994cd.png" width="50%" height="50%">
|
||||
|
||||
## How to use in automatic1111/SD.next
|
||||
In TXT2IMG or IMG2IMG, select the script "One Button Prompt".
|
||||
|
||||
<img src="https://github.com/AIrjen/OneButtonPrompt/assets/130234949/b4b7a81b-094f-4bb8-bf9d-6ef45bbfa14d.png" width="50%" height="50%">
|
||||
<img src="https://github.com/AIrjen/OneButtonPrompt/assets/130234949/b43f7bef-533d-4139-a477-562a0b2d39ca.png" width="50%" height="50%">
|
||||
|
||||
Leave the prompts empty:
|
||||
|
||||
@@ -56,6 +65,8 @@ You might get an epic landscape, or a photo of an Aggregavated Trout. In my expe
|
||||
|
||||
Don't get overwhelmed by the options, they will become more clear once you use it more.
|
||||
|
||||
For first time users, play around with the set presets.
|
||||
|
||||
Some more examples below. And check the first time user guide [here](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/my_first_generation.md).
|
||||
|
||||
### Some details
|
||||
@@ -100,14 +111,28 @@ You can also download the files from github directly, and place them under your
|
||||
|
||||
# Main tab
|
||||
|
||||
Guide your prompt here. You can increase the slider, to include more things to put into the prompt. Recommended is keeping it around 3-7. Use 10 at your own risk. I usually run it between 5 and 7.
|
||||
The main tab will show preset options, which are preset generation settings which will help achieve good results. On default, it is set to __Standard__, which was the previous default setting of One Button Prompt. It is quite random and give some wild results.
|
||||
|
||||
If you are looking for more guided results, choose a different preset. Some good first choices are:
|
||||
|
||||
- Standard -> One Button Prompts default. Wild and unpredictable. Good for prompt exploration.
|
||||
- Unique People Portraits -> Will focus on generating photographic people
|
||||
- D&D Style Portraits -> Will focus on generating fantasy style portraits
|
||||
- Consistent Results -> Running on a large set of build in styles, to get consistent results in prompts. Works best on SDXL.
|
||||
- Greg Mode - The Preset -> Focusses on creating characters, mixed with popular artists (like Greg Rutkowski). Works best on SD 1.5 models.
|
||||
|
||||
|
||||
If you want to change the settings yourself, please change the One Button Preset to __"Custom..."__. This will load in all the settings to be adjusted.
|
||||
|
||||
|
||||
Insanity level. You can increase the slider, to include more things to put into the prompt. Recommended is keeping it around 3-7. Use 10 at your own risk. I usually run it between 5 and 7.
|
||||
|
||||
You an use the Subject Types filter to select on main subject types to generate. Maybe you want only Landscapes, maybe you want only people. Select it here.
|
||||
|
||||
Artists have a major impact on the result. Automatically, it will select between 0-3 artists out of 3483 artists for your prompt.
|
||||
You can turn it off. Add your own artists to the prompt, and they will be added to the end of the prompt.
|
||||
|
||||
Type of image can be used to force a certian direction. For example when using Realistic Vision, it might be a good idea to set it to photograph. For an anime model, you might want to use "Anime key visual"
|
||||
Type of image can be used to force a certain direction. For example when using Realistic Vision, it might be a good idea to set it to photograph. For an anime model, you might want to use "Anime key visual"
|
||||
|
||||
Special image type modes have chance to trigger. Those follow different rules of prompt generation.
|
||||
|
||||
@@ -124,18 +149,20 @@ Add a prompt prefix, suffix and the negative prompt in the respective fields. Th
|
||||
|
||||
These can be used to add textual inversion and LoRA's. They can also be used to add your models trigger words.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
# Workflow assist tab
|
||||
I've added a Workflow assist tab in a recent update.
|
||||
|
||||
This tab is designed to help with the workflow of adjusting and maintaining prompts without turning the extension off.
|
||||
"Workflow mode" turns off the generated script, and uses the Workflow prompt instead.
|
||||
|
||||
Use the prompt variant slider to create variants of the Workflow prompt.
|
||||
|
||||
It also has the options to generate a few prompts with a click and send them to the workflow prompt. This way you can search or combine interesting ideas together.
|
||||

|
||||

|
||||
|
||||
|
||||
# One Button Run and Upscale
|
||||
Using the API feature of WebUI, this allows you to:
|
||||
@@ -159,9 +186,6 @@ All with a single press of __One Button__.
|
||||
|
||||
# roadmap
|
||||
Some ideas I'd like to implement:
|
||||
- More consistency in prompts, while keep being wild
|
||||
- More consistency in lower insanitylevels, more wildness on higher insanitylevels
|
||||
- Create dice/random buttons in front of override subject and override outfit
|
||||
- Ongoing: list refinements and new features in the prompt generation
|
||||
- Ongoing: Documentation and toturials
|
||||
|
||||
|
||||
@@ -2749,6 +2749,13 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
completeprompt = completeprompt.replace("-outfit-", "-minioutfit-",1)
|
||||
if(rare_dist(insanitylevel)): # Use base outfit descriptor, until we are not.
|
||||
completeprompt = completeprompt.replace("-outfitdescriptor-", "-descriptor-")
|
||||
|
||||
# if -outfit- is in the override, we want a consistent result
|
||||
if("-outfit-" in overrideoutfit):
|
||||
if(chance_roll(insanitylevel, "common")):
|
||||
overrideoutfit = overrideoutfit.replace("-outfit-", random.choice(outfitlist))
|
||||
else:
|
||||
overrideoutfit = overrideoutfit.replace("-outfit-", random.choice(minioutfitlist))
|
||||
|
||||
if(overrideoutfit != ""):
|
||||
completeprompt = completeprompt.replace("-sameoutfit-", overrideoutfit)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
class OneButtonPresets:
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__)) # Script directory
|
||||
DEFAULT_OBP_FILE = os.path.join(script_dir, "./presets/obp_presets.default")
|
||||
OBP_FILE = os.path.join(script_dir, "./userfiles/obp_presets.json")
|
||||
CUSTOM_OBP = "Custom..."
|
||||
|
||||
def __init__(self):
|
||||
self.opb_presets = self.load_obp_presets()
|
||||
|
||||
def load_obp_presets(self):
|
||||
default_data = self._load_data(self.DEFAULT_OBP_FILE)
|
||||
data = self._load_data(self.OBP_FILE)
|
||||
|
||||
for name, settings in default_data.items():
|
||||
if name not in data:
|
||||
data[name] = settings
|
||||
|
||||
self._save_data(self.OBP_FILE, data)
|
||||
return data
|
||||
|
||||
def _load_data(self, file_path):
|
||||
if not os.path.isfile(file_path):
|
||||
shutil.copy(self.DEFAULT_OBP_FILE, file_path)
|
||||
return json.load(open(file_path))
|
||||
|
||||
def _save_data(self, file_path, data):
|
||||
with open(file_path, "w") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
|
||||
def save_obp_preset(self, perf_options):
|
||||
with open(self.OBP_FILE, "w") as f:
|
||||
json.dump(perf_options, f, indent=2)
|
||||
self.opb_presets = self.load_obp_presets()
|
||||
|
||||
def get_obp_preset(self, name):
|
||||
return self.opb_presets[name]
|
||||
@@ -0,0 +1,362 @@
|
||||
{
|
||||
"Standard": {
|
||||
"insanitylevel": 5,
|
||||
"subject": "all",
|
||||
"artist": "all",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": 20,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Consistent results": {
|
||||
"insanitylevel": 2,
|
||||
"subject": "concept",
|
||||
"artist": "none",
|
||||
"chosensubjectsubtypeobject": "flora",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "names from card based games",
|
||||
"chosengender": "all",
|
||||
"imagetype": "fixed styles mode",
|
||||
"imagemodechance": "20",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Unique People Portraits": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "humanoid",
|
||||
"artist": "photography",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "based on first name",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "portrait",
|
||||
"imagemodechance": "100",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "photograph",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Artful People Portraits": {
|
||||
"insanitylevel": 5,
|
||||
"subject": "humanoid",
|
||||
"artist": "character",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "art blaster mode",
|
||||
"imagemodechance": 20,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "portrait art by -artist-",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"D&D Style Portraits": {
|
||||
"insanitylevel": 2,
|
||||
"subject": "humanoid",
|
||||
"artist": "fantasy",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "humanoids",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "digital art",
|
||||
"imagemodechance": "100",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "D&D style portrait, fantasy",
|
||||
"suffixprompt": "detailed face",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Cybernetic Animals": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "animal",
|
||||
"artist": "sci-fi",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "digital art",
|
||||
"imagemodechance": 100,
|
||||
"givensubject": "robotic subject",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "cybernetics",
|
||||
"prefixprompt": "sci-fi",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Greg mode - The Preset": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "humanoid",
|
||||
"artist": "greg mode",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "digital art",
|
||||
"imagemodechance": 100,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "-outfit-",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Cyberpunk Characters": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "humanoid",
|
||||
"artist": "character",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "concept art",
|
||||
"imagemodechance": "100",
|
||||
"givensubject": "cyborg subject, background is night city, neon-lit",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "cyberpunk",
|
||||
"suffixprompt": "neon hue, shadowrun",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Waifu's": {
|
||||
"insanitylevel": 7,
|
||||
"subject": "humanoid",
|
||||
"artist": "none",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "female",
|
||||
"imagetype": "subject only mode",
|
||||
"imagemodechance": "20",
|
||||
"givensubject": "-basicbitchdescriptor- 1girl, solo,",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "(((masterpiece))), (((best quality))), anime style, 2d,",
|
||||
"suffixprompt": "key visual",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Husbando's": {
|
||||
"insanitylevel": 7,
|
||||
"subject": "humanoid",
|
||||
"artist": "none",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "male",
|
||||
"imagetype": "subject only mode",
|
||||
"imagemodechance": "20",
|
||||
"givensubject": "-basicbitchdescriptor- 1boy, solo,",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "(((masterpiece))), (((best quality))), anime style, 2d,",
|
||||
"suffixprompt": "key visual",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Fashion Models": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "humanoid",
|
||||
"artist": "fashion",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "photograph",
|
||||
"imagemodechance": "100",
|
||||
"givensubject": "supermodel",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "fashion outfit",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "Fashion photography",
|
||||
"antistring": ""
|
||||
},
|
||||
"WIERD HATS": {
|
||||
"insanitylevel": 4,
|
||||
"subject": "humanoid",
|
||||
"artist": "none",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "photograph",
|
||||
"imagemodechance": "100",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "headwear",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Wallpaper art": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "concept",
|
||||
"artist": "digital",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "the X of Y concepts",
|
||||
"chosengender": "female",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": 6,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "small centered composition, product shot, plain background",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "wallpaper art, in the center is an image",
|
||||
"antistring": ""
|
||||
},
|
||||
"The Connaisseur": {
|
||||
"insanitylevel": 5,
|
||||
"subject": "concept",
|
||||
"artist": "all (wild)",
|
||||
"chosensubjectsubtypeobject": "all",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "lines from poems",
|
||||
"chosengender": "female",
|
||||
"imagetype": "unique art mode",
|
||||
"imagemodechance": 20,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Interesting Landscapes": {
|
||||
"insanitylevel": 5,
|
||||
"subject": "landscape",
|
||||
"artist": "landscape",
|
||||
"chosensubjectsubtypeobject": "buildings",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": 100,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Relaxing Seascapes": {
|
||||
"insanitylevel": 4,
|
||||
"subject": "concept",
|
||||
"artist": "seascape",
|
||||
"chosensubjectsubtypeobject": "buildings",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "painting",
|
||||
"imagemodechance": 100,
|
||||
"givensubject": "seascape",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Architecture": {
|
||||
"insanitylevel": 3,
|
||||
"subject": "object",
|
||||
"artist": "architecture",
|
||||
"chosensubjectsubtypeobject": "buildings",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": 100,
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "building",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "architecture",
|
||||
"antistring": ""
|
||||
},
|
||||
"Nature": {
|
||||
"insanitylevel": 4,
|
||||
"subject": "object",
|
||||
"artist": "nature",
|
||||
"chosensubjectsubtypeobject": "flora",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": "6",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Let the CFG sort it out": {
|
||||
"insanitylevel": 2,
|
||||
"subject": "concept",
|
||||
"artist": "all (wild)",
|
||||
"chosensubjectsubtypeobject": "buildings",
|
||||
"chosensubjectsubtypehumanoid": "all",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "all",
|
||||
"imagemodechance": 1,
|
||||
"givensubject": "-cardname-, -episodetitle-, \"-poemline-\", \"-songline-\"",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
},
|
||||
"Now this is podracing": {
|
||||
"insanitylevel": 9,
|
||||
"subject": "concept",
|
||||
"artist": "all (wild)",
|
||||
"chosensubjectsubtypeobject": "flora",
|
||||
"chosensubjectsubtypehumanoid": "generic humans",
|
||||
"chosensubjectsubtypeconcept": "all",
|
||||
"chosengender": "all",
|
||||
"imagetype": "massive madness mode",
|
||||
"imagemodechance": "20",
|
||||
"givensubject": "",
|
||||
"smartsubject": true,
|
||||
"givenoutfit": "",
|
||||
"prefixprompt": "",
|
||||
"suffixprompt": "",
|
||||
"giventypeofimage": "",
|
||||
"antistring": ""
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -46,7 +46,7 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im
|
||||
print(result)
|
||||
break
|
||||
|
||||
if(overrideoutfit != "" and overrideoutfit not in result and onlyartists == False):
|
||||
if(overrideoutfit != "" and overrideoutfit not in result and onlyartists == False and "-outfit-" not in overrideoutfit):
|
||||
print("The outfit override is not showing up!")
|
||||
print("")
|
||||
print(result)
|
||||
|
||||
+446
-266
@@ -15,6 +15,8 @@ from main import *
|
||||
from model_lists import *
|
||||
from csv_reader import *
|
||||
|
||||
from one_button_presets import OneButtonPresets
|
||||
OBPresets = OneButtonPresets()
|
||||
|
||||
#subjects = ["all","object","animal","humanoid", "landscape", "concept"]
|
||||
subjects =["all"]
|
||||
@@ -266,278 +268,314 @@ class Script(scripts.Script):
|
||||
<font size="2">
|
||||
One Button Prompt is now active. Just press the normal Generate button to start generating images.
|
||||
|
||||
The settings below give you more control over what you wish to generate.
|
||||
Presets can be used to store and load settings.
|
||||
|
||||
Set the One Button Preset to __"Custom..."__ to show all settings. The settings will give you more control over what you wish to generate.
|
||||
</font>
|
||||
""")
|
||||
with gr.Row(variant="compact"):
|
||||
insanitylevel = gr.Slider(1, 10, value=5, step=1, label="🎲⬅️❔➡️🎲🎲🎲 Higher levels increases complexity and randomness of generated prompt")
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
subject = gr.Dropdown(
|
||||
subjects, label="📸 Subject Types", value="all")
|
||||
with gr.Column(variant="compact"):
|
||||
artist = gr.Dropdown(
|
||||
artists, label="🎨 Artists", value="all")
|
||||
with gr.Row(variant="compact"):
|
||||
chosensubjectsubtypeobject = gr.Dropdown(
|
||||
subjectsubtypesobject, label="🏺 Type of object", value="all", visible=False)
|
||||
chosensubjectsubtypehumanoid = gr.Dropdown(
|
||||
subjectsubtypeshumanoid, label="👨👩👧 Type of humanoids", value="all", visible=False)
|
||||
chosensubjectsubtypeconcept = gr.Dropdown(
|
||||
subjectsubtypesconcept, label="💡🧠💭 Type of concept", value="all", visible=False)
|
||||
chosengender = gr.Dropdown(
|
||||
genders, label="🚻 gender", value="all", visible=False)
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
imagetype = gr.Dropdown(
|
||||
imagetypes, label="🖼️ type of image", value="all")
|
||||
with gr.Column(variant="compact"):
|
||||
imagemodechance = gr.Slider(
|
||||
1, 100, value="20", step=1, label="🎲🖼️ One in X chance to use special image type mode")
|
||||
with gr.Row(variant="compact"):
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Override options (choose the related subject type first for better results)
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
givensubject = gr.Textbox(label="🔃📸 Overwrite subject: ", value="")
|
||||
smartsubject = gr.Checkbox(label="🧠📸 Smart subject", value = True)
|
||||
with gr.Row(variant="compact"):
|
||||
givenoutfit = gr.Textbox(label="🔃👗 Overwrite outfit: ", value="")
|
||||
with gr.Row(variant="compact"):
|
||||
# Part of presets
|
||||
with gr.Row():
|
||||
OBP_preset = gr.Dropdown(
|
||||
label="One Button Preset",
|
||||
choices=[OBPresets.CUSTOM_OBP] + list(OBPresets.opb_presets.keys()),
|
||||
value="Standard",
|
||||
)
|
||||
|
||||
|
||||
with gr.Group(visible=False) as maingroup:
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Prompt fields
|
||||
Type a name and press "Save as Preset" to store the current generation settings.
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
prefixprompt = gr.Textbox(label="⬅️💬 Place this in front of generated prompt (prefix)",value="")
|
||||
suffixprompt = gr.Textbox(label="➡️💬 Place this at back of generated prompt (suffix)",value="")
|
||||
with gr.Row(variant="compact"):
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Additional options
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
giventypeofimage = gr.Textbox(label="🔃🖼️ Overwrite type of image: ", value="")
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
antistring = gr.Textbox(label="❌📝 Filter out following properties (comma seperated). Example ""film grain, purple, cat"" ")
|
||||
with gr.Accordion("Help", open=False):
|
||||
gr.Markdown(
|
||||
"""
|
||||
### Description
|
||||
|
||||
<font size="2">
|
||||
Just press the normal Generate button.
|
||||
|
||||
This generator will generate a complete full prompt for you and generate the image, based on randomness. You can increase the slider, to include more things to put into the prompt.
|
||||
Recommended is keeping it around 3-7. Use 10 at your own risk.
|
||||
|
||||
There are a lot of special things build in, based on various research papers. Just try it, and let it surprise you.
|
||||
|
||||
Add additional prompting to the prefix, suffix in this screen. The actual prompt fields are ignored. Negative prompt is in the respective tab.
|
||||
</font>
|
||||
|
||||
### 📸 Subject Types
|
||||
|
||||
<font size="2">
|
||||
You can choose a certain subject type, if you want to generate something more specific. It has the following types:
|
||||
|
||||
1. object - Can be a random object, a building or a vehicle.
|
||||
|
||||
2. animal - A random (fictional) animal. Has a chance to have human characteristics, such as clothing added.
|
||||
|
||||
3. humanoid - A random humanoid, males, females, fantasy types, fictional and non-fictional characters. Can add clothing, features and a bunch of other things.
|
||||
|
||||
4. landscape - A landscape or a landscape with a building.
|
||||
|
||||
5. concept - Can be a concept, such as "a X of Y", or an historical event such as "The Trojan War". It can also generate a line from a poem or a song.
|
||||
|
||||
After choosing object, humanoid or concept a subselection menu will show. You can pick further details here. When choosing humanoid, you can also select the gender you wish to generate.
|
||||
|
||||
🏺 Type of Object:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. generic objects - Hodgepodge of objects, can be household items, weapons or any other general object.
|
||||
|
||||
3. vehicles - Cars, but also planes, trains and boats.
|
||||
|
||||
4. food - Meals, fruits and others.
|
||||
|
||||
5. buildings - From churches to libraries to castles.
|
||||
|
||||
6. space - Some bigger objects, nebula's, black holes and constellations
|
||||
|
||||
7. flora - Flowers and trees.
|
||||
|
||||
👨👩👧 Type of humanoid:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. generic humans - Generic human descriptions. Example values would be Man, Woman, Male, etc
|
||||
|
||||
3. generic human relations - Human relations, example values would be Grandpa, Sister, Father, etc
|
||||
|
||||
4. celebrities e.a. - Known people, usually celebrities.
|
||||
|
||||
5. fictional characters - Movie and videogame characters, such as Mario and Peach.
|
||||
|
||||
6. humanoids - Humanoid type races, think Elves, Orcs, Dwarves, etc
|
||||
|
||||
7. based on job or title - Examples are Queen, Carpenter, Vampire hunter
|
||||
|
||||
8. based on first name - Examples are Anna, James, Emma etc.
|
||||
|
||||
🚻 gender:
|
||||
|
||||
1. all - selects randomly
|
||||
|
||||
2. male
|
||||
|
||||
3. female
|
||||
|
||||
💡🧠💭 Type of concept:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. event - an historical event, or even mythological event. Example The fall of Rome
|
||||
|
||||
3. the X of Y concepts - Randomly creates a small sentence, example The Ocean of Thought or The Fortress of Flame, etc
|
||||
|
||||
4. lines from poems - Picks a line from a poem
|
||||
|
||||
5. lines from songs - Picks a line from a song
|
||||
|
||||
6. names from card based games - Picks a card name from various card games, such as magic the gathering, yugioh and many others.
|
||||
|
||||
</font>
|
||||
|
||||
### 🎨 Artists
|
||||
|
||||
<font size="2">
|
||||
Artists have a major impact on the result.
|
||||
|
||||
1. all - it will cohesivly add about between 0-3 artists and style description.
|
||||
|
||||
2. all (wild) - it will randomly select between 0-3 artists out of 3483 artists for your prompt.
|
||||
|
||||
3. greg mode - Will add greg, or many other popular artists into your prompt. Will also add a lot of quality statements.
|
||||
|
||||
Others will select within that artist category
|
||||
|
||||
You can turn it off and maybe add your own in the prefix or suffix prompt fields
|
||||
</font>
|
||||
|
||||
### 🖼️ type of image
|
||||
|
||||
<font size="2">
|
||||
There are an immense number of image types, not only paintings and photo's, but also isometric renders and funko pops.
|
||||
You can however, overwrite it with the most popular ones.
|
||||
|
||||
|
||||
1. all --> normally picks a image type as random. Can choose a 'other' more unique type.
|
||||
|
||||
2. all - force multiple --> idea by redditor WestWordHoeDown, it forces to choose between 2 and 3 image types
|
||||
|
||||
3. photograph
|
||||
|
||||
4. octane render
|
||||
|
||||
5. digital art
|
||||
|
||||
6. concept art
|
||||
|
||||
7. painting
|
||||
|
||||
6. portrait
|
||||
|
||||
7. anime key visual
|
||||
|
||||
8. only other types --> Will pick only from the more unique types, such as stained glass window or a funko pop
|
||||
|
||||
All modes below are considered a special image type mode.
|
||||
|
||||
9. only templates mode --> Will only choose from a set of wildcarded prompt templates. Templates have been gathered from various sources, such as CivitAI, prompthero, promptbook, etc.
|
||||
|
||||
only templates mode is perfect for beginners, who want to see some good results fast.
|
||||
|
||||
10. art blaster mode --> Special generation mode that focusses on art movements, stylings and artists.
|
||||
|
||||
11. quality vomit mode --> Special generation mode that focusses on qualifiers and stylings.
|
||||
|
||||
12. color cannon mode --> Special generation mode that focusses on color scheme's and moods.
|
||||
|
||||
13. unique art mode --> Special generation mode that focusses on other image types, art movements, stylings and lighting.
|
||||
|
||||
14. massive madness mode --> Special generation mode, creates prompt soup. Almost pure randomness.
|
||||
|
||||
15. photo fantasy mode --> Special generation mode that focusses on photographs, cameras, lenses and lighting.
|
||||
|
||||
16. subject only mode --> Will only generate a subject, with no additional frills.
|
||||
|
||||
17. fixed styles mode --> Generate a subject on top of a fixed style.
|
||||
|
||||
18. the tokinator --> Complete random word gibberish mode, use at own risk
|
||||
|
||||
### 🎲🖼️ One in X chance to use special image type mode
|
||||
|
||||
<font size="2">
|
||||
This controls how often it will pick a special generation mode. It is a 1 in X chance. So lower means more often. This will only be applied of "type of image" is set to "all" and there is no Overwrite type of image set.
|
||||
|
||||
When set to 1, it will always pick a random special generation mode. When set to 20, it is a 1 in 20 chance this will happen.
|
||||
</font>
|
||||
|
||||
### 🔃📸 Overwrite subject
|
||||
|
||||
When you fill in the Overwrite subject field, that subject will be used to build the dynamic prompt around. It is best, if you set the subject type to match the subject. For example, set it to humanoid if you place a person in the override subject field.
|
||||
|
||||
This way, you can create unlimited variants of a subject.
|
||||
|
||||
🧠📸 Smart subject tries to determine what to and not to generate based on your subject. Example, if your Overwrite subject is formed like this: Obese man wearing a kimono
|
||||
|
||||
It will then recognize the body type and not generate it. It also recognizes the keyword wearing, and will not generate an outfit.
|
||||
|
||||
### 🔃👗 Overwrite outfit
|
||||
|
||||
When you fill in the override outfit field, it will generate an outfit in the prompt based on the given value. It can be used in combination with override subject, but does not have to be. It works best with smaller descriptions of the outfit.
|
||||
|
||||
An example would be: space suit, red dress, cloak.
|
||||
|
||||
Works best when you set the subjects to to humanoid.
|
||||
|
||||
### Other prompt fields
|
||||
|
||||
The existing prompt and negative prompt fields are ignored.
|
||||
|
||||
Add a prompt prefix, suffix in the respective fields. Add negative prompt in the negative prompt tab. They will be automatically added during processing.
|
||||
|
||||
These can be used to add textual inversion and LoRA's to always apply. They can also be used to add your models trigger words.
|
||||
|
||||
Please read the custom_files documentation on how to apply random textual inversion and LoRA's.
|
||||
|
||||
</font>
|
||||
|
||||
### Filter values
|
||||
<font size="2">
|
||||
You can put comma seperated values here, those will be ignored from any list processing. For example, adding ""film grain, sepia"", will make these values not appear during generation.
|
||||
|
||||
For advanced users, you can create a permanent file in \\OneButtonPrompt\\userfiles\\ called antilist.csv
|
||||
|
||||
This way, you don't ever have to add it manually again. This file won't be overwritten during upgrades.
|
||||
|
||||
Idea by redditor jonesaid.
|
||||
|
||||
</font>
|
||||
"""
|
||||
""")
|
||||
with gr.Row():
|
||||
obp_preset_name = gr.Textbox(
|
||||
show_label=False,
|
||||
placeholder="Name of new preset",
|
||||
interactive=True,
|
||||
visible=True,
|
||||
)
|
||||
obp_preset_save = gr.Button(
|
||||
value="Save as preset",
|
||||
visible=True,
|
||||
)
|
||||
gr.Markdown("""
|
||||
<font size="4">
|
||||
Generation settings:
|
||||
</font>
|
||||
""")
|
||||
|
||||
# End of this part of presets
|
||||
|
||||
with gr.Row(variant="compact"):
|
||||
insanitylevel = gr.Slider(1, 10, value=5, step=1, label="🎲⬅️❔➡️🎲🎲🎲 Higher levels increases complexity and randomness of generated prompt")
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
subject = gr.Dropdown(
|
||||
subjects, label="📸 Subject Types", value="all")
|
||||
with gr.Column(variant="compact"):
|
||||
artist = gr.Dropdown(
|
||||
artists, label="🎨 Artists", value="all")
|
||||
with gr.Row(variant="compact"):
|
||||
chosensubjectsubtypeobject = gr.Dropdown(
|
||||
subjectsubtypesobject, label="🏺 Type of object", value="all", visible=False)
|
||||
chosensubjectsubtypehumanoid = gr.Dropdown(
|
||||
subjectsubtypeshumanoid, label="👨👩👧 Type of humanoids", value="all", visible=False)
|
||||
chosensubjectsubtypeconcept = gr.Dropdown(
|
||||
subjectsubtypesconcept, label="💡🧠💭 Type of concept", value="all", visible=False)
|
||||
chosengender = gr.Dropdown(
|
||||
genders, label="🚻 gender", value="all", visible=False)
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
imagetype = gr.Dropdown(
|
||||
imagetypes, label="🖼️ type of image", value="all")
|
||||
with gr.Column(variant="compact"):
|
||||
imagemodechance = gr.Slider(
|
||||
1, 100, value="20", step=1, label="🎲🖼️ One in X chance to use special image type mode")
|
||||
with gr.Row(variant="compact"):
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Override options (choose the related subject type first for better results)
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
givensubject = gr.Textbox(label="🔃📸 Overwrite subject: ", value="")
|
||||
smartsubject = gr.Checkbox(label="🧠📸 Smart subject", value = True)
|
||||
with gr.Row(variant="compact"):
|
||||
givenoutfit = gr.Textbox(label="🔃👗 Overwrite outfit: ", value="")
|
||||
with gr.Row(variant="compact"):
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Prompt fields
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
prefixprompt = gr.Textbox(label="⬅️💬 Place this in front of generated prompt (prefix)",value="")
|
||||
suffixprompt = gr.Textbox(label="➡️💬 Place this at back of generated prompt (suffix)",value="")
|
||||
with gr.Row(variant="compact"):
|
||||
gr.Markdown("""
|
||||
<font size="2">
|
||||
Additional options
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Row(variant="compact"):
|
||||
giventypeofimage = gr.Textbox(label="🔃🖼️ Overwrite type of image: ", value="")
|
||||
with gr.Row(variant="compact"):
|
||||
with gr.Column(variant="compact"):
|
||||
antistring = gr.Textbox(label="❌📝 Filter out following properties (comma seperated). Example ""film grain, purple, cat"" ")
|
||||
with gr.Accordion("Help", open=False):
|
||||
gr.Markdown(
|
||||
"""
|
||||
### Description
|
||||
|
||||
<font size="2">
|
||||
Just press the normal Generate button.
|
||||
|
||||
This generator will generate a complete full prompt for you and generate the image, based on randomness. You can increase the slider, to include more things to put into the prompt.
|
||||
Recommended is keeping it around 3-7. Use 10 at your own risk.
|
||||
|
||||
There are a lot of special things build in, based on various research papers. Just try it, and let it surprise you.
|
||||
|
||||
Add additional prompting to the prefix, suffix in this screen. The actual prompt fields are ignored. Negative prompt is in the respective tab.
|
||||
</font>
|
||||
|
||||
### 📸 Subject Types
|
||||
|
||||
<font size="2">
|
||||
You can choose a certain subject type, if you want to generate something more specific. It has the following types:
|
||||
|
||||
1. object - Can be a random object, a building or a vehicle.
|
||||
|
||||
2. animal - A random (fictional) animal. Has a chance to have human characteristics, such as clothing added.
|
||||
|
||||
3. humanoid - A random humanoid, males, females, fantasy types, fictional and non-fictional characters. Can add clothing, features and a bunch of other things.
|
||||
|
||||
4. landscape - A landscape or a landscape with a building.
|
||||
|
||||
5. concept - Can be a concept, such as "a X of Y", or an historical event such as "The Trojan War". It can also generate a line from a poem or a song.
|
||||
|
||||
After choosing object, humanoid or concept a subselection menu will show. You can pick further details here. When choosing humanoid, you can also select the gender you wish to generate.
|
||||
|
||||
🏺 Type of Object:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. generic objects - Hodgepodge of objects, can be household items, weapons or any other general object.
|
||||
|
||||
3. vehicles - Cars, but also planes, trains and boats.
|
||||
|
||||
4. food - Meals, fruits and others.
|
||||
|
||||
5. buildings - From churches to libraries to castles.
|
||||
|
||||
6. space - Some bigger objects, nebula's, black holes and constellations
|
||||
|
||||
7. flora - Flowers and trees.
|
||||
|
||||
👨👩👧 Type of humanoid:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. generic humans - Generic human descriptions. Example values would be Man, Woman, Male, etc
|
||||
|
||||
3. generic human relations - Human relations, example values would be Grandpa, Sister, Father, etc
|
||||
|
||||
4. celebrities e.a. - Known people, usually celebrities.
|
||||
|
||||
5. fictional characters - Movie and videogame characters, such as Mario and Peach.
|
||||
|
||||
6. humanoids - Humanoid type races, think Elves, Orcs, Dwarves, etc
|
||||
|
||||
7. based on job or title - Examples are Queen, Carpenter, Vampire hunter
|
||||
|
||||
8. based on first name - Examples are Anna, James, Emma etc.
|
||||
|
||||
🚻 gender:
|
||||
|
||||
1. all - selects randomly
|
||||
|
||||
2. male
|
||||
|
||||
3. female
|
||||
|
||||
💡🧠💭 Type of concept:
|
||||
|
||||
1. all - selects randomly (default)
|
||||
|
||||
2. event - an historical event, or even mythological event. Example The fall of Rome
|
||||
|
||||
3. the X of Y concepts - Randomly creates a small sentence, example The Ocean of Thought or The Fortress of Flame, etc
|
||||
|
||||
4. lines from poems - Picks a line from a poem
|
||||
|
||||
5. lines from songs - Picks a line from a song
|
||||
|
||||
6. names from card based games - Picks a card name from various card games, such as magic the gathering, yugioh and many others.
|
||||
|
||||
</font>
|
||||
|
||||
### 🎨 Artists
|
||||
|
||||
<font size="2">
|
||||
Artists have a major impact on the result.
|
||||
|
||||
1. all - it will cohesivly add about between 0-3 artists and style description.
|
||||
|
||||
2. all (wild) - it will randomly select between 0-3 artists out of 3483 artists for your prompt.
|
||||
|
||||
3. greg mode - Will add greg, or many other popular artists into your prompt. Will also add a lot of quality statements.
|
||||
|
||||
Others will select within that artist category
|
||||
|
||||
You can turn it off and maybe add your own in the prefix or suffix prompt fields
|
||||
</font>
|
||||
|
||||
### 🖼️ type of image
|
||||
|
||||
<font size="2">
|
||||
There are an immense number of image types, not only paintings and photo's, but also isometric renders and funko pops.
|
||||
You can however, overwrite it with the most popular ones.
|
||||
|
||||
|
||||
1. all --> normally picks a image type as random. Can choose a 'other' more unique type.
|
||||
|
||||
2. all - force multiple --> idea by redditor WestWordHoeDown, it forces to choose between 2 and 3 image types
|
||||
|
||||
3. photograph
|
||||
|
||||
4. octane render
|
||||
|
||||
5. digital art
|
||||
|
||||
6. concept art
|
||||
|
||||
7. painting
|
||||
|
||||
6. portrait
|
||||
|
||||
7. anime key visual
|
||||
|
||||
8. only other types --> Will pick only from the more unique types, such as stained glass window or a funko pop
|
||||
|
||||
All modes below are considered a special image type mode.
|
||||
|
||||
9. only templates mode --> Will only choose from a set of wildcarded prompt templates. Templates have been gathered from various sources, such as CivitAI, prompthero, promptbook, etc.
|
||||
|
||||
only templates mode is perfect for beginners, who want to see some good results fast.
|
||||
|
||||
10. art blaster mode --> Special generation mode that focusses on art movements, stylings and artists.
|
||||
|
||||
11. quality vomit mode --> Special generation mode that focusses on qualifiers and stylings.
|
||||
|
||||
12. color cannon mode --> Special generation mode that focusses on color scheme's and moods.
|
||||
|
||||
13. unique art mode --> Special generation mode that focusses on other image types, art movements, stylings and lighting.
|
||||
|
||||
14. massive madness mode --> Special generation mode, creates prompt soup. Almost pure randomness.
|
||||
|
||||
15. photo fantasy mode --> Special generation mode that focusses on photographs, cameras, lenses and lighting.
|
||||
|
||||
16. subject only mode --> Will only generate a subject, with no additional frills.
|
||||
|
||||
17. fixed styles mode --> Generate a subject on top of a fixed style.
|
||||
|
||||
18. the tokinator --> Complete random word gibberish mode, use at own risk
|
||||
|
||||
### 🎲🖼️ One in X chance to use special image type mode
|
||||
|
||||
<font size="2">
|
||||
This controls how often it will pick a special generation mode. It is a 1 in X chance. So lower means more often. This will only be applied of "type of image" is set to "all" and there is no Overwrite type of image set.
|
||||
|
||||
When set to 1, it will always pick a random special generation mode. When set to 20, it is a 1 in 20 chance this will happen.
|
||||
</font>
|
||||
|
||||
### 🔃📸 Overwrite subject
|
||||
|
||||
When you fill in the Overwrite subject field, that subject will be used to build the dynamic prompt around. It is best, if you set the subject type to match the subject. For example, set it to humanoid if you place a person in the override subject field.
|
||||
|
||||
This way, you can create unlimited variants of a subject.
|
||||
|
||||
🧠📸 Smart subject tries to determine what to and not to generate based on your subject. Example, if your Overwrite subject is formed like this: Obese man wearing a kimono
|
||||
|
||||
It will then recognize the body type and not generate it. It also recognizes the keyword wearing, and will not generate an outfit.
|
||||
|
||||
### 🔃👗 Overwrite outfit
|
||||
|
||||
When you fill in the override outfit field, it will generate an outfit in the prompt based on the given value. It can be used in combination with override subject, but does not have to be. It works best with smaller descriptions of the outfit.
|
||||
|
||||
An example would be: space suit, red dress, cloak.
|
||||
|
||||
Works best when you set the subjects to to humanoid.
|
||||
|
||||
### Other prompt fields
|
||||
|
||||
The existing prompt and negative prompt fields are ignored.
|
||||
|
||||
Add a prompt prefix, suffix in the respective fields. Add negative prompt in the negative prompt tab. They will be automatically added during processing.
|
||||
|
||||
These can be used to add textual inversion and LoRA's to always apply. They can also be used to add your models trigger words.
|
||||
|
||||
Please read the custom_files documentation on how to apply random textual inversion and LoRA's.
|
||||
|
||||
</font>
|
||||
|
||||
### Filter values
|
||||
<font size="2">
|
||||
You can put comma seperated values here, those will be ignored from any list processing. For example, adding ""film grain, sepia"", will make these values not appear during generation.
|
||||
|
||||
For advanced users, you can create a permanent file in \\OneButtonPrompt\\userfiles\\ called antilist.csv
|
||||
|
||||
This way, you don't ever have to add it manually again. This file won't be overwritten during upgrades.
|
||||
|
||||
Idea by redditor jonesaid.
|
||||
|
||||
</font>
|
||||
"""
|
||||
)
|
||||
with gr.Tab("Workflow assist"):
|
||||
with gr.Row(variant="compact"):
|
||||
silentmode = gr.Checkbox(
|
||||
@@ -863,6 +901,148 @@ class Script(scripts.Script):
|
||||
|
||||
automatedoutputsfolderbutton.click(openfolder)
|
||||
|
||||
obp_outputs = [
|
||||
obp_preset_name,
|
||||
obp_preset_save,
|
||||
insanitylevel,
|
||||
subject,
|
||||
artist,
|
||||
chosensubjectsubtypeobject,
|
||||
chosensubjectsubtypehumanoid,
|
||||
chosensubjectsubtypeconcept,
|
||||
chosengender,
|
||||
imagetype,
|
||||
imagemodechance,
|
||||
givensubject,
|
||||
smartsubject,
|
||||
givenoutfit,
|
||||
prefixprompt,
|
||||
suffixprompt,
|
||||
giventypeofimage,
|
||||
antistring,
|
||||
]
|
||||
|
||||
|
||||
def act_obp_preset_save(
|
||||
obp_preset_name,
|
||||
obp_preset_save,
|
||||
insanitylevel,
|
||||
subject,
|
||||
artist,
|
||||
chosensubjectsubtypeobject,
|
||||
chosensubjectsubtypehumanoid,
|
||||
chosensubjectsubtypeconcept,
|
||||
chosengender,
|
||||
imagetype,
|
||||
imagemodechance,
|
||||
givensubject,
|
||||
smartsubject,
|
||||
givenoutfit,
|
||||
prefixprompt,
|
||||
suffixprompt,
|
||||
giventypeofimage,
|
||||
antistring,
|
||||
):
|
||||
if obp_preset_name != "":
|
||||
obp_options = OBPresets.load_obp_presets()
|
||||
opts = {
|
||||
"insanitylevel": insanitylevel,
|
||||
"subject": subject,
|
||||
"artist": artist,
|
||||
"chosensubjectsubtypeobject": chosensubjectsubtypeobject,
|
||||
"chosensubjectsubtypehumanoid": chosensubjectsubtypehumanoid,
|
||||
"chosensubjectsubtypeconcept": chosensubjectsubtypeconcept,
|
||||
"chosengender": chosengender,
|
||||
"imagetype": imagetype,
|
||||
"imagemodechance": imagemodechance,
|
||||
"givensubject": givensubject,
|
||||
"smartsubject": smartsubject,
|
||||
"givenoutfit": givenoutfit,
|
||||
"prefixprompt": prefixprompt,
|
||||
"suffixprompt": suffixprompt,
|
||||
"giventypeofimage": giventypeofimage,
|
||||
"antistring": antistring
|
||||
}
|
||||
obp_options[obp_preset_name] = opts
|
||||
OBPresets.save_obp_preset(obp_options)
|
||||
choices = list(obp_options.keys()) + [
|
||||
OBPresets.CUSTOM_OBP
|
||||
]
|
||||
return gr.update(choices=choices, value=obp_preset_name)
|
||||
else:
|
||||
return gr.update()
|
||||
|
||||
obp_preset_save.click(act_obp_preset_save,
|
||||
inputs=obp_outputs,
|
||||
outputs=[OBP_preset],
|
||||
)
|
||||
|
||||
|
||||
def obppreset_changed(selection):
|
||||
if selection == OBPresets.CUSTOM_OBP:
|
||||
return (
|
||||
[obp_preset_name.update(value="", visible=True)]
|
||||
+ [maingroup.update(visible=True)]
|
||||
)
|
||||
|
||||
else:
|
||||
return (
|
||||
[obp_preset_name.update(visible=False)]
|
||||
+ [maingroup.update(visible=False)]
|
||||
)
|
||||
OBP_preset.change(obppreset_changed,
|
||||
inputs=[OBP_preset],
|
||||
outputs=[obp_preset_name] + [maingroup]
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def OBPPreset_changed_update_custom(selection):
|
||||
# Skip if Custom was selected
|
||||
if selection == OBPresets.CUSTOM_OBP:
|
||||
return [gr.update()] * 16
|
||||
|
||||
# Update Custom values based on selected One Button preset
|
||||
selected_opb_preset = OBPresets.get_obp_preset(selection)
|
||||
return [
|
||||
insanitylevel.update(value=selected_opb_preset["insanitylevel"]),
|
||||
subject.update(value=selected_opb_preset["subject"]),
|
||||
artist.update(value=selected_opb_preset["artist"]),
|
||||
chosensubjectsubtypeobject.update(value=selected_opb_preset["chosensubjectsubtypeobject"]),
|
||||
chosensubjectsubtypehumanoid.update(value=selected_opb_preset["chosensubjectsubtypehumanoid"]),
|
||||
chosensubjectsubtypeconcept.update(value=selected_opb_preset["chosensubjectsubtypeconcept"]),
|
||||
chosengender.update(value=selected_opb_preset["chosengender"]),
|
||||
imagetype.update(value=selected_opb_preset["imagetype"]),
|
||||
imagemodechance.update(value=selected_opb_preset["imagemodechance"]),
|
||||
givensubject.update(value=selected_opb_preset["givensubject"]),
|
||||
smartsubject.update(value=selected_opb_preset["smartsubject"]),
|
||||
givenoutfit.update(value=selected_opb_preset["givenoutfit"]),
|
||||
prefixprompt.update(value=selected_opb_preset["prefixprompt"]),
|
||||
suffixprompt.update(value=selected_opb_preset["suffixprompt"]),
|
||||
giventypeofimage.update(value=selected_opb_preset["giventypeofimage"]),
|
||||
antistring.update(value=selected_opb_preset["antistring"]),
|
||||
]
|
||||
OBP_preset.change(OBPPreset_changed_update_custom,
|
||||
inputs=[OBP_preset],
|
||||
outputs=[insanitylevel] +
|
||||
[subject] +
|
||||
[artist] +
|
||||
[chosensubjectsubtypeobject] +
|
||||
[chosensubjectsubtypehumanoid] +
|
||||
[chosensubjectsubtypeconcept] +
|
||||
[chosengender] +
|
||||
[imagetype] +
|
||||
[imagemodechance] +
|
||||
[givensubject] +
|
||||
[smartsubject] +
|
||||
[givenoutfit] +
|
||||
[prefixprompt] +
|
||||
[suffixprompt] +
|
||||
[giventypeofimage] +
|
||||
[antistring],
|
||||
)
|
||||
|
||||
# turn things on and off for gender
|
||||
def subjectsvalue(subject):
|
||||
enable=(subject=="humanoid")
|
||||
|
||||
@@ -51,6 +51,15 @@ It will generate a prompt from scratch, or based on several of your inputs and s
|
||||
|
||||
Please refer to the other documentation to see what each setting does.
|
||||
|
||||
## One Button Preset
|
||||
|
||||
Preset settings of One Button Prompt. Refer to [One Button Presets](https://github.com/AIrjen/OneButtonPrompt/blob/main/user_guides/one_butten_presets.md) for more information regarding the presets.
|
||||
|
||||
Has a simple prompt output and a preset selector. You can add new presets by manual adjusting the /userfiles/obp_presets.json JSON file.
|
||||
|
||||

|
||||
|
||||
|
||||
## Create Prompt Variant
|
||||
You can use the "Create Prompt Variant" node, to create variants based on a prompt you input. The strength of the variant is set with the "insanity level" slider. Simply connect it between the positive prompt and the CLIP encoder module.
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# One Button Presets
|
||||
|
||||
One Button Presets are saved generation settings that can be instantly loaded up. You can save your own presets as well.
|
||||
|
||||
This will make it easier to get good results out of One Button Prompt. There is a large set of presets available. These are to show of some of the tweaks and logic you can do and achieve with the settings.
|
||||
|
||||
Set the One Button Preset to __"Custom..."__ to show all settings.
|
||||
|
||||
## The Presets
|
||||
|
||||
The following presets are available on default.
|
||||
|
||||
- Standard -> One Button Prompts default. Wild and unpredictable. Good for prompt exploration.
|
||||
- Consistent results -> Running on a large set of build in styles, to get consistent results in prompts. Works best on SDXL.
|
||||
- Unique People Portraits -> Focus on generating photographic people portraits.
|
||||
- Artful People Portraits -> Focus on people portraits, mixed with portrait style artists.
|
||||
- D&D Style Portraits -> Focus on generating fantasy style portraits,
|
||||
- Cybernetic Animals -> Animals from the future enhanced with cybernetics.
|
||||
- Greg mode - The Preset -> Focusses on creating characters, mixed with popular artists (like Greg Rutkowski). Works best on SD 1.5 models.
|
||||
- Waifu's -> Anime style females. Works best on SD 1.5 anime style models.
|
||||
- Husbando's -> Anime style males. Works best on SD 1.5 anime style models.
|
||||
- Fashion Models -> Perfect fashiom models showing of fashion outfits.
|
||||
- WIERD HATS -> WIERD HATS! WIERD HATS! WIERD HATS!
|
||||
- Wallpaper art -> Conceptual images to generate wallpapers. Works best on more all-purpose models.
|
||||
- The Connaissuer -> Generates interesting artstyles mixed with poemlines to create varied images.
|
||||
- Interesting Landscapes -> For the landscape enthusiast!
|
||||
- Relaxing Seascapes -> Ahhh, paintings of the sea. Sit back and relax.
|
||||
- Architecture -> Buildings and architecture.
|
||||
- Nature -> Nature-inspired subjects and themes.
|
||||
- Let the CFG sort it out -> Lots of sentences and words. Works best on SDXL models.
|
||||
- Now this is podracing -> Massive prompts full of any nonsense. Just for fun.
|
||||
|
||||
|
||||
## How to save a new preset
|
||||
Set the One Button Preset to __"Custom..."__ to show all settings.
|
||||
|
||||
All settings are shown for the previously selected Preset.
|
||||
|
||||
If you want to save a new preset, type the name you want to save as, and press 'Save as preset'
|
||||
|
||||

|
||||
|
||||
This will save the new preset, and will remove all options again.
|
||||
|
||||
## How to override a preset
|
||||
If you type an existing preset name in the preset name field, and press 'Save as preset'. It will overwrite that preset with the new settings.
|
||||
|
||||
## Where are presets stored?
|
||||
Presets are stored in the /userfiles/ folder in JSON format. The file is named obp_presets.json
|
||||
|
||||
The file will not be there on first download, but will be created on first startup. This is to prevent issues with version control.
|
||||
|
||||
You can edit this file, and remove and change settings.
|
||||
Reference in New Issue
Block a user