Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import random
|
|
4 |
import spaces # [uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline, DPMSolverSDEScheduler
|
6 |
import torch
|
7 |
-
from tags import
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v8-sdxl" # Replace to the model you would like to use
|
@@ -25,11 +25,13 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
|
|
25 |
|
26 |
# Determine final prompt
|
27 |
if use_tags:
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
tags_text = ', '.join(selected_tags_1 + selected_tags_2 + selected_tags_3 + selected_tags_4)
|
|
|
|
|
33 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
34 |
else:
|
35 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {prompt}'
|
@@ -100,13 +102,13 @@ with gr.Blocks(css=css) as demo:
|
|
100 |
with gr.TabItem("Tag Selection"):
|
101 |
# Separate each tag section vertically
|
102 |
with gr.Column():
|
103 |
-
|
104 |
with gr.Column():
|
105 |
-
|
106 |
with gr.Column():
|
107 |
-
|
108 |
with gr.Column():
|
109 |
-
|
110 |
|
111 |
use_tags = gr.State(True)
|
112 |
|
|
|
4 |
import spaces # [uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline, DPMSolverSDEScheduler
|
6 |
import torch
|
7 |
+
from tags import participant_tags, tribe_tags, skin_tone_tags, body_type_tags, tattoo_tags, piercing_tags, expression_tags, eye_tags, hair_style_tags, position_tags, fetish_tags, location_tags, camera_tags, atmosphere_tags # Import tags here
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v8-sdxl" # Replace to the model you would like to use
|
|
|
25 |
|
26 |
# Determine final prompt
|
27 |
if use_tags:
|
28 |
+
participant_tags = [participant_tags[tag] for tag in participant_tags if tag in participant_tags]
|
29 |
+
tribe_tags = [tribe_tags[tag] for tag in tribe_tags if tag in tribe_tags]
|
30 |
+
skin_tone_tags = [skin_tone_tags[tag] for tag in skin_tone_tags if tag in skin_tone_tags]
|
31 |
+
body_type_tags = [body_type_tags[tag] for tag in body_type_tags if tag in body_type_tags]
|
32 |
tags_text = ', '.join(selected_tags_1 + selected_tags_2 + selected_tags_3 + selected_tags_4)
|
33 |
+
|
34 |
+
|
35 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
36 |
else:
|
37 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {prompt}'
|
|
|
102 |
with gr.TabItem("Tag Selection"):
|
103 |
# Separate each tag section vertically
|
104 |
with gr.Column():
|
105 |
+
participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Select Tags (Style)")
|
106 |
with gr.Column():
|
107 |
+
tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Select Tags (Theme)")
|
108 |
with gr.Column():
|
109 |
+
skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Select Tags (Other)")
|
110 |
with gr.Column():
|
111 |
+
body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Select Tags (Additional)")
|
112 |
|
113 |
use_tags = gr.State(True)
|
114 |
|