diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index c6181cf..06cb708 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -84,6 +84,7 @@ func newGenerateCommand() *ffcli.Command { fs.IntVar(&cfg.Width, "width", 0, "output video width (optional)") fs.IntVar(&cfg.Height, "height", 0, "output video height (optional)") fs.BoolVar(&cfg.Explore, "explore", false, "explore mode (optional)") + fs.BoolVar(&cfg.LastFrame, "last-frame", false, "use source image as the last frame (optional)") return &ffcli.Command{ Name: cmd, diff --git a/pkg/cmd/generate/generate.go b/pkg/cmd/generate/generate.go index d8a31ac..17f806a 100644 --- a/pkg/cmd/generate/generate.go +++ b/pkg/cmd/generate/generate.go @@ -31,6 +31,7 @@ type Config struct { Width int Height int Explore bool + LastFrame bool } // Run generates a video from an image and a text prompt. @@ -87,6 +88,7 @@ func Run(ctx context.Context, cfg *Config) error { Width: cfg.Width, Height: cfg.Height, ExploreMode: cfg.Explore, + LastFrame: cfg.LastFrame, }) if err != nil { return fmt.Errorf("vidai: couldn't generate video: %w", err) diff --git a/pkg/runway/runway.go b/pkg/runway/runway.go index 9027d79..56548ef 100644 --- a/pkg/runway/runway.go +++ b/pkg/runway/runway.go @@ -261,18 +261,19 @@ type createGen3TaskRequest struct { } type gen3Options struct { - Name string `json:"name"` - Seconds int `json:"seconds"` - TextPrompt string `json:"text_prompt"` - Seed int `json:"seed"` - ExploreMode bool `json:"exploreMode"` - Watermark bool `json:"watermark"` - EnhancePrompt bool `json:"enhance_prompt"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` - Resolution string `json:"resolution,omitempty"` - InitImage string `json:"init_image,omitempty"` - AssetGroupName string `json:"assetGroupName"` + Name string `json:"name"` + Seconds int `json:"seconds"` + TextPrompt string `json:"text_prompt"` + Seed int `json:"seed"` + ExploreMode bool `json:"exploreMode"` + Watermark bool `json:"watermark"` + EnhancePrompt bool `json:"enhance_prompt"` + Width int `json:"width,omitempty"` + Height int `json:"height,omitempty"` + Resolution string `json:"resolution,omitempty"` + InitImage string `json:"init_image,omitempty"` + ImageAsEndFrame bool `json:"image_as_end_frame"` + AssetGroupName string `json:"assetGroupName"` } type taskResponse struct { @@ -352,6 +353,7 @@ type GenerateRequest struct { Width int Height int ExploreMode bool + LastFrame bool } type Error struct { @@ -487,18 +489,19 @@ func (c *Client) Generate(ctx context.Context, cfg *GenerateRequest) (*Generatio TaskType: "gen3a", Internal: false, Options: gen3Options{ - Name: name, - Seconds: 10, - TextPrompt: cfg.Prompt, - Seed: seed, - ExploreMode: cfg.ExploreMode, - Watermark: cfg.Watermark, - EnhancePrompt: true, - Width: width, - Height: height, - InitImage: imageURL, - Resolution: resolution, - AssetGroupName: c.folder, + Name: name, + Seconds: 10, + TextPrompt: cfg.Prompt, + Seed: seed, + ExploreMode: cfg.ExploreMode, + Watermark: cfg.Watermark, + EnhancePrompt: true, + Width: width, + Height: height, + InitImage: imageURL, + Resolution: resolution, + AssetGroupName: c.folder, + ImageAsEndFrame: cfg.LastFrame, }, AsTeamID: c.teamID, }