None1145 commited on
Commit
115b9e5
1 Parent(s): 63349a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import numpy as np
3
  import random
4
  from optimum.intel import OVStableDiffusionXLPipeline
5
  import torch
 
6
 
7
  model_id = "None1145/noobai-XL-Vpred-0.65s-openvino"
8
 
@@ -18,6 +19,8 @@ def reload_model(new_model_id):
18
  try:
19
  print(f"{model_id}...")
20
  pipe = OVStableDiffusionXLPipeline.from_pretrained(model_id, compile=False)
 
 
21
  # pipe.to("gpu")
22
  pipe.reshape(batch_size=1, height=prev_height, width=prev_width, num_images_per_prompt=1)
23
  pipe.compile()
 
3
  import random
4
  from optimum.intel import OVStableDiffusionXLPipeline
5
  import torch
6
+ from diffusers import EulerDiscreteScheduler
7
 
8
  model_id = "None1145/noobai-XL-Vpred-0.65s-openvino"
9
 
 
19
  try:
20
  print(f"{model_id}...")
21
  pipe = OVStableDiffusionXLPipeline.from_pretrained(model_id, compile=False)
22
+ scheduler_args = {"prediction_type": "v_prediction", "rescale_betas_zero_snr": True}
23
+ pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, **scheduler_args)
24
  # pipe.to("gpu")
25
  pipe.reshape(batch_size=1, height=prev_height, width=prev_width, num_images_per_prompt=1)
26
  pipe.compile()