Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -38,9 +38,7 @@ def infer(
|
|
38 |
if randomize_seed:
|
39 |
seed = random.randint(0, max_seed)
|
40 |
init_image = Image.fromarray(np.uint8(init_image))
|
41 |
-
# generate depth
|
42 |
predicted_depth = pipe_depth(init_image)["predicted_depth"]
|
43 |
-
# generate image
|
44 |
image = pipe_depth2image(
|
45 |
prompt=prompt,
|
46 |
image=init_image,
|
@@ -57,17 +55,18 @@ def infer(
|
|
57 |
|
58 |
with gr.Blocks() as demo:
|
59 |
gr.Markdown("# Demo [Depth2Image](https://huggingface.co/stabilityai/stable-diffusion-2-depth) with depth map estimated by [Depth Anything V2](https://huggingface.co/depth-anything/Depth-Anything-V2-Large-hf).")
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
67 |
with gr.Row():
|
68 |
init_image = gr.Image(label="Input Image", type='numpy')
|
69 |
-
result = gr.Image(label="Result"
|
70 |
-
run_button = gr.Button("Run", scale=0)
|
71 |
with gr.Accordion("Advanced Settings", open=False):
|
72 |
negative_prompt = gr.Text(
|
73 |
label="Negative Prompt",
|
|
|
38 |
if randomize_seed:
|
39 |
seed = random.randint(0, max_seed)
|
40 |
init_image = Image.fromarray(np.uint8(init_image))
|
|
|
41 |
predicted_depth = pipe_depth(init_image)["predicted_depth"]
|
|
|
42 |
image = pipe_depth2image(
|
43 |
prompt=prompt,
|
44 |
image=init_image,
|
|
|
55 |
|
56 |
with gr.Blocks() as demo:
|
57 |
gr.Markdown("# Demo [Depth2Image](https://huggingface.co/stabilityai/stable-diffusion-2-depth) with depth map estimated by [Depth Anything V2](https://huggingface.co/depth-anything/Depth-Anything-V2-Large-hf).")
|
58 |
+
with gr.Row():
|
59 |
+
prompt = gr.Text(
|
60 |
+
label="Prompt",
|
61 |
+
show_label=False,
|
62 |
+
max_lines=1,
|
63 |
+
placeholder="Enter your prompt",
|
64 |
+
container=False,
|
65 |
+
)
|
66 |
+
run_button = gr.Button("Run", scale=0)
|
67 |
with gr.Row():
|
68 |
init_image = gr.Image(label="Input Image", type='numpy')
|
69 |
+
result = gr.Image(label="Result")
|
|
|
70 |
with gr.Accordion("Advanced Settings", open=False):
|
71 |
negative_prompt = gr.Text(
|
72 |
label="Negative Prompt",
|