Spaces:
Sleeping
Sleeping
Commit
·
11d7771
1
Parent(s):
2f9196a
app.py
CHANGED
|
@@ -98,7 +98,9 @@ def upscale(image, prompt):
|
|
| 98 |
def upscale2(image, prompt):
|
| 99 |
print("upscale2",image,prompt)
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
| 102 |
|
| 103 |
upscaled_image = pipeline(image, num_inference_steps=10, eta=1).images[0]
|
| 104 |
return upscaled_image
|
|
@@ -106,8 +108,6 @@ def upscale2(image, prompt):
|
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
with gr.Blocks() as app:
|
| 112 |
with gr.Row():
|
| 113 |
|
|
|
|
| 98 |
def upscale2(image, prompt):
|
| 99 |
print("upscale2",image,prompt)
|
| 100 |
|
| 101 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 102 |
+
pipeline = LDMSuperResolutionPipeline.from_pretrained("CompVis/ldm-super-resolution-4x-openimages")
|
| 103 |
+
pipeline = pipeline.to(device)
|
| 104 |
|
| 105 |
upscaled_image = pipeline(image, num_inference_steps=10, eta=1).images[0]
|
| 106 |
return upscaled_image
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
|
|
|
|
|
|
|
| 111 |
with gr.Blocks() as app:
|
| 112 |
with gr.Row():
|
| 113 |
|