video

package
v0.0.0-...-4b039c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentParser

type ArgumentParser struct{}

ArgumentParser parses command arguments for video generation

func NewArgumentParser

func NewArgumentParser() *ArgumentParser

NewArgumentParser creates a new ArgumentParser

func (*ArgumentParser) Parse

func (p *ArgumentParser) Parse(args []string, expectImageURL bool) (*ParseResult, error)

Parse parses all arguments, separating prompt, image URL (optional), and options.

func (*ArgumentParser) ParseAspectRatio

func (p *ArgumentParser) ParseAspectRatio(args []string) string

ParseAspectRatio parses the aspect ratio argument

func (*ArgumentParser) ParseCFGScale

func (p *ArgumentParser) ParseCFGScale(args []string) *float64

ParseCFGScale parses the CFG scale argument, returning a pointer or nil

func (*ArgumentParser) ParseDuration

func (p *ArgumentParser) ParseDuration(args []string) string

ParseDuration parses the duration argument

func (*ArgumentParser) ParseMulti2Video

func (p *ArgumentParser) ParseMulti2Video(args []string) (*ParseResult, error)

ParseMulti2Video parses arguments for the multi2video (reference-to-video) command. Usage: !multi2video [prompt text] [--image1..9 url] [--video1..3 url] [--audio1..3 url] [--duration N] [--aspect auto] [--resolution 720p] [--audio true|false] [--seed N]

func (*ArgumentParser) ParseNegativePrompt

func (p *ArgumentParser) ParseNegativePrompt(args []string) string

ParseNegativePrompt parses the negative prompt argument

func (*ArgumentParser) ParsePromptOptimizer

func (p *ArgumentParser) ParsePromptOptimizer(args []string) *bool

ParsePromptOptimizer parses the prompt optimizer flag, returning a pointer or nil

func (*ArgumentParser) ParseVideo2Video

func (p *ArgumentParser) ParseVideo2Video(args []string) (*ParseResult, error)

ParseVideo2Video parses arguments for the video2video command. Usage: !video2video [video_url] [prompt text] [--keep_audio true|false] [--image1 url] ... [--image4 url] [--duration N]

type ParseResult

type ParseResult struct {
	Prompt          string
	ImageURL        string // image2video only
	VideoURL        string // video2video only
	Duration        string
	AspectRatio     string
	NegativePrompt  string
	CFGScale        *float64
	PromptOptimizer *bool
	Resolution      string
	GenerateAudio   *bool
	KeepAudio       *bool // video2video only
	EndImageURL     string
	Seed            *int64
	ImageURLs       []string // multi2video / video2video
	VideoURLs       []string // multi2video only
	AudioURLs       []string // multi2video only
}

ParseResult holds the result of parsing command arguments. All parse functions return this struct; unused fields are zero-valued.

type VideoRequest

type VideoRequest struct {
	braibottypes.GenerationRequest
	Prompt                   string
	ImageURL                 string   // Optional, used by some image2video models (Veo2, Kling)
	SubjectReferenceImageURL string   // Optional, used by minimax-subject-reference
	Duration                 string   // Optional, defaults handled by FAL
	AspectRatio              string   // Optional, defaults handled by FAL
	Resolution               string   // Optional, defaults handled by FAL
	NegativePrompt           string   // Optional, defaults handled by FAL
	CFGScale                 *float64 // Optional, use pointer to track if set
	PromptOptimizer          *bool    // Optional, for minimax-director model
	GenerateAudio            *bool    // Optional, for Kling v3/O3 audio toggle
	EndImageURL              string   // Optional, for Kling v3 image2video end frame
	VideoURL                 string   // Required for video2video edit models
	KeepAudio                *bool    // Optional, for O3 edit (default: true)
	ImageURLs                []string // Optional, up to 4 reference images for O3 edit / up to 9 for Seedance multi2video
	VideoURLs                []string // Optional, up to 3 reference videos for Seedance multi2video
	AudioURLs                []string // Optional, up to 3 reference audio files for Seedance multi2video
	Seed                     *int64   // Optional, for reproducibility (Seedance 2.0)
}

VideoRequest represents a request to generate a video

type VideoResult

type VideoResult struct {
	VideoURL string
	Success  bool
	Error    error
}

VideoResult represents the result of a video generation

type VideoService

type VideoService struct {
	// contains filtered or unexported fields
}

VideoService handles video generation

func NewVideoService

func NewVideoService(client *fal.Client, dbManager *database.DBManager, bot *kit.Bot, debug bool, billingEnabled bool) *VideoService

NewVideoService creates a new VideoService

func (*VideoService) GenerateVideo

func (s *VideoService) GenerateVideo(ctx context.Context, req *VideoRequest) (*VideoResult, error)

GenerateVideo generates a video based on the request, handling billing conditionally.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL