Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions finetrainers/models/hunyuan_video/base_specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
AutoencoderKLHunyuanVideo,
FlowMatchEulerDiscreteScheduler,
HunyuanVideoPipeline,
HunyuanVideoImageToVideoPipeline,
HunyuanVideoTransformer3DModel,
)
from diffusers.models.autoencoders.vae import DiagonalGaussianDistribution
from PIL.Image import Image
from transformers import AutoTokenizer, CLIPTextModel, CLIPTokenizer, LlamaModel

from ... import data
Expand Down Expand Up @@ -358,15 +360,20 @@ def validation(
self,
pipeline: HunyuanVideoPipeline,
prompt: str,
image: Optional[Image] = None,
height: Optional[int] = None,
width: Optional[int] = None,
num_frames: Optional[int] = None,
num_inference_steps: int = 50,
generator: Optional[torch.Generator] = None,
**kwargs,
) -> List[ArtifactType]:
if image is not None:
pipeline = HunyuanVideoImageToVideoPipeline.from_pipe(pipeline)

generation_kwargs = {
"prompt": prompt,
"image": image,
"height": height,
"width": width,
"num_frames": num_frames,
Expand Down