mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-11-04 14:16:57 +00:00
fixed teacache bug
This commit is contained in:
parent
f0099e0e4b
commit
e718245407
@ -233,6 +233,10 @@ If you want to manage in different areas Loras for the 1.3B model and the 14B as
|
||||
- loras/1.3B
|
||||
- loras/14B
|
||||
|
||||
You can also put all the loras in the same place by launching the app with following command line (*path* is a path to shared loras directory):
|
||||
```
|
||||
python wgp.exe --lora-dir path --lora-dir-i2v path
|
||||
```
|
||||
|
||||
For each activated Lora, you may specify a *multiplier* that is one float number that corresponds to its weight (default is 1.0) .The multipliers for each Lora should be separated by a space character or a carriage return. For instance:\
|
||||
*1.2 0.8* means that the first lora will have a 1.2 multiplier and the second one will have 0.8.
|
||||
|
||||
@ -56,10 +56,10 @@ def sageattn_wrapper(
|
||||
attention_length
|
||||
):
|
||||
q,k, v = qkv_list
|
||||
padding_length = q.shape[0] -attention_length
|
||||
q = q[:attention_length, :, : ]
|
||||
k = k[:attention_length, :, : ]
|
||||
v = v[:attention_length, :, : ]
|
||||
padding_length = q.shape[1] -attention_length
|
||||
q = q[:, :attention_length, :, : ]
|
||||
k = k[:, :attention_length, :, : ]
|
||||
v = v[:, :attention_length, :, : ]
|
||||
if True:
|
||||
qkv_list = [q,k,v]
|
||||
del q, k ,v
|
||||
|
||||
@ -797,11 +797,12 @@ class WanModel(ModelMixin, ConfigMixin):
|
||||
|
||||
|
||||
def compute_teacache_threshold(self, start_step, timesteps = None, speed_factor =0):
|
||||
rescale_func = np.poly1d(self.coefficients)
|
||||
modulation_dtype = self.time_projection[1].weight.dtype
|
||||
rescale_func = np.poly1d(self.coefficients)
|
||||
e_list = []
|
||||
for t in timesteps:
|
||||
t = torch.stack([t])
|
||||
time_emb = self.time_embedding( sinusoidal_embedding_1d(self.freq_dim, t.flatten()).to(self.patch_embedding.weight.dtype) ) # b, dim
|
||||
time_emb = self.time_embedding( sinusoidal_embedding_1d(self.freq_dim, t.flatten()).to(modulation_dtype) ) # b, dim
|
||||
e_list.append(time_emb)
|
||||
best_deltas = None
|
||||
best_threshold = 0.01
|
||||
|
||||
Loading…
Reference in New Issue
Block a user