Spaces:
Sleeping
Sleeping
Commit
·
2f9196a
1
Parent(s):
4e717cf
T1
Browse files
app.py
CHANGED
@@ -19,6 +19,7 @@ import json
|
|
19 |
from diffusers import DiffusionPipeline
|
20 |
from diffusers import StableDiffusionLatentUpscalePipeline, StableDiffusionPipeline
|
21 |
from diffusers import StableDiffusionUpscalePipeline
|
|
|
22 |
|
23 |
|
24 |
def removeFurniture(input_img1,
|
@@ -94,6 +95,18 @@ def upscale(image, prompt):
|
|
94 |
|
95 |
return upscaled_image
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
with gr.Blocks() as app:
|
99 |
with gr.Row():
|
@@ -125,6 +138,9 @@ with gr.Blocks() as app:
|
|
125 |
with gr.Column():
|
126 |
gr.Button("Upscale").click(upscale, inputs=[gr.Image(type="pil"),gr.Textbox(label="prompt",value="empty room")], outputs=gr.Image())
|
127 |
|
|
|
|
|
|
|
128 |
|
129 |
app.launch(debug=True,share=True)
|
130 |
|
|
|
19 |
from diffusers import DiffusionPipeline
|
20 |
from diffusers import StableDiffusionLatentUpscalePipeline, StableDiffusionPipeline
|
21 |
from diffusers import StableDiffusionUpscalePipeline
|
22 |
+
from diffusers import LDMSuperResolutionPipeline
|
23 |
|
24 |
|
25 |
def removeFurniture(input_img1,
|
|
|
95 |
|
96 |
return upscaled_image
|
97 |
|
98 |
+
def upscale2(image, prompt):
|
99 |
+
print("upscale2",image,prompt)
|
100 |
+
|
101 |
+
pipeline = LDMSuperResolutionPipeline.from_pretrained("CompVis/ldm-super-resolution-4x-openimages", torch_dtype=torch.float16).to('cuda')
|
102 |
+
|
103 |
+
upscaled_image = pipeline(image, num_inference_steps=10, eta=1).images[0]
|
104 |
+
return upscaled_image
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
|
111 |
with gr.Blocks() as app:
|
112 |
with gr.Row():
|
|
|
138 |
with gr.Column():
|
139 |
gr.Button("Upscale").click(upscale, inputs=[gr.Image(type="pil"),gr.Textbox(label="prompt",value="empty room")], outputs=gr.Image())
|
140 |
|
141 |
+
with gr.Column():
|
142 |
+
gr.Button("Upscale2").click(upscale2, inputs=[gr.Image(type="pil"),gr.Textbox(label="prompt",value="empty room")], outputs=gr.Image())
|
143 |
+
|
144 |
|
145 |
app.launch(debug=True,share=True)
|
146 |
|