Skip to content

Commit

Permalink
Added explore mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
igolaizola committed Jul 6, 2024
1 parent 2739fd1 commit 4ac03f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func newGenerateCommand() *ffcli.Command {
fs.BoolVar(&cfg.Watermark, "watermark", false, "add watermark (optional)")
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)")

return &ffcli.Command{
Name: cmd,
Expand Down Expand Up @@ -115,6 +116,7 @@ func newExtendCommand() *ffcli.Command {
fs.BoolVar(&cfg.Interpolate, "interpolate", true, "interpolate frames (optional)")
fs.BoolVar(&cfg.Upscale, "upscale", false, "upscale frames (optional)")
fs.BoolVar(&cfg.Watermark, "watermark", false, "add watermark (optional)")
fs.BoolVar(&cfg.Explore, "explore", false, "explore mode (optional)")

return &ffcli.Command{
Name: cmd,
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/extend/extend.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Config struct {
Interpolate bool
Upscale bool
Watermark bool
Explore bool
}

// Run generates a video from an image and a text prompt.
Expand Down Expand Up @@ -94,6 +95,7 @@ func Run(ctx context.Context, cfg *Config) error {
Upscale: cfg.Upscale,
Watermark: cfg.Watermark,
Extend: false,
ExploreMode: cfg.Explore,
})
if err != nil {
return fmt.Errorf("vidai: couldn't generate video: %w", err)
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Config struct {
Watermark bool
Width int
Height int
Explore bool
}

// Run generates a video from an image and a text prompt.
Expand Down Expand Up @@ -71,6 +72,7 @@ func Run(ctx context.Context, cfg *Config) error {
Extend: false,
Width: cfg.Width,
Height: cfg.Height,
ExploreMode: cfg.Explore,
})
if err != nil {
return fmt.Errorf("vidai: couldn't generate video: %w", err)
Expand Down
5 changes: 3 additions & 2 deletions pkg/runway/runway.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ type GenerateRequest struct {
Extend bool
Width int
Height int
ExploreMode bool
}

func (c *Client) Generate(ctx context.Context, cfg *GenerateRequest) (*Generation, error) {
Expand Down Expand Up @@ -316,7 +317,7 @@ func (c *Client) Generate(ctx context.Context, cfg *GenerateRequest) (*Generatio
},
Name: name,
AssetGroupName: "Generative Video",
ExploreMode: false,
ExploreMode: cfg.ExploreMode,
},
AsTeamID: c.teamID,
}
Expand All @@ -333,7 +334,7 @@ func (c *Client) Generate(ctx context.Context, cfg *GenerateRequest) (*Generatio
Seconds: 10,
TextPrompt: cfg.Prompt,
Seed: seed,
ExploreMode: false,
ExploreMode: cfg.ExploreMode,
Watermark: cfg.Watermark,
EnhancePrompt: true,
Width: width,
Expand Down

0 comments on commit 4ac03f0

Please sign in to comment.