Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageRequest ¶
type ImageRequest struct {
braibottypes.GenerationRequest
Prompt string
ImageURL string // Optional for text2image
NumImages int // Number of images requested (for models that support it)
// Model-specific options parsed from command args
ImageSize string // e.g., "landscape_4_3"
Seed *int // Optional seed
NumInferenceSteps *int // Optional steps (e.g., flux/schnell)
EnableSafetyChecker *bool // Optional override
SafetyTolerance string // Optional tolerance (e.g., flux-pro)
OutputFormat string // Optional format (e.g., flux-pro)
NegativePrompt string // Optional negative prompt (e.g., hidream)
GuidanceScale *float64 // Optional guidance scale (e.g., hidream)
AspectRatio string // Optional aspect ratio string (e.g., flux-ultra)
Raw *bool // Optional raw flag (e.g., flux-ultra)
Acceleration string // Optional acceleration level (e.g., flux-2: none, regular, high)
EnablePromptExpansion *bool // Optional prompt expansion (e.g., flux-2)
}
ImageRequest represents a request to generate an image
type ImageResult ¶
ImageResult represents the result of an image generation
func (*ImageResult) GetError ¶
func (r *ImageResult) GetError() error
GetError returns the error from the image generation, if any.
func (*ImageResult) IsSuccess ¶
func (r *ImageResult) IsSuccess() bool
IsSuccess checks if the image generation was successful.
type ImageService ¶
type ImageService struct {
// contains filtered or unexported fields
}
ImageService handles image generation
func NewImageService ¶
func NewImageService(client *fal.Client, dbManager *database.DBManager, bot *kit.Bot, debug bool, billingEnabled bool) *ImageService
NewImageService creates a new ImageService
func (*ImageService) GenerateImage ¶
func (s *ImageService) GenerateImage(ctx context.Context, req *ImageRequest) (*ImageResult, error)
GenerateImage generates an image based on the request, handling billing after successful result sending.
Click to show internal directories.
Click to hide internal directories.