Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,9 @@ from PIL import Image
|
|
| 8 |
from diffusers import FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel
|
| 9 |
import gc
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
def create_key(seed=0):
|
| 12 |
return jax.random.PRNGKey(seed)
|
| 13 |
|
|
@@ -19,12 +22,6 @@ def wandb_report(url):
|
|
| 19 |
iframe = f'<iframe src ={url} style="border:none;height:1024px;width:100%"/frame>'
|
| 20 |
return gr.HTML(iframe)
|
| 21 |
|
| 22 |
-
mytitle = 'Animal Pose Control Net'
|
| 23 |
-
mydescription = 'This is a demo of Animal Pose ControlNet, which is a model trained on runwayml/stable-diffusion-v1-5 with new type of conditioning.'
|
| 24 |
-
|
| 25 |
-
report_url = 'https://wandb.ai/john-fozard/dog-cat-pose/runs/kmwcvae5'
|
| 26 |
-
sketch_url = 'https://editor.p5js.org/kfahn/full/Ntzq9HWhx'
|
| 27 |
-
|
| 28 |
control_img = 'myimage.jpg'
|
| 29 |
|
| 30 |
controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
|
|
@@ -81,7 +78,7 @@ with gr.Blocks(theme='kfahn/AnimalPose') as demo:
|
|
| 81 |
""")
|
| 82 |
with gr.Row():
|
| 83 |
with gr.Column():
|
| 84 |
-
prompts = gr.Textbox(label="Prompt", placeholder="
|
| 85 |
negative_prompts = gr.Textbox(label="Negative Prompt", value="lowres, bad muzzle, bad anatomy, missing ears, missing paws")
|
| 86 |
conditioning_image = gr.Image(label="Conditioning Image")
|
| 87 |
run_btn = gr.Button("Run")
|
|
@@ -99,7 +96,6 @@ with gr.Blocks(theme='kfahn/AnimalPose') as demo:
|
|
| 99 |
[Training Report](https://wandb.ai/john-fozard/dog-cat-pose/runs/kmwcvae5)
|
| 100 |
""")
|
| 101 |
|
| 102 |
-
#run_btn.click(fn=infer, title = mytitle, description = mydescription, inputs = [prompts, negative_prompts, conditioning_image], outputs = output)
|
| 103 |
run_btn.click(fn=infer, inputs = [prompts, negative_prompts, conditioning_image], outputs = output)
|
| 104 |
|
| 105 |
#gr.Interface(fn=infer, inputs = ["text", "text", "image"], outputs = output,
|
|
|
|
| 8 |
from diffusers import FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel
|
| 9 |
import gc
|
| 10 |
|
| 11 |
+
report_url = 'https://wandb.ai/john-fozard/dog-cat-pose/runs/kmwcvae5'
|
| 12 |
+
sketch_url = 'https://editor.p5js.org/kfahn/full/Ntzq9HWhx'
|
| 13 |
+
|
| 14 |
def create_key(seed=0):
|
| 15 |
return jax.random.PRNGKey(seed)
|
| 16 |
|
|
|
|
| 22 |
iframe = f'<iframe src ={url} style="border:none;height:1024px;width:100%"/frame>'
|
| 23 |
return gr.HTML(iframe)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
control_img = 'myimage.jpg'
|
| 26 |
|
| 27 |
controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
|
|
|
|
| 78 |
""")
|
| 79 |
with gr.Row():
|
| 80 |
with gr.Column():
|
| 81 |
+
prompts = gr.Textbox(label="Prompt", placeholder="animal standing, best quality, highres")
|
| 82 |
negative_prompts = gr.Textbox(label="Negative Prompt", value="lowres, bad muzzle, bad anatomy, missing ears, missing paws")
|
| 83 |
conditioning_image = gr.Image(label="Conditioning Image")
|
| 84 |
run_btn = gr.Button("Run")
|
|
|
|
| 96 |
[Training Report](https://wandb.ai/john-fozard/dog-cat-pose/runs/kmwcvae5)
|
| 97 |
""")
|
| 98 |
|
|
|
|
| 99 |
run_btn.click(fn=infer, inputs = [prompts, negative_prompts, conditioning_image], outputs = output)
|
| 100 |
|
| 101 |
#gr.Interface(fn=infer, inputs = ["text", "text", "image"], outputs = output,
|