diff --git a/runner/gateway.openapi.yaml b/runner/gateway.openapi.yaml index 4da1dda7..57edc126 100644 --- a/runner/gateway.openapi.yaml +++ b/runner/gateway.openapi.yaml @@ -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 @@ -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 diff --git a/runner/openapi.yaml b/runner/openapi.yaml index 469f1b8a..5fd3b85a 100644 --- a/runner/openapi.yaml +++ b/runner/openapi.yaml @@ -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 @@ -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 diff --git a/worker/multipart.go b/worker/multipart.go index bc70ba8f..67e24b4f 100644 --- a/worker/multipart.go +++ b/worker/multipart.go @@ -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 @@ -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 diff --git a/worker/runner.gen.go b/worker/runner.gen.go index 587437ed..0e15ddce 100644 --- a/worker/runner.gen.go +++ b/worker/runner.gen.go @@ -122,6 +122,12 @@ type BodyGenImageToVideo struct { // Image Uploaded image to generate a video from. Image openapi_types.File `json:"image"` + // Prompt Text prompt(s) to guide video generation for prompt accepting models. + Prompt *string `json:"prompt,omitempty"` + + // NegativePrompt Text prompt(s) to guide what to exclude from video generation for prompt accepting models. Ignored if guidance_scale < 1. + NegativePrompt *string `json:"negative_prompt,omitempty"` + // ModelId Hugging Face model ID used for video generation. ModelId *string `json:"model_id,omitempty"` @@ -134,6 +140,9 @@ type BodyGenImageToVideo struct { // NumInferenceSteps Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. NumInferenceSteps *int `json:"num_inference_steps,omitempty"` + // NumFrames The number of video frames to generate. + NumFrames *int `json:"num_frames,omitempty"` + // SafetyCheck Perform a safety check to estimate if generated images could be offensive or harmful. SafetyCheck *bool `json:"safety_check,omitempty"`