multimodalart HF Staff commited on
Commit
3263228
·
verified ·
1 Parent(s): 2acc5da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -389,7 +389,9 @@ def get_huggingface_safetensors(link):
389
  model_card = ModelCard.load(link)
390
  base_model = model_card.data.get("base_model")
391
  print(f"Base model: {base_model}")
392
- if base_model not in ["black-forest-labs/FLUX.1-dev", "black-forest-labs/FLUX.1-schnell"]:
 
 
393
  raise Exception("Not a FLUX LoRA!")
394
  image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
395
  trigger_word = model_card.data.get("instance_prompt", "")
 
389
  model_card = ModelCard.load(link)
390
  base_model = model_card.data.get("base_model")
391
  print(f"Base model: {base_model}")
392
+ acceptable_models = {"black-forest-labs/FLUX.1-dev", "black-forest-labs/FLUX.1-schnell"}
393
+ models_to_check = base_model if isinstance(base_model, list) else [base_model]
394
+ if not any(model in acceptable_models for model in models_to_check):
395
  raise Exception("Not a FLUX LoRA!")
396
  image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
397
  trigger_word = model_card.data.get("instance_prompt", "")