Update app.py
Browse files
app.py
CHANGED
@@ -39,11 +39,11 @@ from scipy.interpolate import LinearNDInterpolator
|
|
39 |
from imageio import imread, imwrite
|
40 |
from diffusers import StableDiffusionImg2ImgPipeline
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
prompt = "space crew in a spaceship by Claude Monet"
|
48 |
image = pipe(prompt, source_img).images[0]
|
49 |
print(f"DIFFUSED IMG: {image}")
|
|
|
39 |
from imageio import imread, imwrite
|
40 |
from diffusers import StableDiffusionImg2ImgPipeline
|
41 |
|
42 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
43 |
+
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
44 |
+
pipe = pipe.to("cuda")
|
45 |
+
|
46 |
+
def diffuse(source_img):
|
47 |
prompt = "space crew in a spaceship by Claude Monet"
|
48 |
image = pipe(prompt, source_img).images[0]
|
49 |
print(f"DIFFUSED IMG: {image}")
|