yanze commited on
Commit
2f5b111
1 Parent(s): 72e9d30

Update flux/util.py

Browse files
Files changed (1) hide show
  1. flux/util.py +2 -2
flux/util.py CHANGED
@@ -106,7 +106,7 @@ def load_flow_model(name: str, device: str = "cuda", hf_download: bool = True):
106
  print("Init model")
107
  ckpt_path = configs[name].ckpt_path
108
  if (
109
- ckpt_path is None
110
  and configs[name].repo_id is not None
111
  and configs[name].repo_flow is not None
112
  and hf_download
@@ -137,7 +137,7 @@ def load_clip(device: str = "cuda") -> HFEmbedder:
137
  def load_ae(name: str, device: str = "cuda", hf_download: bool = True) -> AutoEncoder:
138
  ckpt_path = configs[name].ae_path
139
  if (
140
- ckpt_path is None
141
  and configs[name].repo_id is not None
142
  and configs[name].repo_ae is not None
143
  and hf_download
 
106
  print("Init model")
107
  ckpt_path = configs[name].ckpt_path
108
  if (
109
+ not os.path.exists(ckpt_path)
110
  and configs[name].repo_id is not None
111
  and configs[name].repo_flow is not None
112
  and hf_download
 
137
  def load_ae(name: str, device: str = "cuda", hf_download: bool = True) -> AutoEncoder:
138
  ckpt_path = configs[name].ae_path
139
  if (
140
+ not os.path.exists(ckpt_path)
141
  and configs[name].repo_id is not None
142
  and configs[name].repo_ae is not None
143
  and hf_download