Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,087 Bytes
3542be4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
def remove_duplicates(base_prompt):
# ใฟใฐใฎ้่คใๅใ้คใ
prompt_list = base_prompt.split(", ")
seen = set()
unique_tags = []
for tag in prompt_list :
tag_clean = tag.lower().strip()
if tag_clean not in seen and tag_clean != "":
unique_tags.append(tag)
seen.add(tag_clean)
return ", ".join(unique_tags)
def remove_color(base_prompt):
# ใฟใฐใฎ่ฒๆ
ๅ ฑใๅใ้คใ
prompt_list = base_prompt.split(", ")
color_list = ["pink", "red", "orange", "brown", "yellow", "green", "blue", "purple", "blonde", "colored skin", "white hair"]
# ใซใฉใผใฟใฐใ้คๅปใใพใใ
cleaned_tags = [tag for tag in prompt_list if all(color.lower() not in tag.lower() for color in color_list)]
return ", ".join(cleaned_tags)
def execute_prompt(execute_tags, base_prompt):
prompt_list = base_prompt.split(", ")
# execute_tagsใ้คๅป
filtered_tags = [tag for tag in prompt_list if tag not in execute_tags]
# ๆ็ต็ใชใใญใณใใใ็ๆ
return ", ".join(filtered_tags)
|