eienmojiki commited on
Commit
3ae8519
·
verified ·
1 Parent(s): 3360f9f

Update gui.py

Browse files
Files changed (1) hide show
  1. gui.py +6 -2
gui.py CHANGED
@@ -28,9 +28,10 @@ class GuiSD:
28
  self.model = Model_Diffusers(
29
  base_model_id="eienmojiki/Anything-XL",
30
  task_name="txt2img",
31
- vae_model="vaes/sdXL_v10VAEFix.safetensors",
32
  type_model_precision=torch.float16,
33
  retain_task_model_in_cache=False,
 
34
  )
35
  self.model_list = model_list
36
  self.task_stablepy = task_stablepy
@@ -67,6 +68,8 @@ class GuiSD:
67
  if incompatible_vae:
68
  vae_model = None
69
 
 
 
70
  self.model.load_pipe(
71
  model_name,
72
  task_name=self.task_stablepy[task],
@@ -76,7 +79,7 @@ class GuiSD:
76
  )
77
  yield f"Model loaded: {model_name}"
78
 
79
- @spaces.GPU(duration=80)
80
  def generate_pipeline(
81
  self,
82
  prompt,
@@ -252,6 +255,7 @@ class GuiSD:
252
 
253
  # First load
254
  model_precision = torch.float16
 
255
  if not self.model:
256
  from modelstream import Model_Diffusers2
257
 
 
28
  self.model = Model_Diffusers(
29
  base_model_id="eienmojiki/Anything-XL",
30
  task_name="txt2img",
31
+ vae_model=None,
32
  type_model_precision=torch.float16,
33
  retain_task_model_in_cache=False,
34
+ device="cpu",
35
  )
36
  self.model_list = model_list
37
  self.task_stablepy = task_stablepy
 
68
  if incompatible_vae:
69
  vae_model = None
70
 
71
+ self.model.device = torch.device("cpu")
72
+
73
  self.model.load_pipe(
74
  model_name,
75
  task_name=self.task_stablepy[task],
 
79
  )
80
  yield f"Model loaded: {model_name}"
81
 
82
+ @spaces.GPU
83
  def generate_pipeline(
84
  self,
85
  prompt,
 
255
 
256
  # First load
257
  model_precision = torch.float16
258
+ self.model.device = torch.device("cuda:0")
259
  if not self.model:
260
  from modelstream import Model_Diffusers2
261