panelforge commited on
Commit
a3ecd5b
·
verified ·
1 Parent(s): 94b1bd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import random
4
  import spaces # [uncomment to use ZeroGPU]
5
  from diffusers import DiffusionPipeline
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
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
  model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v8-sdxl" # Replace with your desired model
@@ -22,7 +22,7 @@ MAX_IMAGE_SIZE = 1024
22
 
23
  @spaces.GPU # [uncomment to use ZeroGPU]
24
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
25
- selected_participant_tags, selected_tribe_tags, selected_skin_tone_tags, selected_body_type_tags,
26
  selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
27
  selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
28
  selected_camera_tags, selected_atmosphere_tags, active_tab, progress=gr.Progress(track_tqdm=True)):
@@ -36,6 +36,7 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
36
  selected_tags = (
37
  [participant_tags[tag] for tag in selected_participant_tags] +
38
  [tribe_tags[tag] for tag in selected_tribe_tags] +
 
39
  [skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
40
  [body_type_tags[tag] for tag in selected_body_type_tags] +
41
  [tattoo_tags[tag] for tag in selected_tattoo_tags] +
@@ -57,6 +58,7 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
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] +
@@ -78,6 +80,7 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
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] +
@@ -164,6 +167,7 @@ with gr.Blocks(css=css) as demo:
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")
@@ -183,6 +187,7 @@ with gr.Blocks(css=css) as demo:
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")
@@ -201,6 +206,7 @@ with gr.Blocks(css=css) as demo:
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")
 
204
  selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
205
  selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
206
  selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
@@ -278,7 +284,7 @@ with gr.Blocks(css=css) as demo:
278
  run_button.click(
279
  infer,
280
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
281
- selected_participant_tags, selected_tribe_tags, selected_skin_tone_tags, selected_body_type_tags,
282
  selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
283
  selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
284
  selected_camera_tags, selected_atmosphere_tags, active_tab],
 
4
  import spaces # [uncomment to use ZeroGPU]
5
  from diffusers import DiffusionPipeline
6
  import torch
7
+ from tags import participant_tags, tribe_tags, role_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
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
  model_repo_id = "John6666/wai-ani-nsfw-ponyxl-v8-sdxl" # Replace with your desired model
 
22
 
23
  @spaces.GPU # [uncomment to use ZeroGPU]
24
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
25
+ selected_participant_tags, selected_tribe_tags, selected_role_tags, selected_skin_tone_tags, selected_body_type_tags,
26
  selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
27
  selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
28
  selected_camera_tags, selected_atmosphere_tags, active_tab, progress=gr.Progress(track_tqdm=True)):
 
36
  selected_tags = (
37
  [participant_tags[tag] for tag in selected_participant_tags] +
38
  [tribe_tags[tag] for tag in selected_tribe_tags] +
39
+ [role_tags[tag] for tag in selected_role_tags] +
40
  [skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
41
  [body_type_tags[tag] for tag in selected_body_type_tags] +
42
  [tattoo_tags[tag] for tag in selected_tattoo_tags] +
 
58
  selected_tags = (
59
  [participant_tags[tag] for tag in selected_participant_tags] +
60
  [tribe_tags[tag] for tag in selected_tribe_tags] +
61
+ [role_tags[tag] for tag in selected_role_tags] +
62
  [skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
63
  [body_type_tags[tag] for tag in selected_body_type_tags] +
64
  [tattoo_tags[tag] for tag in selected_tattoo_tags] +
 
80
  selected_tags = (
81
  [participant_tags[tag] for tag in selected_participant_tags] +
82
  [tribe_tags[tag] for tag in selected_tribe_tags] +
83
+ [role_tags[tag] for tag in selected_role_tags] +
84
  [skin_tone_tags[tag] for tag in selected_skin_tone_tags] +
85
  [body_type_tags[tag] for tag in selected_body_type_tags] +
86
  [tattoo_tags[tag] for tag in selected_tattoo_tags] +
 
167
  # Tag selection checkboxes for each tag group
168
  selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
169
  selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
170
+ selected_role_tags = gr.CheckboxGroup(choices=list(role_tags.keys()), label="Role Tags")
171
  selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
172
  selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
173
  selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
 
187
  # Tag selection checkboxes for each tag group
188
  selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
189
  selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
190
+ selected_role_tags = gr.CheckboxGroup(choices=list(role_tags.keys()), label="Role Tags")
191
  selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
192
  selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
193
  selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
 
206
  # Tag selection checkboxes for each tag group
207
  selected_participant_tags = gr.CheckboxGroup(choices=list(participant_tags.keys()), label="Participant Tags")
208
  selected_tribe_tags = gr.CheckboxGroup(choices=list(tribe_tags.keys()), label="Tribe Tags")
209
+ selected_role_tags = gr.CheckboxGroup(choices=list(role_tags.keys()), label="Role Tags")
210
  selected_skin_tone_tags = gr.CheckboxGroup(choices=list(skin_tone_tags.keys()), label="Skin Tone Tags")
211
  selected_body_type_tags = gr.CheckboxGroup(choices=list(body_type_tags.keys()), label="Body Type Tags")
212
  selected_tattoo_tags = gr.CheckboxGroup(choices=list(tattoo_tags.keys()), label="Tattoo Tags")
 
284
  run_button.click(
285
  infer,
286
  inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps,
287
+ selected_participant_tags, selected_tribe_tags, selected_role_tags, selected_skin_tone_tags, selected_body_type_tags,
288
  selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
289
  selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
290
  selected_camera_tags, selected_atmosphere_tags, active_tab],