MaxMilan1 commited on
Commit
25c2b12
1 Parent(s): 3aef850
Files changed (2) hide show
  1. app.py +9 -5
  2. util/instantmesh.py +1 -1
app.py CHANGED
@@ -29,21 +29,25 @@ with gr.Blocks(theme=theme) as GenDemo:
29
  with gr.Column():
30
  prompt = gr.Textbox(label="Enter a discription of a shoe")
31
  negative_prompt = gr.Textbox(label="Negative Prompt", value="low quality, bad quality, sketches, legs")
32
- scale = gr.Slider(label="Control Image Scale", minimum=0.1, maximum=1.0, step=0.1, value=0.5)
33
- control_image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='numpy')
 
 
 
34
  gr.Examples(
35
  examples=[
36
  os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))
37
  ],
38
- inputs=[control_image],
39
  label="Examples",
40
  cache_examples=False,
41
  )
42
  with gr.Column():
43
  button_gen = gr.Button("Generate Image", elem_id="generateIm", variant="primary")
44
  gen_image = gr.Image(label="Generated Image", image_mode="RGBA", type='pil', show_download_button=True, show_label=False)
45
-
46
- button_gen.click(check_prompt, inputs=[prompt]).success(generate_image, inputs=[prompt, negative_prompt, control_image, scale], outputs=[gen_image])
 
47
 
48
  with gr.Tab("Image to 3D Model Generator"):
49
  with gr.Row(variant="panel"):
 
29
  with gr.Column():
30
  prompt = gr.Textbox(label="Enter a discription of a shoe")
31
  negative_prompt = gr.Textbox(label="Negative Prompt", value="low quality, bad quality, sketches, legs")
32
+ select = gr.Dropdown(label="Select a model", choices=["Canny","Depth","Normal"])
33
+
34
+ scale = gr.Slider(label="Control Image Scale", minimum=0.1, maximum=1.0, step=0.1, value=0.5, visible=(select == "Canny"))
35
+
36
+ controlNet_image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='numpy')
37
  gr.Examples(
38
  examples=[
39
  os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))
40
  ],
41
+ inputs=[controlNet_image],
42
  label="Examples",
43
  cache_examples=False,
44
  )
45
  with gr.Column():
46
  button_gen = gr.Button("Generate Image", elem_id="generateIm", variant="primary")
47
  gen_image = gr.Image(label="Generated Image", image_mode="RGBA", type='pil', show_download_button=True, show_label=False)
48
+
49
+ select.change()
50
+ button_gen.click(check_prompt, inputs=[prompt]).success(generate_image, inputs=[prompt, negative_prompt, controlNet_image, scale], outputs=[gen_image])
51
 
52
  with gr.Tab("Image to 3D Model Generator"):
53
  with gr.Row(variant="panel"):
util/instantmesh.py CHANGED
@@ -196,7 +196,7 @@ def make3d(images):
196
  # get mesh
197
  mesh_out = model.extract_mesh(
198
  planes,
199
- use_texture_map=False,
200
  **infer_config,
201
  )
202
 
 
196
  # get mesh
197
  mesh_out = model.extract_mesh(
198
  planes,
199
+ use_texture_map=True,
200
  **infer_config,
201
  )
202