Skip to content

Commit

Permalink
chore:add extra needed inputs for LTX-Video model
Browse files Browse the repository at this point in the history
  • Loading branch information
RUFFY-369 committed Jan 8, 2025
1 parent 4d2275a commit af765de
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
16 changes: 16 additions & 0 deletions runner/gateway.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,17 @@ components:
format: binary
title: Image
description: Uploaded image to generate a video from.
prompt:
type: string
title: Prompt
description: Text prompt(s) to guide video generation for prompt accepting models.
default: ''
negative_prompt:
type: string
title: Negative Prompt
description: Text prompt(s) to guide what to exclude from video generation for prompt accepting models.
Ignored if guidance_scale < 1.
default: ''
model_id:
type: string
title: Model Id
Expand Down Expand Up @@ -709,6 +720,11 @@ components:
description: Number of denoising steps. More steps usually lead to higher
quality images but slower inference. Modulated by strength.
default: 25
num_frames:
type: integer
title: Num Frames
description: The number of video frames to generate.
default: 25
type: object
required:
- image
Expand Down
16 changes: 16 additions & 0 deletions runner/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,17 @@ components:
format: binary
title: Image
description: Uploaded image to generate a video from.
prompt:
type: string
title: Prompt
description: Text prompt(s) to guide video generation for prompt accepting models.
default: ''
negative_prompt:
type: string
title: Negative Prompt
description: Text prompt(s) to guide what to exclude from video generation for prompt accepting models.
Ignored if guidance_scale < 1.
default: ''
model_id:
type: string
title: Model Id
Expand Down Expand Up @@ -744,6 +755,11 @@ components:
description: Number of denoising steps. More steps usually lead to higher
quality images but slower inference. Modulated by strength.
default: 25
num_frames:
type: integer
title: Num Frames
description: The number of video frames to generate.
default: 25
type: object
required:
- image
Expand Down
15 changes: 15 additions & 0 deletions worker/multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ func NewImageToVideoMultipartWriter(w io.Writer, req GenImageToVideoMultipartReq
return nil, fmt.Errorf("failed to copy image to multipart request imageBytes=%v copiedBytes=%v", imageSize, copied)
}

if req.Prompt != nil {
if err := mw.WriteField("prompt", req.Prompt); err != nil {
return nil, err
}
}
if req.NegativePrompt != nil {
if err := mw.WriteField("negative_prompt", *req.NegativePrompt); err != nil {
return nil, err
}
}
if req.ModelId != nil {
if err := mw.WriteField("model_id", *req.ModelId); err != nil {
return nil, err
Expand Down Expand Up @@ -157,6 +167,11 @@ func NewImageToVideoMultipartWriter(w io.Writer, req GenImageToVideoMultipartReq
return nil, err
}
}
if req.NumFrames != nil {
if err := mw.WriteField("num_frames", strconv.Itoa(*req.NumFrames)); err != nil {
return nil, err
}
}

if err := mw.Close(); err != nil {
return nil, err
Expand Down
9 changes: 9 additions & 0 deletions worker/runner.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af765de

Please sign in to comment.