AlekseyCalvin commited on
Commit
3c864f8
1 Parent(s): 12a5d67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -109,7 +109,7 @@ def update_selection(evt: gr.SelectData, width, height):
109
  )
110
 
111
  @spaces.GPU(duration=70)
112
- def generate_image(prompt, negative_prompt, trigger_word, steps, seed, cfg_scale, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
113
  pipe.to("cuda")
114
  generator = torch.Generator(device="cuda").manual_seed(seed)
115
 
@@ -123,12 +123,11 @@ def generate_image(prompt, negative_prompt, trigger_word, steps, seed, cfg_scale
123
  width=width,
124
  height=height,
125
  generator=generator,
126
- progress=gr.Progress(track_tqdm=True),
127
  joint_attention_kwargs={"scale": lora_scale},
128
  ).images[0]
129
  return image
130
 
131
- def run_lora(prompt, negative_prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
132
  if negative_prompt == "":
133
  negative_prompt = None
134
  if selected_index is None:
@@ -157,7 +156,7 @@ def run_lora(prompt, negative_prompt, cfg_scale, steps, selected_index, seed, wi
157
  pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_weights=[1.0])
158
  pipe.load_lora_weights(lora_path, adapter_name=selected_lora["repo"], adapter_weights=lora_scale)
159
 
160
- image = generate_image(prompt, negative_prompt, steps, seed, cfg_scale, width, height, lora_scale, progress)
161
  pipe.to("cpu")
162
  pipe.unload_lora_weights()
163
  return image, seed
 
109
  )
110
 
111
  @spaces.GPU(duration=70)
112
+ def generate_image(prompt, negative_prompt, trigger_word, steps, seed, cfg_scale, width, height, lora_scale):
113
  pipe.to("cuda")
114
  generator = torch.Generator(device="cuda").manual_seed(seed)
115
 
 
123
  width=width,
124
  height=height,
125
  generator=generator,
 
126
  joint_attention_kwargs={"scale": lora_scale},
127
  ).images[0]
128
  return image
129
 
130
+ def run_lora(prompt, negative_prompt, cfg_scale, steps, selected_index, seed, width, height, lora_scale):
131
  if negative_prompt == "":
132
  negative_prompt = None
133
  if selected_index is None:
 
156
  pipe.load_lora_weights("ostris/OpenFLUX.1", weight_name="openflux1-v0.1.0-fast-lora.safetensors", adapter_weights=[1.0])
157
  pipe.load_lora_weights(lora_path, adapter_name=selected_lora["repo"], adapter_weights=lora_scale)
158
 
159
+ image = generate_image(prompt, negative_prompt, steps, seed, cfg_scale, width, height, lora_scale)
160
  pipe.to("cpu")
161
  pipe.unload_lora_weights()
162
  return image, seed