add PromptStylerNegative & PromptStylerPositive nodes

This commit is contained in:
unknown
2023-08-10 21:48:37 +07:00
parent ea1bcb3b38
commit dde2c977f0
8 changed files with 167 additions and 963 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import importlib.util
import glob
import os
import sys
from .Uarefans import init, get_ext_dir
from .main import init, get_ext_dir
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
View File
+62
View File
@@ -0,0 +1,62 @@
import csv
import os
import sys
import comfy.utils
csv_file_path = os.path.join(os.path.dirname(__file__), "..", "styles", "styles-negative.csv")
class FansPromptStylerNegative:
styles = None
def __init__(self):
pass
def handle_prompt_change(self, value):
print("New prompt value:", value)
@classmethod
def INPUT_TYPES(cls):
if not os.path.exists(csv_file_path):
cls.styles = [["No Styles.csv", "", ""]]
else:
with open(csv_file_path, "r") as f:
reader = csv.reader(f, dialect='excel')
cls.styles = [row for row in reader if len(row) == 2 and row[1] != "prompt" and row[0] != "None"]
cls.styles.insert(0, ["None", "", ""])
style_names = [row[0] for row in cls.styles]
return {
"required": {
"style": (style_names, {"default": style_names[0]}),
"structure": (["Beginning", "End"],{"default":"Beginning"}),
"prompt": ("STRING", {"multiline": True, "default": "Input Your Negative Prompt Here"}),
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("result",)
FUNCTION = "func"
OUTPUT_NODE = False
CATEGORY = "utils"
def func(self, style, structure, prompt):
result=""
if style=="None":
result=prompt
else:
for row in self.styles:
if row[0] == style:
result += row[1]
if structure == 'Beginning':
result = prompt + ", " + result
else:
result = result + ", " + prompt
return result,
NODE_CLASS_MAPPINGS = {
"Fans Prompt Styler Negative": FansPromptStylerNegative
}
+61
View File
@@ -0,0 +1,61 @@
import csv
import os
import sys
import comfy.utils
csv_file_path = os.path.join(os.path.dirname(__file__), "..", "styles", "styles-positive.csv")
class FansPromptStylerPositive:
styles = None
def __init__(self):
pass
def handle_prompt_change(self, value):
print("New prompt value:", value)
@classmethod
def INPUT_TYPES(cls):
if not os.path.exists(csv_file_path):
cls.styles = [["No Styles.csv", "", ""]]
else:
with open(csv_file_path, "r") as f:
reader = csv.reader(f, dialect='excel')
cls.styles = [row for row in reader if len(row) == 2 and row[1] != "prompt" and row[0] != "None"]
cls.styles.insert(0, ["None", "", ""])
style_names = [row[0] for row in cls.styles]
return {
"required": {
"style": (style_names, {"default": style_names[0]}),
"prompt": ("STRING", {"multiline": True, "default": "Input Your Prompt Here"}),
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("result",)
FUNCTION = "func"
OUTPUT_NODE = False
CATEGORY = "utils"
def func(self, style, prompt):
result=""
if style=="None":
result=prompt
else:
for row in self.styles:
if row[0] == style:
result += row[1]
if "{prompt}" not in result:
result = prompt + " " + result
else:
result = result.replace("{prompt}", prompt)
return result,
NODE_CLASS_MAPPINGS = {
"Fans Prompt Styler Positive": FansPromptStylerPositive
}
+5
View File
@@ -0,0 +1,5 @@
Negative Prompt,
--------,--------
"Sebastian_Kamph_SD1.5_Negative","canvas frame, {prompt}, (high contrast:1.2), (over saturated:1.2), (glossy:1.1), cartoon, 3d, ((disfigured)), ((bad art)), ((b&w)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), Photoshop, video game, ugly, tiling, poorly drawn hands, 3d render"
"Sebastian_Kamph_SD1.5_Negative (sfw)","NSFW, Cleavage, Pubic Hair, Nudity, Naked, Au naturel, Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers"
"Sebastian_Kamph_SD1.5_Negative (Low Token)","lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
1 Negative Prompt
2 -------- --------
3 Sebastian_Kamph_SD1.5_Negative canvas frame, {prompt}, (high contrast:1.2), (over saturated:1.2), (glossy:1.1), cartoon, 3d, ((disfigured)), ((bad art)), ((b&w)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), Photoshop, video game, ugly, tiling, poorly drawn hands, 3d render
4 Sebastian_Kamph_SD1.5_Negative (sfw) NSFW, Cleavage, Pubic Hair, Nudity, Naked, Au naturel, Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers
5 Sebastian_Kamph_SD1.5_Negative (Low Token) lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry
+38
View File
@@ -0,0 +1,38 @@
Positive Prompt,
------,------
G-bright,"a bright photo of the {prompt},"
G-CloseUp,"a close-up photo of {prompt},"
G-Cropped,"a cropped photo of {prompt},"
G-Dark,"a dark photo of the {prompt},"
G-Good,"a good photo of {prompt},"
G-Photo,"a photo of {prompt},"
G-Render,"a rendering of {prompt},"
G-Rendetion,"a rendition of {prompt},"
G-ThePhoto,"the photo of {prompt},"
------,------
Action,"An Action scene {prompt},"
Adventure,"An Adventure scene {prompt},"
Bright and vibrant,"A Bright and vibrant capture {prompt},"
Dark and moody,"A Dark and moody snapshot {prompt},"
Documentary,"A Documentary photo {prompt},"
Fantasy,"A Fantasy shot {prompt},"
Historical,"A Historical image {prompt},"
Horror,"A Horror photograph {prompt},"
Mystical,"A Mystical picture {prompt},"
Romantic,"A Romantic photo {prompt},"
Rustic,"A Rustic shot {prompt},"
------,------
Aerial Shots,"An Aerial Shots capture {prompt},"
Cinematic,"A Cinematic photograph {prompt},"
Event,"An Event snapshot {prompt},"
Fashion,"A Fashion shot {prompt},"
General,"A General photo {prompt},"
Landscape,"A Breathtaking Landscape {prompt},"
Nostalgic Style,"A Nostalgic Style capture {prompt},"
Portrait,"A Stunning Portrait {prompt},"
Portraiture,"A Captivating Portraiture {prompt},"
Product,"An Artistic Product shot {prompt},"
Sports,"An Energetic Sports capture {prompt},"
Street,"A Vivid Street photo {prompt},"
Vintage Film,"A Vintage Film-inspired shot {prompt},"
Wildlife,A Wildlife snapshot {prompt}
1 Positive Prompt
2 ------ ------
3 G-bright a bright photo of the {prompt},
4 G-CloseUp a close-up photo of {prompt},
5 G-Cropped a cropped photo of {prompt},
6 G-Dark a dark photo of the {prompt},
7 G-Good a good photo of {prompt},
8 G-Photo a photo of {prompt},
9 G-Render a rendering of {prompt},
10 G-Rendetion a rendition of {prompt},
11 G-ThePhoto the photo of {prompt},
12 ------ ------
13 Action An Action scene {prompt},
14 Adventure An Adventure scene {prompt},
15 Bright and vibrant A Bright and vibrant capture {prompt},
16 Dark and moody A Dark and moody snapshot {prompt},
17 Documentary A Documentary photo {prompt},
18 Fantasy A Fantasy shot {prompt},
19 Historical A Historical image {prompt},
20 Horror A Horror photograph {prompt},
21 Mystical A Mystical picture {prompt},
22 Romantic A Romantic photo {prompt},
23 Rustic A Rustic shot {prompt},
24 ------ ------
25 Aerial Shots An Aerial Shots capture {prompt},
26 Cinematic A Cinematic photograph {prompt},
27 Event An Event snapshot {prompt},
28 Fashion A Fashion shot {prompt},
29 General A General photo {prompt},
30 Landscape A Breathtaking Landscape {prompt},
31 Nostalgic Style A Nostalgic Style capture {prompt},
32 Portrait A Stunning Portrait {prompt},
33 Portraiture A Captivating Portraiture {prompt},
34 Product An Artistic Product shot {prompt},
35 Sports An Energetic Sports capture {prompt},
36 Street A Vivid Street photo {prompt},
37 Vintage Film A Vintage Film-inspired shot {prompt},
38 Wildlife A Wildlife snapshot {prompt}
-6
View File
@@ -1,6 +0,0 @@
name,positive,negative
Manga,"Pencil drawing {prompt}, Black and White, B&W, Low detail, sketch, concept art, Manga style, Anime style, line art, webtoon, manhua, chalk, hand drawn, defined lines, simple shades, simplistic, manga page, minimalistic","pencil, logo, Glasses, Watermark, bad artist, blur, blurry, text, 3d, bad art, poorly drawn, disfigured, deformed, extra limbs, ugly hands, extra fingers"
Oil Portrait,"modelshoot style of {prompt}, (extremely detailed CG unity 8k wallpaper), professional majestic oil painting by Ed Blinkey, Atey Ghailan, Studio Ghibli, by Jeremy Mann, Greg Manchess, Antonio Moro, trending on ArtStation, trending on pencil sketch of {prompt} CGSociety, Intricate, High Detail, Sharp focus, dramatic, photorealistic painting art by midjourney and greg rutkowski","canvas frame, cartoon, 3d, ((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((close up)),((b&w)), weird colors, blurry, (((duplicate))), ((morbid)), ((mutilated)), [out of frame], extra fingers, mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), out of frame, ugly, extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), Photoshop, video game, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed, cross-eye, body out of frame, blurry, bad art, bad anatomy, 3d render"
Sketch,"Sketch of {prompt}, Manga Sketch, Pencil drawing, Black and White, Manga, Manga style, Low detail, Line art, vector art, Monochromatic, by katsuhiro otomo and masamune shirow and studio ghilibi and yukito kishiro","pencil, logo, Glasses, Watermark, bad artist, blur, blurry, text, 3d, bad art, poorly drawn, disfigured, deformed, extra limbs, ugly hands, extra fingers"
5yo drawing,A drawing of {prompt} by a 5yo,"Photo, realistic, paper, pencil ,canvas"
Oil painting,Realistic and very detailed oil painting of {prompt},"Blurry, sketch, deformed"
1 name positive negative
2 Manga Pencil drawing {prompt}, Black and White, B&W, Low detail, sketch, concept art, Manga style, Anime style, line art, webtoon, manhua, chalk, hand drawn, defined lines, simple shades, simplistic, manga page, minimalistic pencil, logo, Glasses, Watermark, bad artist, blur, blurry, text, 3d, bad art, poorly drawn, disfigured, deformed, extra limbs, ugly hands, extra fingers
3 Oil Portrait modelshoot style of {prompt}, (extremely detailed CG unity 8k wallpaper), professional majestic oil painting by Ed Blinkey, Atey Ghailan, Studio Ghibli, by Jeremy Mann, Greg Manchess, Antonio Moro, trending on ArtStation, trending on pencil sketch of {prompt} CGSociety, Intricate, High Detail, Sharp focus, dramatic, photorealistic painting art by midjourney and greg rutkowski canvas frame, cartoon, 3d, ((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((close up)),((b&w)), weird colors, blurry, (((duplicate))), ((morbid)), ((mutilated)), [out of frame], extra fingers, mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), out of frame, ugly, extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), Photoshop, video game, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed, cross-eye, body out of frame, blurry, bad art, bad anatomy, 3d render
4 Sketch Sketch of {prompt}, Manga Sketch, Pencil drawing, Black and White, Manga, Manga style, Low detail, Line art, vector art, Monochromatic, by katsuhiro otomo and masamune shirow and studio ghilibi and yukito kishiro pencil, logo, Glasses, Watermark, bad artist, blur, blurry, text, 3d, bad art, poorly drawn, disfigured, deformed, extra limbs, ugly hands, extra fingers
5 5yo drawing A drawing of {prompt} by a 5yo Photo, realistic, paper, pencil ,canvas
6 Oil painting Realistic and very detailed oil painting of {prompt} Blurry, sketch, deformed
-956
View File
@@ -44,959 +44,3 @@ Trichromatic,Trichromatic
Turquoise,Turquoise
Vibrance / Vivid,Vibrance / Vivid
Warm Color Palette,Warm Color Palette
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
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