diff --git a/OneButtonPromptNodes.py b/OneButtonPromptNodes.py index 2d3e6e9..81adc6a 100644 --- a/OneButtonPromptNodes.py +++ b/OneButtonPromptNodes.py @@ -351,6 +351,14 @@ class OneButtonPrompt: "multiline": False, # This is the overwrite for an outfit, super nice "default": "" }), + "prompt_prefix": ("STRING", { + "multiline": False, # prefix the prompt + "default": "" + }), + "prompt_suffix": ("STRING", { + "multiline": False, # Suffix of the prompt + "default": "" + }), "humanoids_gender": (genders, {"default": "all"}), "emojis":(emojis, {"default": False}), "base_model":(models, {"default": "SDXL"}), @@ -369,8 +377,8 @@ class OneButtonPrompt: CATEGORY = "OneButtonPrompt" - def Comfy_OBP(self, insanitylevel, custom_subject, seed, artist, imagetype, subject, imagemodechance, humanoids_gender, emojis, custom_outfit, base_model, prompt_enhancer): - generatedpromptlist = build_dynamic_prompt(insanitylevel,subject,artist,imagetype,False,"","","",1,"",custom_subject,True,"",imagemodechance, humanoids_gender,"all", "all", "all", False, emojis, seed, custom_outfit, True, base_model, "", prompt_enhancer) + def Comfy_OBP(self, insanitylevel, custom_subject, seed, artist, imagetype, subject, imagemodechance, humanoids_gender, emojis, custom_outfit, base_model, prompt_enhancer, prompt_prefix, prompt_suffix): + generatedpromptlist = build_dynamic_prompt(insanitylevel,subject,artist,imagetype,False,"",prompt_prefix,prompt_suffix,1,"",custom_subject,True,"",imagemodechance, humanoids_gender,"all", "all", "all", False, emojis, seed, custom_outfit, True, base_model, "", prompt_enhancer) #print(generatedprompt) generatedprompt = generatedpromptlist[0] prompt_g = generatedpromptlist[1] @@ -579,7 +587,15 @@ class OneButtonPreset: }, "optional": { "base_model":(models, {"default": "SDXL"}), - "prompt_enhancer":(prompt_enhancers, {"default": "none"}), + "prompt_enhancer":(prompt_enhancers, {"default": "none"}), + "preset_prefix": ("STRING", { + "multiline": False, # prefix the preset + "default": "" + }), + "preset_suffix": ("STRING", { + "multiline": False, # Suffix of the preset + "default": "" + }), "seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFFFFFFFFFF}), }, } @@ -594,7 +610,7 @@ class OneButtonPreset: CATEGORY = "OneButtonPrompt" - def Comfy_OBP_OneButtonPreset(self, OneButtonPreset, seed, base_model, prompt_enhancer): + def Comfy_OBP_OneButtonPreset(self, OneButtonPreset, seed, base_model, prompt_enhancer, preset_prefix, preset_suffix): # load the stuff if(OneButtonPreset == OBPresets.RANDOM_PRESET_OBP): selected_opb_preset = OBPresets.get_obp_preset("Standard") @@ -640,6 +656,8 @@ class OneButtonPreset: base_model=base_model, OBP_preset=OneButtonPreset, prompt_enhancer=prompt_enhancer, + preset_prefix=preset_prefix, + preset_suffix=preset_suffix, ) diff --git a/README.md b/README.md index a857c15..d8f0a9d 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ You an use the Subject Types filter to select on main subject types to generate. 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 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" +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 "all - anime" Special image type modes have chance to trigger. Those follow different rules of prompt generation. diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index c87afb4..2613c94 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -13,7 +13,7 @@ OBPresets = OneButtonPresets() # insanity level controls randomness of propmt 0-10 # forcesubject van be used to force a certain type of subject # Set artistmode to none, to exclude artists -def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all", onlyartists = False, antivalues = "", prefixprompt = "", suffixprompt ="",promptcompounderlevel ="1", seperator = "comma", givensubject="",smartsubject = True,giventypeofimage="", imagemodechance = 20, gender = "all", subtypeobject="all", subtypehumanoid="all", subtypeconcept="all", advancedprompting=True, hardturnoffemojis=False, seed=-1, overrideoutfit="", prompt_g_and_l = False, base_model = "SD1.5", OBP_preset = "", prompt_enhancer = "none", subtypeanimal="all", subtypelocation="all"): +def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all", onlyartists = False, antivalues = "", prefixprompt = "", suffixprompt ="",promptcompounderlevel ="1", seperator = "comma", givensubject="",smartsubject = True,giventypeofimage="", imagemodechance = 20, gender = "all", subtypeobject="all", subtypehumanoid="all", subtypeconcept="all", advancedprompting=True, hardturnoffemojis=False, seed=-1, overrideoutfit="", prompt_g_and_l = False, base_model = "SD1.5", OBP_preset = "", prompt_enhancer = "none", subtypeanimal="all", subtypelocation="all", preset_prefix = "", preset_suffix = ""): remove_weights = False less_verbose = False @@ -105,6 +105,9 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all giventypeofimage = selected_opb_preset["giventypeofimage"] antistring = selected_opb_preset["antistring"] + prefixprompt = preset_prefix + ", " + prefixprompt + suffixprompt = preset_suffix + ", " + suffixprompt + # new method of subject choosing from the interface, lets translate this: # really hacky way of doing this now. if("-" in forcesubject): diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index a331483..ec453bb 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -37,7 +37,6 @@ Anaglyph Anatomical Illustration Ancient Egyptian Art Animation -Anime key visual Anthotype Print Aquatint Architectural Digest diff --git a/csvfiles/special_lists/wordcombis.csv b/csvfiles/special_lists/wordcombis.csv index 6a1768a..ec84d7b 100644 --- a/csvfiles/special_lists/wordcombis.csv +++ b/csvfiles/special_lists/wordcombis.csv @@ -17,7 +17,7 @@ futuristic, sci fi, sci-fi, modern, technology fashionable, fashion, haute couture, avant-garde concept art, fantasy, sci-fi, science fiction, D&D, digital art cinema, cinematic, cinestill, movie still, cinemascope -anime, manga, anime key visual, key visual, studio anime, anime style, anime sketch +anime, manga, studio anime, anime style, anime sketch funny, whimsical, fun, amusing authentic, traditional, classic, indigenous, ethnic monochromatic, greyscale, BW, black and white, stark diff --git a/csvfiles/templates/styles.csv b/csvfiles/templates/styles.csv index fa08373..8dc28aa 100644 --- a/csvfiles/templates/styles.csv +++ b/csvfiles/templates/styles.csv @@ -1,6 +1,6 @@ professional 3d model -subject-, octane render, highly detailed, volumetric, dramatic lighting analog film photo -subject-, faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage -anime artwork -subject-, anime style, key visual, vibrant, studio anime, highly detailed +anime artwork -subject-, anime style, vibrant, studio anime, highly detailed cinematic film still -subject-, shallow depth of field, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy comic -subject-, graphic illustration, comic art, graphic novel art, vibrant, highly detailed play-doh style -subject-, sculpture, clay art, centered composition, Claymation diff --git a/csvfiles/vomit.csv b/csvfiles/vomit.csv index 5426c36..49a9b20 100644 --- a/csvfiles/vomit.csv +++ b/csvfiles/vomit.csv @@ -90,7 +90,6 @@ Impressionism Instagram intricate intricate details -key visual Kintsugi layered textures League of Legends Splash Art diff --git a/csvfiles/vomit_medium.csv b/csvfiles/vomit_medium.csv index c8749fd..c3e6806 100644 --- a/csvfiles/vomit_medium.csv +++ b/csvfiles/vomit_medium.csv @@ -59,7 +59,6 @@ Impasto Instagram intricate intricate details -key visual Kintsugi layered textures League of Legends Splash Art diff --git a/presets/obp_presets.default b/presets/obp_presets.default index 1e1c7f9..b67b1d8 100644 --- a/presets/obp_presets.default +++ b/presets/obp_presets.default @@ -151,13 +151,13 @@ "chosensubjectsubtypehumanoid": "all", "chosensubjectsubtypeconcept": "all", "chosengender": "female", - "imagetype": "subject only mode", + "imagetype": "all - anime", "imagemodechance": "20", "givensubject": "-basicbitchdescriptor- 1girl, solo,", "smartsubject": true, "givenoutfit": "", "prefixprompt": "(((masterpiece))), (((best quality))), anime style, 2d,", - "suffixprompt": "key visual", + "suffixprompt": "", "giventypeofimage": "", "antistring": "" }, @@ -169,13 +169,13 @@ "chosensubjectsubtypehumanoid": "all", "chosensubjectsubtypeconcept": "all", "chosengender": "male", - "imagetype": "subject only mode", + "imagetype": "all - anime", "imagemodechance": "20", "givensubject": "-basicbitchdescriptor- 1boy, solo,", "smartsubject": true, "givenoutfit": "", "prefixprompt": "(((masterpiece))), (((best quality))), anime style, 2d,", - "suffixprompt": "key visual", + "suffixprompt": "", "giventypeofimage": "", "antistring": "" }, diff --git a/prompttester.py b/prompttester.py index 74938d4..e63c674 100644 --- a/prompttester.py +++ b/prompttester.py @@ -11,7 +11,7 @@ from build_dynamic_prompt import * -def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", imagetype="all",onlyartists=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender = "all", subtypeobject = "all", subtypehumanoid = "all", subtypeconcept = "all", advancedprompting = True, hardturnoffemojis=False, seed=0, overrideoutfit="", prompt_g_and_l = False, base_model = "SD1.5", OBP_preset = "", prompt_enhancer="none"): +def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", imagetype="all",onlyartists=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender = "all", subtypeobject = "all", subtypehumanoid = "all", subtypeconcept = "all", advancedprompting = True, hardturnoffemojis=False, seed=0, overrideoutfit="", prompt_g_and_l = False, base_model = "SD1.5", OBP_preset = "", prompt_enhancer="none", preset_prefix = "", preset_suffix =""): loops = int(amount) # amount of images to generate steps = 0 @@ -27,7 +27,7 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im print(resultlist[2]) else: - result = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, onlyartists,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, subtypeobject, subtypehumanoid, subtypeconcept, advancedprompting, hardturnoffemojis, seed, overrideoutfit, prompt_g_and_l, base_model, OBP_preset, prompt_enhancer) + result = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, onlyartists,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, subtypeobject, subtypehumanoid, subtypeconcept, advancedprompting, hardturnoffemojis, seed, overrideoutfit, prompt_g_and_l, base_model, OBP_preset, prompt_enhancer,"","", preset_prefix, preset_suffix) #if(superprompter): # load_models() @@ -133,4 +133,6 @@ if __name__ == "__main__": , "SDXL" #base model , "" #preset "All (random)..." , "" # superprompter + , "hello" # preset prefix + , "" # preset suffix ) \ No newline at end of file