mirror of
https://github.com/storytold/FineTrainers-Conditioning.git
synced 2026-10-09 00:09:45 +00:00
Full Finetune should work with this adapter removed the residual_x
This commit is contained in:
@@ -93,8 +93,7 @@ class LTXVideoConditionedTransformer3DModel(LTXVideoTransformer3DModel):
|
||||
return_dict: bool = True,
|
||||
residual_x: torch.Tensor = None
|
||||
) -> torch.Tensor:
|
||||
if residual_x == None:
|
||||
print("Residual Not included in the calculation.")
|
||||
|
||||
image_rotary_emb = self.rope(hidden_states, num_frames, height, width, rope_interpolation_scale)
|
||||
|
||||
# convert encoder_attention_mask to a bias the same way we do for attention_mask
|
||||
|
||||
@@ -119,6 +119,10 @@ def conditioned_forward_pass(
|
||||
# encoder_hidden_states=prompt_embeds,
|
||||
# timestep=timesteps,
|
||||
# encoder_attention_mask=prompt_attention_mask,
|
||||
|
||||
if noisy_latents_residual == None:
|
||||
print("Residual Not included in the calculation.")
|
||||
|
||||
denoised_latents = transformer(
|
||||
hidden_states=noisy_latents,
|
||||
encoder_hidden_states=prompt_embeds,
|
||||
|
||||
@@ -840,7 +840,7 @@ class Trainer:
|
||||
# That dict says latents but actually tokens.
|
||||
latent_conditions.update({"noisy_latents": condition_tokens["latents"]})
|
||||
# input video noise at level residual information to adapter
|
||||
latent_conditions.update({"noisy_latents_residual":noisy_residual_tokens["latents"]})
|
||||
# latent_conditions.update({"noisy_latents_residual":noisy_residual_tokens["latents"]})
|
||||
else:
|
||||
# Default to flow-matching noise addition
|
||||
noisy_latents = (1.0 - sigmas) * latent_conditions["latents"] + sigmas * noise
|
||||
|
||||
Reference in New Issue
Block a user