changed scheduler
Browse files
app.py
CHANGED
|
@@ -8,13 +8,13 @@ from diffusers import StableDiffusionPipeline
|
|
| 8 |
#function to call API here
|
| 9 |
def show_image(prompt):
|
| 10 |
num_images = 2
|
| 11 |
-
scheduler = PNDMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", skip_prk_steps=True)
|
| 12 |
model_id = "runwayml/stable-diffusion-v1-5"
|
| 13 |
|
| 14 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 15 |
remove_safety = False
|
| 16 |
|
| 17 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler,
|
| 18 |
if remove_safety:
|
| 19 |
pipe.safety_checker = lambda images, clip_input: (images, False)
|
| 20 |
|
|
|
|
| 8 |
#function to call API here
|
| 9 |
def show_image(prompt):
|
| 10 |
num_images = 2
|
| 11 |
+
scheduler = PNDMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", skip_prk_steps=True, steps_offset=1)
|
| 12 |
model_id = "runwayml/stable-diffusion-v1-5"
|
| 13 |
|
| 14 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 15 |
remove_safety = False
|
| 16 |
|
| 17 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, revision="fp16", use_auth_token=True)
|
| 18 |
if remove_safety:
|
| 19 |
pipe.safety_checker = lambda images, clip_input: (images, False)
|
| 20 |
|