akhaliq HF Staff commited on
Commit
202b54d
·
verified ·
1 Parent(s): 3e4bd08

Update Gradio app with multiple files

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -46,6 +46,7 @@ MAX_SEED = np.iinfo(np.int32).max
46
  @spaces.GPU
47
  def convert_to_anime(
48
  image,
 
49
  seed,
50
  randomize_seed,
51
  true_guidance_scale,
@@ -54,7 +55,7 @@ def convert_to_anime(
54
  width,
55
  progress=gr.Progress(track_tqdm=True)
56
  ):
57
- prompt = "Relight Figure 1 using the luminance map from Figure 2 (light source from the front)"
58
 
59
  if randomize_seed:
60
  seed = random.randint(0, MAX_SEED)
@@ -197,6 +198,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 +223,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 convert_to_anime(
48
  image,
49
+ light_direction,
50
  seed,
51
  randomize_seed,
52
  true_guidance_scale,
 
55
  width,
56
  progress=gr.Progress(track_tqdm=True)
57
  ):
58
+ prompt = f"Relight Figure 1 using the luminance map from Figure 2 (light source from the {light_direction})"
59
 
60
  if randomize_seed:
61
  seed = random.randint(0, MAX_SEED)
 
198
  elem_classes="image-container"
199
  )
200
 
201
+ light_direction = gr.Dropdown(
202
+ choices=["Front", "Left Front", "Left", "Left Rear", "Rear", "Right Rear", "Right", "Right Front", "Above", "Below"],
203
+ value="Front",
204
+ label="Light Source Direction",
205
+ info="Select the direction of the light source"
206
+ )
207
+
208
  with gr.Accordion("⚙️ Advanced Settings", open=False):
209
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
210
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
 
223
  )
224
 
225
  inputs = [
226
+ image, light_direction, seed, randomize_seed, true_guidance_scale,
227
  num_inference_steps, height, width
228
  ]
229
  outputs = [result, seed]