Documentation
¶
Overview ¶
Package apiframe provides a Go client library for the Apiframe API.
Apiframe is the ultimate platform for AI image and video generation APIs, supporting multiple AI services including Midjourney, Flux, Ideogram, Luma, Suno, Udio, Runway, Kling, and AI Photos.
Installation ¶
go get github.com/apiframe-ai/apiframe-go-sdk
Quick Start ¶
Create a client and generate an image:
package main
import (
"fmt"
"log"
"os"
"github.com/apiframe-ai/apiframe-go-sdk"
)
func main() {
// Create client
client, err := apiframe.NewClient(apiframe.Config{
APIKey: os.Getenv("APIFRAME_API_KEY"),
})
if err != nil {
log.Fatal(err)
}
// Generate an image
task, err := client.Midjourney.Imagine(apiframe.MidjourneyImagineParams{
Prompt: "a beautiful sunset over mountains",
AspectRatio: "16:9",
})
if err != nil {
log.Fatal(err)
}
// Wait for completion
result, err := client.Tasks.WaitFor(task.ID, &apiframe.WaitForOptions{
OnProgress: func(progress int) {
fmt.Printf("Progress: %d%%\n", progress)
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Images: %v\n", result.ImageURLs)
}
Services ¶
The SDK provides access to the following services:
- Tasks: Task management (Get, GetMany, WaitFor, GetAccountInfo)
- Midjourney: Original Midjourney API (Imagine, Upscale, Variations, Blend, etc.)
- MidjourneyAlt: Pro Midjourney API with Fast & Turbo modes
- Flux: Flux AI image generation (Pro, Dev, Schnell models)
- Ideogram: Creative image generation (Generate, Upscale, Describe, Remix)
- Luma: Video generation (Generate, Extend)
- Suno: Music generation (Generate, Upload, Extend, Generate Lyrics)
- Udio: Advanced music creation
- Runway: Gen-3 video generation (Text2Video, Image2Video, Video2Video)
- Kling: Video generation and virtual try-on
- AIPhotos: AI headshots and photo generation
- Media: Image and audio upload
Error Handling ¶
The SDK provides custom error types for different failure scenarios:
task, err := client.Midjourney.Imagine(params)
if err != nil {
switch e := err.(type) {
case *apiframe.AuthenticationError:
fmt.Println("Invalid API key")
case *apiframe.RateLimitError:
fmt.Println("Rate limit exceeded")
case *apiframe.TimeoutError:
fmt.Println("Request timed out")
case *apiframe.Error:
fmt.Printf("API error: %s\n", e.Message)
}
return
}
Configuration ¶
Configure the client with custom settings:
client, err := apiframe.NewClient(apiframe.Config{
APIKey: "your_api_key",
BaseURL: "https://api.apiframe.ai", // Optional
Timeout: 300000, // Optional (milliseconds)
})
Progress Tracking ¶
Track task progress with callbacks:
result, err := client.Tasks.WaitFor(taskID, &apiframe.WaitForOptions{
OnProgress: func(progress int) {
fmt.Printf("Progress: %d%%\n", progress)
},
Interval: 3000, // Polling interval in ms
Timeout: 300000, // Max wait time in ms
})
Documentation ¶
For more information, visit:
- Documentation: https://docs.apiframe.ai
- GitHub: https://github.com/apiframe-ai/apiframe-go-sdk
- Examples: https://github.com/apiframe-ai/apiframe-go-sdk/tree/main/examples
Index ¶
- func NewAuthenticationError(message string) error
- func NewRateLimitError(message string) error
- func NewTimeoutError(message string) error
- type AIPhotos
- type AIPhotosGenerateParams
- type AIPhotosTrainParams
- type AIPhotosUploadParams
- type AccountInfo
- type AuthenticationError
- type Client
- type Config
- type Error
- type Flux
- func (f *Flux) Generate(params FluxGenerateParams) (*TaskResponse, error)
- func (f *Flux) GenerateDev(params FluxGenerateParams) (*TaskResponse, error)
- func (f *Flux) GeneratePro(params FluxGenerateParams) (*TaskResponse, error)
- func (f *Flux) GenerateSchnell(params FluxGenerateParams) (*TaskResponse, error)
- type FluxGenerateParams
- type HTTPClient
- func (h *HTTPClient) Delete(url string, result interface{}) error
- func (h *HTTPClient) Get(url string, result interface{}) error
- func (h *HTTPClient) Patch(url string, body interface{}, result interface{}) error
- func (h *HTTPClient) Post(url string, body interface{}, result interface{}) error
- func (h *HTTPClient) PostFormData(url string, formData map[string]interface{}, result interface{}) error
- func (h *HTTPClient) Put(url string, body interface{}, result interface{}) error
- func (h *HTTPClient) SetFileBytes(url string, fieldName string, fileName string, fileBytes []byte, ...) error
- type Ideogram
- func (i *Ideogram) Describe(params IdeogramDescribeParams) (*TaskResponse, error)
- func (i *Ideogram) Generate(params IdeogramGenerateParams) (*TaskResponse, error)
- func (i *Ideogram) Remix(params IdeogramRemixParams) (*TaskResponse, error)
- func (i *Ideogram) Upscale(params IdeogramUpscaleParams) (*TaskResponse, error)
- type IdeogramDescribeParams
- type IdeogramGenerateParams
- type IdeogramRemixParams
- type IdeogramUpscaleParams
- type Kling
- func (k *Kling) Generate(params KlingGenerateParams) (*TaskResponse, error)
- func (k *Kling) ImageToVideo(imageURL string, prompt string, model string, mode string, duration int) (*TaskResponse, error)
- func (k *Kling) TextToVideo(prompt string, aspectRatio string, model string, duration int) (*TaskResponse, error)
- func (k *Kling) Tryon(params KlingTryonParams) (*TaskResponse, error)
- type KlingGenerateParams
- type KlingTryonParams
- type Luma
- type LumaExtendParams
- type LumaGenerateParams
- type Media
- type MediaUploadAudioResponse
- type MediaUploadResponse
- type Midjourney
- func (m *Midjourney) Blend(params MidjourneyBlendParams) (*TaskResponse, error)
- func (m *Midjourney) Describe(params MidjourneyDescribeParams) (*TaskResponse, error)
- func (m *Midjourney) ExtendVideo(params MidjourneyExtendVideoParams) (*TaskResponse, error)
- func (m *Midjourney) FaceSwap(params MidjourneyFaceSwapParams) (*TaskResponse, error)
- func (m *Midjourney) Imagine(params MidjourneyImagineParams) (*TaskResponse, error)
- func (m *Midjourney) ImagineVideo(params MidjourneyImagineVideoParams) (*TaskResponse, error)
- func (m *Midjourney) Inpaint(params MidjourneyInpaintParams) (*TaskResponse, error)
- func (m *Midjourney) Outpaint(params MidjourneyOutpaintParams) (*TaskResponse, error)
- func (m *Midjourney) Pan(params MidjourneyPanParams) (*TaskResponse, error)
- func (m *Midjourney) Reroll(params MidjourneyRerollParams) (*TaskResponse, error)
- func (m *Midjourney) Seed(params MidjourneySeedParams) (*TaskResponse, error)
- func (m *Midjourney) Shorten(params MidjourneyShortenParams) (*TaskResponse, error)
- func (m *Midjourney) Upscale(params MidjourneyUpscaleParams) (*TaskResponse, error)
- func (m *Midjourney) Upscale1x(params MidjourneyUpscale1xParams) (*TaskResponse, error)
- func (m *Midjourney) UpscaleAlt(params MidjourneyUpscaleAltParams) (*TaskResponse, error)
- func (m *Midjourney) UpscaleHighres(params MidjourneyUpscaleHighresParams) (*TaskResponse, error)
- func (m *Midjourney) Variations(params MidjourneyVariationsParams) (*TaskResponse, error)
- func (m *Midjourney) Vary(params MidjourneyVaryParams) (*TaskResponse, error)
- func (m *Midjourney) Zoom(params MidjourneyZoomParams) (*TaskResponse, error)
- type MidjourneyAlt
- func (m *MidjourneyAlt) GetAccountInfo() (map[string]interface{}, error)
- func (m *MidjourneyAlt) GetGeneration(generationID string) (*TaskResponse, error)
- func (m *MidjourneyAlt) Imagine(params MidjourneyAltImagineParams) (*TaskResponse, error)
- func (m *MidjourneyAlt) Pan(params MidjourneyAltPanParams) (*TaskResponse, error)
- func (m *MidjourneyAlt) Upscale(params MidjourneyAltUpscaleParams) (*TaskResponse, error)
- func (m *MidjourneyAlt) Variations(params MidjourneyAltVariationsParams) (*TaskResponse, error)
- func (m *MidjourneyAlt) Vary(params MidjourneyAltVaryParams) (*TaskResponse, error)
- func (m *MidjourneyAlt) Zoom(params MidjourneyAltZoomParams) (*TaskResponse, error)
- type MidjourneyAltImagineParams
- type MidjourneyAltPanParams
- type MidjourneyAltUpscaleParams
- type MidjourneyAltVariationsParams
- type MidjourneyAltVaryParams
- type MidjourneyAltZoomParams
- type MidjourneyBlendParams
- type MidjourneyDescribeParams
- type MidjourneyExtendVideoParams
- type MidjourneyFaceSwapParams
- type MidjourneyImagineParams
- type MidjourneyImagineVideoParams
- type MidjourneyInpaintParams
- type MidjourneyOutpaintParams
- type MidjourneyPanParams
- type MidjourneyRerollParams
- type MidjourneySeedParams
- type MidjourneyShortenParams
- type MidjourneyUpscale1xParams
- type MidjourneyUpscaleAltParams
- type MidjourneyUpscaleHighresParams
- type MidjourneyUpscaleParams
- type MidjourneyVariationsParams
- type MidjourneyVaryParams
- type MidjourneyZoomParams
- type RateLimitError
- type Runway
- func (r *Runway) Generate(params RunwayGenerateParams) (*TaskResponse, error)
- func (r *Runway) ImageToVideo(imageURL string, prompt string, model string, duration int) (*TaskResponse, error)
- func (r *Runway) TextToVideo(prompt string, aspectRatio string, model string, duration int) (*TaskResponse, error)
- func (r *Runway) VideoToVideo(videoURL string, prompt string, model string, duration int) (*TaskResponse, error)
- type RunwayGenerateParams
- type Suno
- type SunoExtendParams
- type SunoGenerateParams
- type SunoLyricsParams
- type SunoUploadParams
- type TaskResponse
- type TaskStatus
- type Tasks
- type TasksResponse
- type TimeoutError
- type Udio
- type UdioGenerateParams
- type ValidationError
- type WaitForOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthenticationError ¶
NewAuthenticationError creates a new authentication error
func NewRateLimitError ¶
NewRateLimitError creates a new rate limit error
func NewTimeoutError ¶
NewTimeoutError creates a new timeout error
Types ¶
type AIPhotos ¶
type AIPhotos struct {
// contains filtered or unexported fields
}
AIPhotos provides methods for AI Photos generation
func NewAIPhotos ¶
func NewAIPhotos(httpClient *HTTPClient) *AIPhotos
NewAIPhotos creates a new AIPhotos service
func (*AIPhotos) Generate ¶
func (a *AIPhotos) Generate(params AIPhotosGenerateParams) (*TaskResponse, error)
Generate generates realistic photos of the subject using the trained model
func (*AIPhotos) Train ¶
func (a *AIPhotos) Train(params AIPhotosTrainParams) (*TaskResponse, error)
Train trains AI on a human subject using previously uploaded and prepared images
func (*AIPhotos) Upload ¶
func (a *AIPhotos) Upload(params AIPhotosUploadParams) (*TaskResponse, error)
Upload uploads 10 to 30 images of the subject and prepares them for AI training
type AIPhotosGenerateParams ¶
type AIPhotosGenerateParams struct {
TrainingID string `json:"training_id"`
Prompt string `json:"prompt"`
AspectRatio string `json:"aspect_ratio,omitempty"`
Width string `json:"width,omitempty"`
Height string `json:"height,omitempty"`
NumberOfImages string `json:"number_of_images,omitempty"` // 1-4
Seed *int `json:"seed,omitempty"`
}
AIPhotosGenerateParams represents parameters for AI Photos generation
type AIPhotosTrainParams ¶
type AIPhotosTrainParams struct {
TrainingImagesID string `json:"training_images_id"`
TriggerWord string `json:"trigger_word,omitempty"` // Default: 'TOKMSN'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
AIPhotosTrainParams represents parameters for AI Photos training
type AIPhotosUploadParams ¶
type AIPhotosUploadParams struct {
Images []string `json:"images"` // Base64 array of 10-30 images
Ethnicity string `json:"ethnicity"`
Gender string `json:"gender"` // 'female', 'male'
Age int `json:"age"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
AIPhotosUploadParams represents parameters for AI Photos upload
type AccountInfo ¶
type AccountInfo struct {
Email string `json:"email"`
Credits int `json:"credits"`
TotalImages int `json:"total_images"`
Plan string `json:"plan"`
}
AccountInfo represents account information
type AuthenticationError ¶
type AuthenticationError struct {
Err *Error
}
AuthenticationError represents an authentication error (401)
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
Error implements the error interface
type Client ¶
type Client struct {
// Tasks provides task management methods
Tasks *Tasks
// Midjourney provides Original Midjourney API methods
Midjourney *Midjourney
// MidjourneyAlt provides Pro Midjourney API methods with Fast & Turbo modes
MidjourneyAlt *MidjourneyAlt
// Flux provides Flux AI image generation methods
Flux *Flux
// Ideogram provides Ideogram image generation methods
Ideogram *Ideogram
// Luma provides Luma AI video generation methods
Luma *Luma
// Suno provides Suno AI music generation methods
Suno *Suno
// Udio provides Udio AI music generation methods
Udio *Udio
// Runway provides Runway ML video generation methods
Runway *Runway
// Kling provides Kling AI video generation methods
Kling *Kling
// AIPhotos provides AI Photos generation methods
AIPhotos *AIPhotos
// Media provides media upload methods
Media *Media
// contains filtered or unexported fields
}
Client is the main Apiframe SDK client
Example usage:
client, err := apiframe.NewClient(apiframe.Config{
APIKey: "your_api_key_here",
})
if err != nil {
log.Fatal(err)
}
task, err := client.Midjourney.Imagine(apiframe.MidjourneyImagineParams{
Prompt: "a beautiful sunset",
AspectRatio: "16:9",
})
if err != nil {
log.Fatal(err)
}
result, err := client.Tasks.WaitFor(task.ID, &apiframe.WaitForOptions{
OnProgress: func(progress int) {
fmt.Printf("Progress: %d%%\n", progress)
},
})
type Error ¶
Error represents a general Apiframe SDK error
type Flux ¶
type Flux struct {
// contains filtered or unexported fields
}
Flux provides methods for Flux AI image generation
func (*Flux) Generate ¶
func (f *Flux) Generate(params FluxGenerateParams) (*TaskResponse, error)
Generate generates images using Flux AI
func (*Flux) GenerateDev ¶
func (f *Flux) GenerateDev(params FluxGenerateParams) (*TaskResponse, error)
GenerateDev generates images using Flux Dev Convenience method that sets model to 'flux-dev'
func (*Flux) GeneratePro ¶
func (f *Flux) GeneratePro(params FluxGenerateParams) (*TaskResponse, error)
GeneratePro generates images using Flux Pro Convenience method that sets model to 'flux-pro'
func (*Flux) GenerateSchnell ¶
func (f *Flux) GenerateSchnell(params FluxGenerateParams) (*TaskResponse, error)
GenerateSchnell generates images using Flux Schnell (fast mode) Convenience method that sets model to 'flux-schnell'
type FluxGenerateParams ¶
type FluxGenerateParams struct {
Model string `json:"model"` // 'flux-schnell', 'flux-pro', 'flux-dev', 'flux-pro-1.1', 'flux-pro-1.1-ultra'
Prompt string `json:"prompt"`
ImagePrompt string `json:"image_prompt,omitempty"` // base64 encoded image
ImagePromptStrength *float64 `json:"image_prompt_strength,omitempty"` // 0-1
PromptUpsampling *bool `json:"prompt_upsampling,omitempty"`
Width *int `json:"width,omitempty"` // min 256, max 1440
Height *int `json:"height,omitempty"` // min 256, max 1440
AspectRatio string `json:"aspect_ratio,omitempty"`
Steps *int `json:"steps,omitempty"`
Guidance *float64 `json:"guidance,omitempty"`
Interval *int `json:"interval,omitempty"` // default 2, min 1, max 4
Seed *int `json:"seed,omitempty"`
SafetyTolerance *int `json:"safety_tolerance,omitempty"` // 0-6
Raw *bool `json:"raw,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
FluxGenerateParams represents parameters for Flux generation
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient handles all HTTP requests to the Apiframe API
func NewHTTPClient ¶
func NewHTTPClient(config Config) (*HTTPClient, error)
NewHTTPClient creates a new HTTP client
func (*HTTPClient) Delete ¶
func (h *HTTPClient) Delete(url string, result interface{}) error
Delete performs a DELETE request
func (*HTTPClient) Get ¶
func (h *HTTPClient) Get(url string, result interface{}) error
Get performs a GET request
func (*HTTPClient) Patch ¶
func (h *HTTPClient) Patch(url string, body interface{}, result interface{}) error
Patch performs a PATCH request
func (*HTTPClient) Post ¶
func (h *HTTPClient) Post(url string, body interface{}, result interface{}) error
Post performs a POST request
func (*HTTPClient) PostFormData ¶
func (h *HTTPClient) PostFormData(url string, formData map[string]interface{}, result interface{}) error
PostFormData performs a POST request with multipart form data
func (*HTTPClient) Put ¶
func (h *HTTPClient) Put(url string, body interface{}, result interface{}) error
Put performs a PUT request
func (*HTTPClient) SetFileBytes ¶
func (h *HTTPClient) SetFileBytes(url string, fieldName string, fileName string, fileBytes []byte, result interface{}) error
SetFileBytes performs a POST request with a file
type Ideogram ¶
type Ideogram struct {
// contains filtered or unexported fields
}
Ideogram provides methods for Ideogram image generation
func NewIdeogram ¶
func NewIdeogram(httpClient *HTTPClient) *Ideogram
NewIdeogram creates a new Ideogram service
func (*Ideogram) Describe ¶
func (i *Ideogram) Describe(params IdeogramDescribeParams) (*TaskResponse, error)
Describe extensively describes a provided image
func (*Ideogram) Generate ¶
func (i *Ideogram) Generate(params IdeogramGenerateParams) (*TaskResponse, error)
Generate generates images using Ideogram
func (*Ideogram) Remix ¶
func (i *Ideogram) Remix(params IdeogramRemixParams) (*TaskResponse, error)
Remix generates images with remix (image-to-image)
func (*Ideogram) Upscale ¶
func (i *Ideogram) Upscale(params IdeogramUpscaleParams) (*TaskResponse, error)
Upscale upscales an existing image to higher quality and resolution
type IdeogramDescribeParams ¶
type IdeogramDescribeParams struct {
ImageURL string `json:"image_url"`
}
IdeogramDescribeParams represents parameters for Ideogram describe
type IdeogramGenerateParams ¶
type IdeogramGenerateParams struct {
Prompt string `json:"prompt"`
StyleType string `json:"style_type,omitempty"`
NegativePrompt string `json:"negative_prompt,omitempty"`
Seed *int `json:"seed,omitempty"`
MagicPromptOption string `json:"magic_prompt_option,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty"`
Resolution string `json:"resolution,omitempty"`
}
IdeogramGenerateParams represents parameters for Ideogram generation
type IdeogramRemixParams ¶
type IdeogramRemixParams struct {
ImageURL string `json:"image_url"`
Prompt string `json:"prompt"`
ImageWeight int `json:"image_weight"` // 1-100
StyleType string `json:"style_type,omitempty"`
NegativePrompt string `json:"negative_prompt,omitempty"`
Seed *int `json:"seed,omitempty"`
MagicPromptOption string `json:"magic_prompt_option,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty"`
Resolution string `json:"resolution,omitempty"`
}
IdeogramRemixParams represents parameters for Ideogram remix
type IdeogramUpscaleParams ¶
type IdeogramUpscaleParams struct {
ImageURL string `json:"image_url"`
Prompt string `json:"prompt"`
Resemblance int `json:"resemblance"` // 1-100
Detail *int `json:"detail,omitempty"` // 1-100
Seed *int `json:"seed,omitempty"`
MagicPromptOption string `json:"magic_prompt_option,omitempty"`
}
IdeogramUpscaleParams represents parameters for Ideogram upscale
type Kling ¶
type Kling struct {
// contains filtered or unexported fields
}
Kling provides methods for Kling AI video generation
func (*Kling) Generate ¶
func (k *Kling) Generate(params KlingGenerateParams) (*TaskResponse, error)
Generate generates video based on a prompt and/or an image input
func (*Kling) ImageToVideo ¶
func (k *Kling) ImageToVideo(imageURL string, prompt string, model string, mode string, duration int) (*TaskResponse, error)
ImageToVideo is a convenience method for image to video generation
func (*Kling) TextToVideo ¶
func (k *Kling) TextToVideo(prompt string, aspectRatio string, model string, duration int) (*TaskResponse, error)
TextToVideo is a convenience method for text to video generation
func (*Kling) Tryon ¶
func (k *Kling) Tryon(params KlingTryonParams) (*TaskResponse, error)
Tryon performs virtual try-on - generates an image of a person with the provided clothe image
type KlingGenerateParams ¶
type KlingGenerateParams struct {
Prompt string `json:"prompt"`
GenerationType string `json:"generation_type"` // 'text2video', 'image2video'
NegativePrompt string `json:"negative_prompt,omitempty"`
ImageURL string `json:"image_url,omitempty"`
EndImageURL string `json:"end_image_url,omitempty"`
Mode string `json:"mode,omitempty"` // 'std', 'pro'
AspectRatio string `json:"aspect_ratio,omitempty"`
Model string `json:"model,omitempty"` // 'kling-v1', 'kling-v1-5', 'kling-v1-6'
Duration *int `json:"duration,omitempty"` // 5 or 10
CFGScale *float64 `json:"cfg_scale,omitempty"` // 0-1
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
KlingGenerateParams represents parameters for Kling video generation
type KlingTryonParams ¶
type KlingTryonParams struct {
HumanImageURL string `json:"human_image_url"`
ClothImageURL string `json:"cloth_image_url"`
Model string `json:"model,omitempty"` // 'kolors-virtual-try-on-v1', 'kolors-virtual-try-on-v1-5'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
KlingTryonParams represents parameters for Kling virtual try-on
type Luma ¶
type Luma struct {
// contains filtered or unexported fields
}
Luma provides methods for Luma AI video generation
func (*Luma) Extend ¶
func (l *Luma) Extend(params LumaExtendParams) (*TaskResponse, error)
Extend extends a previously generated video
func (*Luma) Generate ¶
func (l *Luma) Generate(params LumaGenerateParams) (*TaskResponse, error)
Generate generates a video based on a prompt and/or an image input
type LumaExtendParams ¶
type LumaExtendParams struct {
ParentTaskID string `json:"parent_task_id"`
Prompt string `json:"prompt"`
ImageURL string `json:"image_url,omitempty"`
EndImageURL string `json:"end_image_url,omitempty"`
EnhancePrompt *bool `json:"enhance_prompt,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
LumaExtendParams represents parameters for Luma video extension
type LumaGenerateParams ¶
type LumaGenerateParams struct {
Prompt string `json:"prompt"`
ImageURL string `json:"image_url,omitempty"`
EndImageURL string `json:"end_image_url,omitempty"`
EnhancePrompt *bool `json:"enhance_prompt,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty"`
Loop *bool `json:"loop,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
LumaGenerateParams represents parameters for Luma video generation
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
Media provides methods for media upload
func (*Media) Upload ¶
func (m *Media) Upload(filePath string, fileBytes []byte) (*MediaUploadResponse, error)
Upload uploads an image file (max 2MB) filePath can be a path to a file or fileBytes can be provided directly
func (*Media) UploadAudio ¶
func (m *Media) UploadAudio(filePath string, fileBytes []byte) (*MediaUploadAudioResponse, error)
UploadAudio uploads an audio file (max 2MB and 60 seconds) filePath can be a path to a file or fileBytes can be provided directly
type MediaUploadAudioResponse ¶
type MediaUploadAudioResponse struct {
AudioURL string `json:"audioURL"`
}
MediaUploadAudioResponse represents a response from audio upload
type MediaUploadResponse ¶
type MediaUploadResponse struct {
ImageURL string `json:"imageURL"`
}
MediaUploadResponse represents a response from media upload
type Midjourney ¶
type Midjourney struct {
// contains filtered or unexported fields
}
Midjourney provides methods for the Original Midjourney API
func NewMidjourney ¶
func NewMidjourney(httpClient *HTTPClient) *Midjourney
NewMidjourney creates a new Midjourney service
func (*Midjourney) Blend ¶
func (m *Midjourney) Blend(params MidjourneyBlendParams) (*TaskResponse, error)
Blend blends multiple images into one image (2-5 images)
func (*Midjourney) Describe ¶
func (m *Midjourney) Describe(params MidjourneyDescribeParams) (*TaskResponse, error)
Describe writes four example prompts based on an image
func (*Midjourney) ExtendVideo ¶
func (m *Midjourney) ExtendVideo(params MidjourneyExtendVideoParams) (*TaskResponse, error)
ExtendVideo extends previously generated videos
func (*Midjourney) FaceSwap ¶
func (m *Midjourney) FaceSwap(params MidjourneyFaceSwapParams) (*TaskResponse, error)
FaceSwap swaps faces between two images
func (*Midjourney) Imagine ¶
func (m *Midjourney) Imagine(params MidjourneyImagineParams) (*TaskResponse, error)
Imagine creates a new image generation task
func (*Midjourney) ImagineVideo ¶
func (m *Midjourney) ImagineVideo(params MidjourneyImagineVideoParams) (*TaskResponse, error)
ImagineVideo creates a video generation task using a text prompt and image URL
func (*Midjourney) Inpaint ¶
func (m *Midjourney) Inpaint(params MidjourneyInpaintParams) (*TaskResponse, error)
Inpaint redraws a selected area of an image (Vary Region)
func (*Midjourney) Outpaint ¶
func (m *Midjourney) Outpaint(params MidjourneyOutpaintParams) (*TaskResponse, error)
Outpaint enlarges an image's canvas beyond its original size (Zoom Out)
func (*Midjourney) Pan ¶
func (m *Midjourney) Pan(params MidjourneyPanParams) (*TaskResponse, error)
Pan broadens the image canvas in a specific direction
func (*Midjourney) Reroll ¶
func (m *Midjourney) Reroll(params MidjourneyRerollParams) (*TaskResponse, error)
Reroll creates new images from a previous Imagine task
func (*Midjourney) Seed ¶
func (m *Midjourney) Seed(params MidjourneySeedParams) (*TaskResponse, error)
Seed gets the seed of a generated image
func (*Midjourney) Shorten ¶
func (m *Midjourney) Shorten(params MidjourneyShortenParams) (*TaskResponse, error)
Shorten analyzes and suggests optimizations for a prompt
func (*Midjourney) Upscale ¶
func (m *Midjourney) Upscale(params MidjourneyUpscaleParams) (*TaskResponse, error)
Upscale upscales a specific image from a generation (legacy method) Deprecated: Use Upscale1x, UpscaleAlt, or UpscaleHighres instead
func (*Midjourney) Upscale1x ¶
func (m *Midjourney) Upscale1x(params MidjourneyUpscale1xParams) (*TaskResponse, error)
Upscale1x upscales one of the 4 generated images to get a single image
func (*Midjourney) UpscaleAlt ¶
func (m *Midjourney) UpscaleAlt(params MidjourneyUpscaleAltParams) (*TaskResponse, error)
UpscaleAlt upscales with Subtle or Creative mode Subtle doubles the size keeping details similar to original, Creative adds details
func (*Midjourney) UpscaleHighres ¶
func (m *Midjourney) UpscaleHighres(params MidjourneyUpscaleHighresParams) (*TaskResponse, error)
UpscaleHighres upscales any image to higher resolution (2x or 4x) Image must not be larger than 2048x2048
func (*Midjourney) Variations ¶
func (m *Midjourney) Variations(params MidjourneyVariationsParams) (*TaskResponse, error)
Variations creates 4 new variations of one of the 4 generated images
func (*Midjourney) Vary ¶
func (m *Midjourney) Vary(params MidjourneyVaryParams) (*TaskResponse, error)
Vary creates variations of a specific image (legacy method) Deprecated: Use Variations instead
func (*Midjourney) Zoom ¶
func (m *Midjourney) Zoom(params MidjourneyZoomParams) (*TaskResponse, error)
Zoom zooms out from an image (legacy method) Deprecated: Use Outpaint instead
type MidjourneyAlt ¶
type MidjourneyAlt struct {
// contains filtered or unexported fields
}
MidjourneyAlt provides methods for the Pro Midjourney API Advanced version with Fast and Turbo modes
func NewMidjourneyAlt ¶
func NewMidjourneyAlt(httpClient *HTTPClient) *MidjourneyAlt
NewMidjourneyAlt creates a new MidjourneyAlt service
func (*MidjourneyAlt) GetAccountInfo ¶
func (m *MidjourneyAlt) GetAccountInfo() (map[string]interface{}, error)
GetAccountInfo retrieves account information (Pro API)
func (*MidjourneyAlt) GetGeneration ¶
func (m *MidjourneyAlt) GetGeneration(generationID string) (*TaskResponse, error)
GetGeneration retrieves generation info by ID (Pro API)
func (*MidjourneyAlt) Imagine ¶
func (m *MidjourneyAlt) Imagine(params MidjourneyAltImagineParams) (*TaskResponse, error)
Imagine creates a new image generation task (Pro API) Supports Fast and Turbo modes
func (*MidjourneyAlt) Pan ¶
func (m *MidjourneyAlt) Pan(params MidjourneyAltPanParams) (*TaskResponse, error)
Pan pans in a specific direction (Pro API)
func (*MidjourneyAlt) Upscale ¶
func (m *MidjourneyAlt) Upscale(params MidjourneyAltUpscaleParams) (*TaskResponse, error)
Upscale upscales a specific image from a generation (Pro API)
func (*MidjourneyAlt) Variations ¶
func (m *MidjourneyAlt) Variations(params MidjourneyAltVariationsParams) (*TaskResponse, error)
Variations generates 4 variations of a specific image (Pro API)
func (*MidjourneyAlt) Vary ¶
func (m *MidjourneyAlt) Vary(params MidjourneyAltVaryParams) (*TaskResponse, error)
Vary creates variations of a specific image with strong/subtle control (Pro API)
func (*MidjourneyAlt) Zoom ¶
func (m *MidjourneyAlt) Zoom(params MidjourneyAltZoomParams) (*TaskResponse, error)
Zoom zooms out from an image (Pro API)
type MidjourneyAltImagineParams ¶
type MidjourneyAltImagineParams struct {
Prompt string `json:"prompt"`
Mode string `json:"mode,omitempty"` // 'fast' or 'turbo'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltImagineParams represents parameters for Pro imagine request
type MidjourneyAltPanParams ¶
type MidjourneyAltPanParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
Type string `json:"type"` // 'up', 'down', 'left', 'right'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltPanParams represents parameters for Pro pan request
type MidjourneyAltUpscaleParams ¶
type MidjourneyAltUpscaleParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
Type string `json:"type"` // 'subtle' or 'creative'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltUpscaleParams represents parameters for Pro upscale request
type MidjourneyAltVariationsParams ¶
type MidjourneyAltVariationsParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltVariationsParams represents parameters for Pro variations request
type MidjourneyAltVaryParams ¶
type MidjourneyAltVaryParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
Type string `json:"type"` // 'strong' or 'subtle'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltVaryParams represents parameters for Pro vary request
type MidjourneyAltZoomParams ¶
type MidjourneyAltZoomParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
Type string `json:"type"` // '1.5', '2', '{1, 2}', '1'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyAltZoomParams represents parameters for Pro zoom request
type MidjourneyBlendParams ¶
type MidjourneyBlendParams struct {
ImageURLs []string `json:"image_urls"` // Min 2, max 5
Dimension string `json:"dimension,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyBlendParams represents parameters for blend request
type MidjourneyDescribeParams ¶
type MidjourneyDescribeParams struct {
ImageURL string `json:"image_url"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyDescribeParams represents parameters for describe request
type MidjourneyExtendVideoParams ¶
type MidjourneyExtendVideoParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"`
Prompt string `json:"prompt"`
ImageURL string `json:"image_url,omitempty"`
Motion string `json:"motion,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyExtendVideoParams represents parameters for extend video request
type MidjourneyFaceSwapParams ¶
type MidjourneyFaceSwapParams struct {
TargetImageURL string `json:"target_image_url"`
SwapImageURL string `json:"swap_image_url"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyFaceSwapParams represents parameters for face swap request
type MidjourneyImagineParams ¶
type MidjourneyImagineParams struct {
Prompt string `json:"prompt"`
AspectRatio string `json:"aspect_ratio,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyImagineParams represents parameters for imagine request
type MidjourneyImagineVideoParams ¶
type MidjourneyImagineVideoParams struct {
Prompt string `json:"prompt"`
ImageURL string `json:"image_url"`
Motion string `json:"motion,omitempty"` // 'low' or 'high'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyImagineVideoParams represents parameters for imagine video request
type MidjourneyInpaintParams ¶
type MidjourneyInpaintParams struct {
ParentTaskID string `json:"parent_task_id"`
Mask string `json:"mask"` // Base64 encoding
Prompt string `json:"prompt"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyInpaintParams represents parameters for inpaint request
type MidjourneyOutpaintParams ¶
type MidjourneyOutpaintParams struct {
ParentTaskID string `json:"parent_task_id"`
ZoomRatio float64 `json:"zoom_ratio"` // 1.5, 2, or 1
AspectRatio string `json:"aspect_ratio,omitempty"`
Prompt string `json:"prompt,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyOutpaintParams represents parameters for outpaint request
type MidjourneyPanParams ¶
type MidjourneyPanParams struct {
ParentTaskID string `json:"parent_task_id"`
Direction string `json:"direction"` // 'up', 'down', 'left', 'right'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyPanParams represents parameters for pan request
type MidjourneyRerollParams ¶
type MidjourneyRerollParams struct {
ParentTaskID string `json:"parent_task_id"`
Prompt string `json:"prompt,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyRerollParams represents parameters for reroll request
type MidjourneySeedParams ¶
type MidjourneySeedParams struct {
TaskID string `json:"task_id"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneySeedParams represents parameters for seed request
type MidjourneyShortenParams ¶
type MidjourneyShortenParams struct {
Prompt string `json:"prompt"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyShortenParams represents parameters for shorten request
type MidjourneyUpscale1xParams ¶
type MidjourneyUpscale1xParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"` // '1', '2', '3', '4'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyUpscale1xParams represents parameters for upscale 1x request
type MidjourneyUpscaleAltParams ¶
type MidjourneyUpscaleAltParams struct {
ParentTaskID string `json:"parent_task_id"`
Type string `json:"type"` // 'subtle' or 'creative'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyUpscaleAltParams represents parameters for upscale alt request
type MidjourneyUpscaleHighresParams ¶
type MidjourneyUpscaleHighresParams struct {
ParentTaskID string `json:"parent_task_id,omitempty"`
ImageURL string `json:"image_url,omitempty"`
Type string `json:"type"` // '2x' or '4x'
Index string `json:"index,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyUpscaleHighresParams represents parameters for upscale highres request
type MidjourneyUpscaleParams ¶
MidjourneyUpscaleParams represents parameters for legacy upscale request
type MidjourneyVariationsParams ¶
type MidjourneyVariationsParams struct {
ParentTaskID string `json:"parent_task_id"`
Index string `json:"index"` // '1', '2', '3', '4', 'strong', 'subtle'
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
MidjourneyVariationsParams represents parameters for variations request
type MidjourneyVaryParams ¶
type MidjourneyVaryParams struct {
TaskID string `json:"taskId"`
Index string `json:"index"`
Strength int `json:"strength,omitempty"`
}
MidjourneyVaryParams represents parameters for legacy vary request
type MidjourneyZoomParams ¶
MidjourneyZoomParams represents parameters for legacy zoom request
type RateLimitError ¶
type RateLimitError struct {
Err *Error
}
RateLimitError represents a rate limit error (429)
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
Error implements the error interface
type Runway ¶
type Runway struct {
// contains filtered or unexported fields
}
Runway provides methods for Runway ML video generation
func NewRunway ¶
func NewRunway(httpClient *HTTPClient) *Runway
NewRunway creates a new Runway service
func (*Runway) Generate ¶
func (r *Runway) Generate(params RunwayGenerateParams) (*TaskResponse, error)
Generate generates video based on a prompt and/or an image input or a video input
func (*Runway) ImageToVideo ¶
func (r *Runway) ImageToVideo(imageURL string, prompt string, model string, duration int) (*TaskResponse, error)
ImageToVideo is a convenience method for image to video generation
func (*Runway) TextToVideo ¶
func (r *Runway) TextToVideo(prompt string, aspectRatio string, model string, duration int) (*TaskResponse, error)
TextToVideo is a convenience method for text to video generation
func (*Runway) VideoToVideo ¶
func (r *Runway) VideoToVideo(videoURL string, prompt string, model string, duration int) (*TaskResponse, error)
VideoToVideo is a convenience method for video to video generation
type RunwayGenerateParams ¶
type RunwayGenerateParams struct {
Prompt string `json:"prompt"`
GenerationType string `json:"generation_type"` // 'text2video', 'image2video', 'video2video'
ImageURL string `json:"image_url,omitempty"`
EndImageURL string `json:"end_image_url,omitempty"`
VideoURL string `json:"video_url,omitempty"`
AspectRatio string `json:"aspect_ratio,omitempty"`
Model string `json:"model,omitempty"` // 'gen3', 'gen3a_turbo'
Duration *int `json:"duration,omitempty"` // 5 or 10
Flip *bool `json:"flip,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
RunwayGenerateParams represents parameters for Runway video generation
type Suno ¶
type Suno struct {
// contains filtered or unexported fields
}
Suno provides methods for Suno AI music generation
func (*Suno) Extend ¶
func (s *Suno) Extend(params SunoExtendParams) (*TaskResponse, error)
Extend extends a previously generated song or an uploaded audio
func (*Suno) Generate ¶
func (s *Suno) Generate(params SunoGenerateParams) (*TaskResponse, error)
Generate generates a song with a lyrics video clip This endpoint generates TWO songs with the same lyrics
func (*Suno) GenerateLyrics ¶
func (s *Suno) GenerateLyrics(params SunoLyricsParams) (*TaskResponse, error)
GenerateLyrics generates song lyrics based on a prompt
func (*Suno) Upload ¶
func (s *Suno) Upload(params SunoUploadParams) (*TaskResponse, error)
Upload uploads an audio file and turns it into an extendable song
type SunoExtendParams ¶
type SunoExtendParams struct {
ParentTaskID string `json:"parent_task_id,omitempty"`
SongID string `json:"song_id,omitempty"`
ContinueAt int `json:"continue_at"` // timestamp in seconds
FromUpload *bool `json:"from_upload,omitempty"`
Prompt string `json:"prompt,omitempty"`
Lyrics string `json:"lyrics,omitempty"`
Title string `json:"title,omitempty"`
Tags string `json:"tags,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
SunoExtendParams represents parameters for Suno song extension
type SunoGenerateParams ¶
type SunoGenerateParams struct {
Prompt string `json:"prompt"`
Lyrics string `json:"lyrics,omitempty"`
Model string `json:"model,omitempty"` // 'chirp-v3-0', 'chirp-v3-5', 'chirp-v4'
MakeInstrumental *bool `json:"make_instrumental,omitempty"`
Title string `json:"title,omitempty"`
Tags string `json:"tags,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
SunoGenerateParams represents parameters for Suno music generation
type SunoLyricsParams ¶
type SunoLyricsParams struct {
Prompt string `json:"prompt"`
}
SunoLyricsParams represents parameters for Suno lyrics generation
type SunoUploadParams ¶
type SunoUploadParams struct {
AudioURL string `json:"audio_url"`
}
SunoUploadParams represents parameters for Suno audio upload
type TaskResponse ¶
type TaskResponse struct {
ID string `json:"id"`
TaskID string `json:"task_id,omitempty"` // For normalization
Status TaskStatus `json:"status"`
Progress int `json:"progress,omitempty"`
Percentage interface{} `json:"percentage,omitempty"` // Can be string or int
Result interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Message string `json:"message,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
ImageURL string `json:"imageUrl,omitempty"`
ImageURLs []string `json:"image_urls,omitempty"`
OriginalImageURL string `json:"original_image_url,omitempty"`
DownloadURL string `json:"downloadUrl,omitempty"`
VideoURL string `json:"videoUrl,omitempty"`
Actions []string `json:"actions,omitempty"`
TaskType string `json:"task_type,omitempty"`
}
TaskResponse represents a task response from the API
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the status of a task
const ( TaskStatusPending TaskStatus = "pending" TaskStatusProcessing TaskStatus = "processing" TaskStatusCompleted TaskStatus = "completed" TaskStatusFailed TaskStatus = "failed" )
type Tasks ¶
type Tasks struct {
// contains filtered or unexported fields
}
Tasks provides methods for task management
func (*Tasks) Get ¶
func (t *Tasks) Get(taskID string) (*TaskResponse, error)
Get retrieves the status of a task
func (*Tasks) GetAccountInfo ¶
func (t *Tasks) GetAccountInfo() (*AccountInfo, error)
GetAccountInfo retrieves account information including credits, usage, plan, etc.
func (*Tasks) GetMany ¶
func (t *Tasks) GetMany(taskIDs []string) (*TasksResponse, error)
GetMany retrieves the status/results of multiple tasks (min 2, max 20)
func (*Tasks) WaitFor ¶
func (t *Tasks) WaitFor(taskID string, options *WaitForOptions) (*TaskResponse, error)
WaitFor waits for a task to complete with optional progress callback
type TasksResponse ¶
type TasksResponse struct {
Tasks []TaskResponse `json:"tasks"`
}
TasksResponse represents a response with multiple tasks
type TimeoutError ¶
type TimeoutError struct {
Err *Error
}
TimeoutError represents a timeout error (408)
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
Error implements the error interface
type Udio ¶
type Udio struct {
// contains filtered or unexported fields
}
Udio provides methods for Udio AI music generation
func (*Udio) Generate ¶
func (u *Udio) Generate(params UdioGenerateParams) (*TaskResponse, error)
Generate generates a music song using Udio AI This endpoint generates TWO different songs with their own lyrics
type UdioGenerateParams ¶
type UdioGenerateParams struct {
Prompt string `json:"prompt"`
Lyrics string `json:"lyrics,omitempty"`
Model string `json:"model,omitempty"` // 'udio32-v1.5', 'udio130-v1.5'
BypassPromptOptimization *bool `json:"bypass_prompt_optimization,omitempty"`
PromptStrength *float64 `json:"prompt_strength,omitempty"`
ClarityStrength *float64 `json:"clarity_strength,omitempty"`
LyricsStrength *float64 `json:"lyrics_strength,omitempty"`
GenerationQuality *float64 `json:"generation_quality,omitempty"`
NegativePrompt string `json:"negative_prompt,omitempty"`
LyricsPlacementStart *int `json:"lyrics_placement_start,omitempty"`
LyricsPlacementEnd *int `json:"lyrics_placement_end,omitempty"`
Tags string `json:"tags,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
}
UdioGenerateParams represents parameters for Udio music generation
type ValidationError ¶
type ValidationError struct {
*Error
}
ValidationError represents a validation error (400)
func NewValidationError ¶
func NewValidationError(message string, details interface{}) *ValidationError
NewValidationError creates a new validation error
type WaitForOptions ¶
type WaitForOptions struct {
OnProgress func(progress int) // Callback for progress updates
Interval int // Polling interval in milliseconds (default: 3000)
Timeout int // Timeout in milliseconds (default: 300000)
}
WaitForOptions configures the behavior of WaitFor
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
comprehensive
command
|
|
|
flux
command
|
|
|
luma_video
command
|
|
|
media_upload
command
|
|
|
midjourney
command
|
|
|
quickstart
command
|
|
|
suno_music
command
|