gaur3009 commited on
Commit
38b1b9b
·
verified ·
1 Parent(s): acc7239

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -11
app.py CHANGED
@@ -18,9 +18,9 @@ else:
18
  MAX_SEED = np.iinfo(np.int32).max
19
  MAX_IMAGE_SIZE = 1024
20
 
21
- def infer(prompt_part1, color, dress_type, design, prompt_part5, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
22
- front_prompt = f"{prompt_part1} {color} colored plain {dress_type} with {design} design in front, {prompt_part5}"
23
- back_prompt = f"{prompt_part1} {color} colored plain {dress_type} with {design} design in back, {prompt_part5}"
24
 
25
  if randomize_seed:
26
  seed = random.randint(0, MAX_SEED)
@@ -50,9 +50,9 @@ def infer(prompt_part1, color, dress_type, design, prompt_part5, negative_prompt
50
  return front_image, back_image
51
 
52
  examples = [
53
- "red, t-shirt, yellow stripes",
54
- "blue, hoodie, minimalist",
55
- "red, sweat shirt, geometric design",
56
  ]
57
 
58
  css = """
@@ -103,11 +103,19 @@ with gr.Blocks(css=css) as demo:
103
  container=False,
104
  )
105
 
106
- prompt_part4 = gr.Textbox(
107
- label="design",
108
  show_label=False,
109
  max_lines=1,
110
- placeholder="design",
 
 
 
 
 
 
 
 
111
  container=False,
112
  )
113
 
@@ -184,12 +192,12 @@ with gr.Blocks(css=css) as demo:
184
 
185
  gr.Examples(
186
  examples=examples,
187
- inputs=[prompt_part2]
188
  )
189
 
190
  run_button.click(
191
  fn=infer,
192
- inputs=[prompt_part1, prompt_part2, prompt_part3, prompt_part4, prompt_part5, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
193
  outputs=[front_result, back_result]
194
  )
195
 
 
18
  MAX_SEED = np.iinfo(np.int32).max
19
  MAX_IMAGE_SIZE = 1024
20
 
21
+ def infer(prompt_part1, color, dress_type, front_design, back_design, prompt_part5, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
22
+ front_prompt = f"front view of {prompt_part1} {color} colored plain {dress_type} with {front_design} design, {prompt_part5}"
23
+ back_prompt = f"back view of {prompt_part1} {color} colored plain {dress_type} with {back_design} design, {prompt_part5}"
24
 
25
  if randomize_seed:
26
  seed = random.randint(0, MAX_SEED)
 
50
  return front_image, back_image
51
 
52
  examples = [
53
+ "red, t-shirt, yellow stripes, polka dots",
54
+ "blue, hoodie, minimalist, abstract art",
55
+ "red, sweat shirt, geometric design, plain",
56
  ]
57
 
58
  css = """
 
103
  container=False,
104
  )
105
 
106
+ prompt_part4_front = gr.Textbox(
107
+ label="front design",
108
  show_label=False,
109
  max_lines=1,
110
+ placeholder="front design",
111
+ container=False,
112
+ )
113
+
114
+ prompt_part4_back = gr.Textbox(
115
+ label="back design",
116
+ show_label=False,
117
+ max_lines=1,
118
+ placeholder="back design",
119
  container=False,
120
  )
121
 
 
192
 
193
  gr.Examples(
194
  examples=examples,
195
+ inputs=[prompt_part2, prompt_part3, prompt_part4_front, prompt_part4_back]
196
  )
197
 
198
  run_button.click(
199
  fn=infer,
200
+ inputs=[prompt_part1, prompt_part2, prompt_part3, prompt_part4_front, prompt_part4_back, prompt_part5, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
201
  outputs=[front_result, back_result]
202
  )
203