fixed ltxv issues

This commit is contained in:
deepbeepmeep 2025-07-22 11:37:14 +02:00
parent 6b348b97e8
commit 03c62556c1
2 changed files with 2 additions and 2 deletions

View File

@ -1412,7 +1412,7 @@ class LTXVideoPipeline(DiffusionPipeline):
sigmoid_term = torch.sigmoid(4.0 * scale_factor * (abs_latents - 1.0))
# DeepBeepMeep special touch to allow a smooth transition with tone mapping
if start > 0:
gradient_tensor = torch.linspace(0, 1, latents.shape[2])
gradient_tensor = torch.linspace(0, 1, latents.shape[2],dtype= sigmoid_term.dtype, device=sigmoid_term.device)
gradient_tensor = gradient_tensor ** 0.5
gradient_tensor = gradient_tensor[ None, None, :, None, None ]
sigmoid_term *= gradient_tensor

2
wgp.py
View File

@ -4468,7 +4468,7 @@ def generate_video(
status_info = "Extracting " + processes_names[preprocess_type]
send_cmd("progress", [0, get_latest_status(state, status_info)])
# start one frame ealier to faciliate latents merging later
src_video, _ = preprocess_video_with_mask(video_guide, video_mask, height=image_size[0], width = image_size[1], max_frames= len(keep_frames_parsed) + (0 if guide_start_frame == 0 else 1), start_frame = guide_start_frame - (0 if guide_start_frame == 0 else 1), fit_canvas = sample_fit_canvas, target_fps = fps, process_type = preprocess_type, inpaint_color = 0, proc_no =1, negate_mask = "N" in video_prompt_type, process_outside_mask = "inpaint" if "X" in video_prompt_type else "identity" )
src_video, _ = preprocess_video_with_mask(video_guide, video_mask, height=image_size[0], width = image_size[1], max_frames= len(keep_frames_parsed) + (0 if guide_start_frame == 0 else 1), start_frame = guide_start_frame - (0 if guide_start_frame == 0 else 1), fit_canvas = sample_fit_canvas, target_fps = fps, process_type = preprocess_type, inpaint_color = 0, proc_no =1, negate_mask = "N" in video_prompt_type, process_outside_mask = "inpaint" if "X" in video_prompt_type else "identity", block_size =32 )
if src_video != None:
src_video = src_video[ :(len(src_video)-1)// latent_size * latent_size +1 ]
refresh_preview["video_guide"] = Image.fromarray(src_video[0].cpu().numpy())