Update app.py
Browse filestry adding default example
app.py
CHANGED
@@ -24,7 +24,7 @@ def wandb_report(url):
|
|
24 |
|
25 |
control_img = 'myimage.jpg'
|
26 |
|
27 |
-
examples = [["a yellow dog standing in grass", "lowres, two heads, bad muzzle, bad anatomy, missing ears, missing paws", "
|
28 |
|
29 |
controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
|
30 |
"JFoz/dog-cat-pose", dtype=jnp.bfloat16
|
@@ -63,6 +63,8 @@ def infer(prompts, negative_prompts, image):
|
|
63 |
|
64 |
#output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-3:])))
|
65 |
del image
|
|
|
|
|
66 |
gc.collect()
|
67 |
|
68 |
output=np.array(output, dtype=np.float32)
|
@@ -83,7 +85,7 @@ with gr.Blocks(css=".gradio-container {background-color: #45f10c};") as demo:
|
|
83 |
with gr.Column():
|
84 |
prompts = gr.Textbox(label="Prompt", placeholder="animal standing, best quality, highres")
|
85 |
negative_prompts = gr.Textbox(label="Negative Prompt", value="lowres, two heads, bad muzzle, bad anatomy, missing ears, missing paws")
|
86 |
-
conditioning_image = gr.Image(label="Conditioning Image")
|
87 |
run_btn = gr.Button("Run")
|
88 |
#wandb = wandb_report(report_url)
|
89 |
with gr.Column():
|
|
|
24 |
|
25 |
control_img = 'myimage.jpg'
|
26 |
|
27 |
+
examples = [["a yellow dog standing in grass", "lowres, two heads, bad muzzle, bad anatomy, missing ears, missing paws", "example1.jpg"]]
|
28 |
|
29 |
controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
|
30 |
"JFoz/dog-cat-pose", dtype=jnp.bfloat16
|
|
|
63 |
|
64 |
#output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-3:])))
|
65 |
del image
|
66 |
+
del prompt_ids
|
67 |
+
del neg_prompt_ids
|
68 |
gc.collect()
|
69 |
|
70 |
output=np.array(output, dtype=np.float32)
|
|
|
85 |
with gr.Column():
|
86 |
prompts = gr.Textbox(label="Prompt", placeholder="animal standing, best quality, highres")
|
87 |
negative_prompts = gr.Textbox(label="Negative Prompt", value="lowres, two heads, bad muzzle, bad anatomy, missing ears, missing paws")
|
88 |
+
conditioning_image = gr.Image(label="Conditioning Image", value=default_example[0])
|
89 |
run_btn = gr.Button("Run")
|
90 |
#wandb = wandb_report(report_url)
|
91 |
with gr.Column():
|