Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,9 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
|
|
30 |
if active_tab == "Prompt Input":
|
31 |
# Use the user-provided prompt
|
32 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {prompt}'
|
33 |
-
|
34 |
-
|
|
|
35 |
selected_tags = (
|
36 |
[participant_tags[tag] for tag in selected_participant_tags] +
|
37 |
[tribe_tags[tag] for tag in selected_tribe_tags] +
|
@@ -51,6 +52,48 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
|
|
51 |
tags_text = ', '.join(selected_tags)
|
52 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
# Concatenate user-provided negative prompt with additional restrictions
|
55 |
additional_negatives = "worst quality, bad quality, jpeg artifacts, source_cartoon, 3d, (censor), monochrome, blurry, lowres, watermark"
|
56 |
full_negative_prompt = f"{additional_negatives}, {negative_prompt}"
|
@@ -94,7 +137,7 @@ css = """
|
|
94 |
with gr.Blocks(css=css) as demo:
|
95 |
|
96 |
with gr.Column(elem_id="col-container"):
|
97 |
-
gr.Markdown("""#
|
98 |
|
99 |
# Display result image at the top
|
100 |
result = gr.Image(label="Result", show_label=False)
|
@@ -117,7 +160,44 @@ with gr.Blocks(css=css) as demo:
|
|
117 |
)
|
118 |
prompt_tab.select(lambda: "Prompt Input", inputs=None, outputs=active_tab)
|
119 |
|
120 |
-
with gr.TabItem("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
# Tag selection checkboxes for each tag group
|
122 |
selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
|
123 |
selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
|
|
|
30 |
if active_tab == "Prompt Input":
|
31 |
# Use the user-provided prompt
|
32 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {prompt}'
|
33 |
+
|
34 |
+
elif active_tab == "Straight" :
|
35 |
+
# Use tags from the "Gay" tab
|
36 |
selected_tags = (
|
37 |
[participant_tags[tag] for tag in selected_participant_tags] +
|
38 |
[tribe_tags[tag] for tag in selected_tribe_tags] +
|
|
|
52 |
tags_text = ', '.join(selected_tags)
|
53 |
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
54 |
|
55 |
+
elif active_tab == "Gay" :
|
56 |
+
# Use tags from the "Gay" tab
|
57 |
+
selected_tags = (
|
58 |
+
[participant_tags[tag] for tag in selected_participant_tags] +
|
59 |
+
[tribe_tags[tag] for tag in selected_tribe_tags] +
|
60 |
+
[skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
|
61 |
+
[body_type_tags[tag] for tag in selected_body_type_tags] +
|
62 |
+
[tattoo_tags[tag] for tag in selected_tattoo_tags] +
|
63 |
+
[piercing_tags[tag] for tag in selected_piercing_tags] +
|
64 |
+
[expression_tags[tag] for tag in selected_expression_tags] +
|
65 |
+
[eye_tags[tag] for tag in selected_eye_tags] +
|
66 |
+
[hair_style_tags[tag] for tag in selected_hair_style_tags] +
|
67 |
+
[position_tags[tag] for tag in selected_position_tags] +
|
68 |
+
[fetish_tags[tag] for tag in selected_fetish_tags] +
|
69 |
+
[location_tags[tag] for tag in selected_location_tags] +
|
70 |
+
[camera_tags[tag] for tag in selected_camera_tags] +
|
71 |
+
[atmosphere_tags[tag] for tag in selected_atmosphere_tags]
|
72 |
+
)
|
73 |
+
tags_text = ', '.join(selected_tags)
|
74 |
+
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
75 |
+
|
76 |
+
elif active_tab == "Lesbian" :
|
77 |
+
# Use tags from the "Lesbien" tab
|
78 |
+
selected_tags = (
|
79 |
+
[participant_tags[tag] for tag in selected_participant_tags] +
|
80 |
+
[tribe_tags[tag] for tag in selected_tribe_tags] +
|
81 |
+
[skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
|
82 |
+
[body_type_tags[tag] for tag in selected_body_type_tags] +
|
83 |
+
[tattoo_tags[tag] for tag in selected_tattoo_tags] +
|
84 |
+
[piercing_tags[tag] for tag in selected_piercing_tags] +
|
85 |
+
[expression_tags[tag] for tag in selected_expression_tags] +
|
86 |
+
[eye_tags[tag] for tag in selected_eye_tags] +
|
87 |
+
[hair_style_tags[tag] for tag in selected_hair_style_tags] +
|
88 |
+
[position_tags[tag] for tag in selected_position_tags] +
|
89 |
+
[fetish_tags[tag] for tag in selected_fetish_tags] +
|
90 |
+
[location_tags[tag] for tag in selected_location_tags] +
|
91 |
+
[camera_tags[tag] for tag in selected_camera_tags] +
|
92 |
+
[atmosphere_tags[tag] for tag in selected_atmosphere_tags]
|
93 |
+
)
|
94 |
+
tags_text = ', '.join(selected_tags)
|
95 |
+
final_prompt = f'score_9, score_8_up, score_7_up, source_anime, {tags_text}'
|
96 |
+
|
97 |
# Concatenate user-provided negative prompt with additional restrictions
|
98 |
additional_negatives = "worst quality, bad quality, jpeg artifacts, source_cartoon, 3d, (censor), monochrome, blurry, lowres, watermark"
|
99 |
full_negative_prompt = f"{additional_negatives}, {negative_prompt}"
|
|
|
137 |
with gr.Blocks(css=css) as demo:
|
138 |
|
139 |
with gr.Column(elem_id="col-container"):
|
140 |
+
gr.Markdown("""# Rainbow Media X""")
|
141 |
|
142 |
# Display result image at the top
|
143 |
result = gr.Image(label="Result", show_label=False)
|
|
|
160 |
)
|
161 |
prompt_tab.select(lambda: "Prompt Input", inputs=None, outputs=active_tab)
|
162 |
|
163 |
+
with gr.TabItem("Straight") as straight_tag_tab:
|
164 |
+
# Tag selection checkboxes for each tag group
|
165 |
+
selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
|
166 |
+
selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
|
167 |
+
selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
|
168 |
+
selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
|
169 |
+
selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
|
170 |
+
selected_piercing_tags = gr.CheckboxGroup(choices=list(piercing_tags.keys()), label="Piercing Tags")
|
171 |
+
selected_expression_tags = gr.CheckboxGroup(choices=list(expression_tags.keys()), label="Expression Tags")
|
172 |
+
selected_eye_tags = gr.CheckboxGroup(choices=list(eye_tags.keys()), label="Eye Tags")
|
173 |
+
selected_hair_style_tags = gr.CheckboxGroup(choices=list(hair_style_tags.keys()), label="Hair Style Tags")
|
174 |
+
selected_position_tags = gr.CheckboxGroup(choices=list(position_tags.keys()), label="Position Tags")
|
175 |
+
selected_fetish_tags = gr.CheckboxGroup(choices=list(fetish_tags.keys()), label="Fetish Tags")
|
176 |
+
selected_location_tags = gr.CheckboxGroup(choices=list(location_tags.keys()), label="Location Tags")
|
177 |
+
selected_camera_tags = gr.CheckboxGroup(choices=list(camera_tags.keys()), label="Camera Tags")
|
178 |
+
selected_atmosphere_tags = gr.CheckboxGroup(choices=list(atmosphere_tags.keys()), label="Atmosphere Tags")
|
179 |
+
tag_tab.select(lambda: "Tag Selection", inputs=None, outputs=active_tab)
|
180 |
+
|
181 |
+
|
182 |
+
with gr.TabItem("Gay") as gay_tag_tab:
|
183 |
+
# Tag selection checkboxes for each tag group
|
184 |
+
selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
|
185 |
+
selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
|
186 |
+
selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
|
187 |
+
selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
|
188 |
+
selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
|
189 |
+
selected_piercing_tags = gr.CheckboxGroup(choices=list(piercing_tags.keys()), label="Piercing Tags")
|
190 |
+
selected_expression_tags = gr.CheckboxGroup(choices=list(expression_tags.keys()), label="Expression Tags")
|
191 |
+
selected_eye_tags = gr.CheckboxGroup(choices=list(eye_tags.keys()), label="Eye Tags")
|
192 |
+
selected_hair_style_tags = gr.CheckboxGroup(choices=list(hair_style_tags.keys()), label="Hair Style Tags")
|
193 |
+
selected_position_tags = gr.CheckboxGroup(choices=list(position_tags.keys()), label="Position Tags")
|
194 |
+
selected_fetish_tags = gr.CheckboxGroup(choices=list(fetish_tags.keys()), label="Fetish Tags")
|
195 |
+
selected_location_tags = gr.CheckboxGroup(choices=list(location_tags.keys()), label="Location Tags")
|
196 |
+
selected_camera_tags = gr.CheckboxGroup(choices=list(camera_tags.keys()), label="Camera Tags")
|
197 |
+
selected_atmosphere_tags = gr.CheckboxGroup(choices=list(atmosphere_tags.keys()), label="Atmosphere Tags")
|
198 |
+
tag_tab.select(lambda: "Tag Selection", inputs=None, outputs=active_tab)
|
199 |
+
|
200 |
+
with gr.TabItem("Lesbian") as lesbian_tag_tab:
|
201 |
# Tag selection checkboxes for each tag group
|
202 |
selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
|
203 |
selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
|