Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,8 @@ import gradio as gr
|
|
4 |
from diffusers import StableDiffusionImg2ImgPipeline
|
5 |
|
6 |
# Load the Stable Diffusion img2img pipeline
|
7 |
-
device = "cpu"
|
|
|
8 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
9 |
"runwayml/stable-diffusion-v1-5",
|
10 |
torch_dtype=torch.float16,
|
@@ -37,7 +38,7 @@ def generate_image(init_image, prompt_choice, strength, guidance_scale):
|
|
37 |
|
38 |
# Gradio interface
|
39 |
with gr.Blocks() as demo:
|
40 |
-
gr.Markdown("
|
41 |
with gr.Row():
|
42 |
with gr.Column():
|
43 |
init_image = gr.Image(label="Upload Initial Image", type="pil")
|
|
|
4 |
from diffusers import StableDiffusionImg2ImgPipeline
|
5 |
|
6 |
# Load the Stable Diffusion img2img pipeline
|
7 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
+
|
9 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
10 |
"runwayml/stable-diffusion-v1-5",
|
11 |
torch_dtype=torch.float16,
|
|
|
38 |
|
39 |
# Gradio interface
|
40 |
with gr.Blocks() as demo:
|
41 |
+
gr.Markdown("Corroded Pipeline Generator - Underwater Img2Img")
|
42 |
with gr.Row():
|
43 |
with gr.Column():
|
44 |
init_image = gr.Image(label="Upload Initial Image", type="pil")
|