yukee1992 commited on
Commit
d3cd31d
·
verified ·
1 Parent(s): 481e748

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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 'Oppenheimer/DALL-E_1.5' - a fine-tuned SD 1.5 model known for good results
13
- model_id = "Oppenheimer/DALL-E_1.5"
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