akhaliq HF Staff commited on
Commit
f59255f
·
verified ·
1 Parent(s): 43aa8c5

Update Gradio app with multiple files

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -46,6 +46,7 @@ MAX_SEED = np.iinfo(np.int32).max
46
  @spaces.GPU
47
  def extract_texture(
48
  image,
 
49
  seed,
50
  randomize_seed,
51
  true_guidance_scale,
@@ -54,7 +55,8 @@ def extract_texture(
54
  width,
55
  progress=gr.Progress(track_tqdm=True)
56
  ):
57
- prompt = "Extract texture from this image"
 
58
 
59
  if randomize_seed:
60
  seed = random.randint(0, MAX_SEED)
@@ -197,6 +199,13 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
197
  elem_classes="image-container"
198
  )
199
 
 
 
 
 
 
 
 
200
  with gr.Accordion("⚙️ Advanced Settings", open=False):
201
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
202
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
@@ -215,7 +224,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
215
  )
216
 
217
  inputs = [
218
- image, seed, randomize_seed, true_guidance_scale,
219
  num_inference_steps, height, width
220
  ]
221
  outputs = [result, seed]
 
46
  @spaces.GPU
47
  def extract_texture(
48
  image,
49
+ prompt,
50
  seed,
51
  randomize_seed,
52
  true_guidance_scale,
 
55
  width,
56
  progress=gr.Progress(track_tqdm=True)
57
  ):
58
+ if not prompt:
59
+ prompt = "Extract texture from this image"
60
 
61
  if randomize_seed:
62
  seed = random.randint(0, MAX_SEED)
 
199
  elem_classes="image-container"
200
  )
201
 
202
+ prompt = gr.Textbox(
203
+ label="Prompt",
204
+ placeholder="Extract {texture description} texture from the {object description}",
205
+ value="Extract texture from this image",
206
+ lines=2
207
+ )
208
+
209
  with gr.Accordion("⚙️ Advanced Settings", open=False):
210
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
211
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
 
224
  )
225
 
226
  inputs = [
227
+ image, prompt, seed, randomize_seed, true_guidance_scale,
228
  num_inference_steps, height, width
229
  ]
230
  outputs = [result, seed]