Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,9 +8,9 @@ import time
|
|
| 8 |
device = "cpu"
|
| 9 |
print(f"Using device: {device}")
|
| 10 |
|
| 11 |
-
# Load a smaller, CPU-friendly model
|
| 12 |
-
# Using '
|
| 13 |
-
model_id = "
|
| 14 |
|
| 15 |
print("Loading pipeline... This may take a few minutes.")
|
| 16 |
try:
|
|
@@ -18,7 +18,9 @@ try:
|
|
| 18 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 19 |
model_id,
|
| 20 |
torch_dtype=torch.float32, # Critical for CPU
|
| 21 |
-
use_safetensors=True
|
|
|
|
|
|
|
| 22 |
)
|
| 23 |
|
| 24 |
# Optional: Use a faster scheduler for quicker generation
|
|
|
|
| 8 |
device = "cpu"
|
| 9 |
print(f"Using device: {device}")
|
| 10 |
|
| 11 |
+
# Load a smaller, CPU-friendly PUBLIC model
|
| 12 |
+
# Using 'dreamlike-art/dreamlike-diffusion-1.0' - a public fine-tuned model
|
| 13 |
+
model_id = "dreamlike-art/dreamlike-diffusion-1.0"
|
| 14 |
|
| 15 |
print("Loading pipeline... This may take a few minutes.")
|
| 16 |
try:
|
|
|
|
| 18 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 19 |
model_id,
|
| 20 |
torch_dtype=torch.float32, # Critical for CPU
|
| 21 |
+
use_safetensors=True,
|
| 22 |
+
safety_checker=None, # Disable safety checker to avoid NSFW filters that can cause issues
|
| 23 |
+
requires_safety_checker=False # Newer versions of diffusers need this
|
| 24 |
)
|
| 25 |
|
| 26 |
# Optional: Use a faster scheduler for quicker generation
|