naykun commited on
Commit
20eb1ad
·
1 Parent(s): 59bff29
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -17,9 +17,10 @@ MAX_SEED = np.iinfo(np.int32).max
17
  from huggingface_hub import login
18
  login(token=os.environ.get('hf'))
19
 
20
- pipeline = QwenImageLayeredPipeline.from_pretrained("Qwen/Qwen-Image-Layered")
21
- pipeline = pipeline.to("cuda", torch.bfloat16)
22
- pipeline.set_progress_bar_config(disable=None)
 
23
 
24
  def ensure_dirname(path: str):
25
  if path and not os.path.exists(path):
 
17
  from huggingface_hub import login
18
  login(token=os.environ.get('hf'))
19
 
20
+ dtype = torch.bfloat16
21
+ device = "cuda" if torch.cuda.is_available() else "cpu"
22
+ pipeline = QwenImageLayeredPipeline.from_pretrained("Qwen/Qwen-Image-Layered", torch_dtype=dtype).to(device)
23
+ # pipeline.set_progress_bar_config(disable=None)
24
 
25
  def ensure_dirname(path: str):
26
  if path and not os.path.exists(path):