Spaces:
Runtime error
Runtime error
Commit
·
0538750
1
Parent(s):
bbeac87
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ source_image = load_image('https://huggingface.co/lllyasviel/control_v11f1e_sd15
|
|
32 |
def super_esr(source_image,prompt,negative_prompt,strength,seed,num_inference_steps):
|
33 |
condition_image = resize_for_condition_image(source_image, 1024)
|
34 |
image = pipe(prompt=prompt,#"best quality",
|
35 |
-
negative_prompt=
|
36 |
image=condition_image,
|
37 |
controlnet_conditioning_image=condition_image,
|
38 |
width=condition_image.size[0],
|
@@ -45,24 +45,23 @@ def super_esr(source_image,prompt,negative_prompt,strength,seed,num_inference_st
|
|
45 |
return source_image
|
46 |
|
47 |
#define laund take input nsame as super_esr function
|
48 |
-
def launch():
|
49 |
-
inputs=[
|
50 |
-
gr.inputs.Image(type="pil",label="Source Image"),
|
51 |
-
gr.inputs.Textbox(lines=2,label="Prompt"),
|
52 |
-
gr.inputs.Textbox(lines=2,label="Negative Prompt"),
|
53 |
-
gr.inputs.Slider(minimum=0,maximum=1,label="Strength"),
|
54 |
-
gr.inputs.Slider(minimum=0,maximum=100,label="Seed"),
|
55 |
-
gr.inputs.Slider(minimum=0,maximum=100,label="Num Inference Steps")
|
56 |
-
]
|
57 |
-
outputs=[
|
58 |
-
gr.outputs.Image(type="pil",label="Output Image")
|
59 |
-
]
|
60 |
-
title="Super ESR"
|
61 |
-
description="Super ESR is a super resolution model that uses diffusion to generate high resolution images from low resolution images"
|
62 |
-
examples=[
|
63 |
-
["https://i.imgur.com/9IqyX1F.png","best quality","blur, lowres, bad anatomy, bad hands, cropped, worst quality",1.0,0,100],
|
64 |
-
["https://i.imgur.com/9IqyX1F.png","best quality","blur, lowres, bad anatomy, bad hands, cropped, worst quality",1.0,0,100],
|
65 |
-
]
|
66 |
-
gr.Interface(fn=super_esr,inputs=inputs,outputs=outputs,title=title,description=description,examples=examples).launch(share=True)
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def super_esr(source_image,prompt,negative_prompt,strength,seed,num_inference_steps):
|
33 |
condition_image = resize_for_condition_image(source_image, 1024)
|
34 |
image = pipe(prompt=prompt,#"best quality",
|
35 |
+
negative_prompt="blur, lowres, bad anatomy, bad hands, cropped, worst quality",
|
36 |
image=condition_image,
|
37 |
controlnet_conditioning_image=condition_image,
|
38 |
width=condition_image.size[0],
|
|
|
45 |
return source_image
|
46 |
|
47 |
#define laund take input nsame as super_esr function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
inputs=[
|
50 |
+
gr.inputs.Image(type="pil",label="Source Image"),
|
51 |
+
gr.inputs.Textbox(lines=2,label="Prompt"),
|
52 |
+
gr.inputs.Textbox(lines=2,label="Negative Prompt"),
|
53 |
+
gr.inputs.Slider(minimum=0,maximum=1,label="Strength"),
|
54 |
+
gr.inputs.Slider(minimum=0,maximum=100,label="Seed"),
|
55 |
+
gr.inputs.Slider(minimum=0,maximum=100,label="Num Inference Steps")
|
56 |
+
]
|
57 |
+
outputs=[
|
58 |
+
gr.outputs.Image(type="pil",label="Output Image")
|
59 |
+
]
|
60 |
+
title="Super ESR"
|
61 |
+
description="Super ESR is a super resolution model that uses diffusion to generate high resolution images from low resolution images"
|
62 |
+
examples=[
|
63 |
+
["https://i.imgur.com/9IqyX1F.png","best quality","blur, lowres, bad anatomy, bad hands, cropped, worst quality",1.0,0,100],
|
64 |
+
["https://i.imgur.com/9IqyX1F.png","best quality","blur, lowres, bad anatomy, bad hands, cropped, worst quality",1.0,0,100],
|
65 |
+
]
|
66 |
+
#create queue the rerquests
|
67 |
+
gr.Interface(fn=super_esr,inputs=inputs,outputs=outputs,title=title,description=description,examples=examples).launch()
|