jocoandonob commited on
Commit
8db5115
·
1 Parent(s): 1e86eb1

Initial commitcq

Browse files
Files changed (2) hide show
  1. app.py +15 -14
  2. requirements.txt +1 -1
app.py CHANGED
@@ -72,8 +72,8 @@ def generate_image(prompt, seed, num_steps, guidance_scale, eta):
72
  )
73
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
74
 
75
- # Load and fuse LoRA weights
76
- pipe.load_lora_weights(tcd_lora_id)
77
  pipe.fuse_lora()
78
 
79
  # Generate the image
@@ -103,8 +103,8 @@ def generate_community_image(prompt, model_name, seed, num_steps, guidance_scale
103
  )
104
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
105
 
106
- # Load and fuse LoRA weights
107
- pipe.load_lora_weights(tcd_lora_id)
108
  pipe.fuse_lora()
109
 
110
  # Generate the image
@@ -135,9 +135,9 @@ def generate_style_mix(prompt, seed, num_steps, guidance_scale, eta, style_weigh
135
  )
136
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
137
 
138
- # Load multiple LoRA weights
139
- pipe.load_lora_weights(tcd_lora_id, adapter_name="tcd")
140
- pipe.load_lora_weights(styled_lora_id, adapter_name="style")
141
 
142
  # Set adapter weights
143
  pipe.set_adapters(["tcd", "style"], adapter_weights=[1.0, style_weight])
@@ -177,8 +177,8 @@ def generate_controlnet(prompt, init_image, seed, num_steps, guidance_scale, eta
177
  )
178
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
179
 
180
- # Load and fuse LoRA weights
181
- pipe.load_lora_weights(tcd_lora_id)
182
  pipe.fuse_lora()
183
 
184
  # Generate depth map
@@ -215,8 +215,8 @@ def inpaint_image(prompt, init_image, mask_image, seed, num_steps, guidance_scal
215
  )
216
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
217
 
218
- # Load and fuse LoRA weights
219
- pipe.load_lora_weights(tcd_lora_id)
220
  pipe.fuse_lora()
221
 
222
  # Generate the image
@@ -261,11 +261,12 @@ def generate_animation(prompt, seed, num_steps, guidance_scale, eta, num_frames,
261
  # Set TCD scheduler
262
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
263
 
264
- # Load LoRA weights
265
- pipe.load_lora_weights(tcd_lora_id, adapter_name="tcd")
266
  pipe.load_lora_weights(
267
  motion_lora_id,
268
- adapter_name="motion-lora"
 
269
  )
270
 
271
  # Set adapter weights
 
72
  )
73
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
74
 
75
+ # Load and fuse LoRA weights with prefix=None
76
+ pipe.load_lora_weights(tcd_lora_id, prefix=None)
77
  pipe.fuse_lora()
78
 
79
  # Generate the image
 
103
  )
104
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
105
 
106
+ # Load and fuse LoRA weights with prefix=None
107
+ pipe.load_lora_weights(tcd_lora_id, prefix=None)
108
  pipe.fuse_lora()
109
 
110
  # Generate the image
 
135
  )
136
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
137
 
138
+ # Load multiple LoRA weights with prefix=None
139
+ pipe.load_lora_weights(tcd_lora_id, adapter_name="tcd", prefix=None)
140
+ pipe.load_lora_weights(styled_lora_id, adapter_name="style", prefix=None)
141
 
142
  # Set adapter weights
143
  pipe.set_adapters(["tcd", "style"], adapter_weights=[1.0, style_weight])
 
177
  )
178
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
179
 
180
+ # Load and fuse LoRA weights with prefix=None
181
+ pipe.load_lora_weights(tcd_lora_id, prefix=None)
182
  pipe.fuse_lora()
183
 
184
  # Generate depth map
 
215
  )
216
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
217
 
218
+ # Load and fuse LoRA weights with prefix=None
219
+ pipe.load_lora_weights(tcd_lora_id, prefix=None)
220
  pipe.fuse_lora()
221
 
222
  # Generate the image
 
261
  # Set TCD scheduler
262
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
263
 
264
+ # Load LoRA weights with prefix=None
265
+ pipe.load_lora_weights(tcd_lora_id, adapter_name="tcd", prefix=None)
266
  pipe.load_lora_weights(
267
  motion_lora_id,
268
+ adapter_name="motion-lora",
269
+ prefix=None
270
  )
271
 
272
  # Set adapter weights
requirements.txt CHANGED
@@ -2,7 +2,7 @@ torch>=2.0.0
2
  diffusers>=0.24.0
3
  transformers>=4.36.0
4
  accelerate>=0.25.0
5
- gradio>=4.19.2
6
  safetensors>=0.4.0
7
  peft>=0.7.0
8
  requests>=2.31.0
 
2
  diffusers>=0.24.0
3
  transformers>=4.36.0
4
  accelerate>=0.25.0
5
+ gradio==4.44.1
6
  safetensors>=0.4.0
7
  peft>=0.7.0
8
  requests>=2.31.0