Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,8 @@ from PIL import Image
|
|
| 5 |
|
| 6 |
# Load the model (this runs when the Space starts)
|
| 7 |
model_id = "nitrosocke/Ghibli-Diffusion"
|
| 8 |
-
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.
|
| 9 |
-
pipe = pipe.to("cuda") # Use GPU if available in the Space
|
| 10 |
|
| 11 |
# Define the inference function
|
| 12 |
def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5):
|
|
|
|
| 5 |
|
| 6 |
# Load the model (this runs when the Space starts)
|
| 7 |
model_id = "nitrosocke/Ghibli-Diffusion"
|
| 8 |
+
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float32) # Use float32 for CPU
|
| 9 |
+
#pipe = pipe.to("cuda") # Use GPU if available in the Space
|
| 10 |
|
| 11 |
# Define the inference function
|
| 12 |
def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5):
|