bryanbrunetti commited on
Commit
ee4120c
·
verified ·
1 Parent(s): b555fee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -20,14 +20,11 @@ else:
20
  MAX_SEED = np.iinfo(np.int32).max
21
  MAX_IMAGE_SIZE = 2048
22
 
23
- print(f"Device is: {device}")
24
  # Initialize the pipeline globally
25
  pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
26
 
27
  lora_weights = {
28
- "jerry": {"path": "bryanbrunetti/jerryfluxlora", "weight_name": "jerry_000003000.safetensors"},
29
- "sebastian": {"path": "bryanbrunetti/sebastianfluxlora", "weight_name": "sadie_flux.safetensors"},
30
- "sadie": {"path": "bryanbrunetti/sadiefluxlora", "weight_name": "sebastian_flux_000001500.safetensors"},
31
  }
32
 
33
 
@@ -41,8 +38,7 @@ def infer(prompt, lora_models, seed=42, randomize_seed=False, width=1024, height
41
  try:
42
  for lora_model in lora_models:
43
  print(f"loading LoRA: {lora_model}")
44
- pipe.load_lora_weights(lora_weights[lora_model]["path"],
45
- weight_name=lora_weights[lora_model]["weight_name"])
46
  except Exception as e:
47
  return None, seed, f"Failed to load LoRA model: {str(e)}"
48
 
 
20
  MAX_SEED = np.iinfo(np.int32).max
21
  MAX_IMAGE_SIZE = 2048
22
 
 
23
  # Initialize the pipeline globally
24
  pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
25
 
26
  lora_weights = {
27
+ "cajerky": {"path": "bryanbrunetti/cajerky"}
 
 
28
  }
29
 
30
 
 
38
  try:
39
  for lora_model in lora_models:
40
  print(f"loading LoRA: {lora_model}")
41
+ pipe.load_lora_weights(lora_weights[lora_model]["path"])
 
42
  except Exception as e:
43
  return None, seed, f"Failed to load LoRA model: {str(e)}"
44