FastAPI async wrapper for Freepik cloud AI API supporting image generation (Mystic, Flux Dev/Pro, SeedReam), video generation (Kling, MiniMax, Seedance), image editing (upscale, relight, style transfer, expand, inpaint), and utilities (background removal, classifier, audio isolation). Includes async task tracking with polling, Docker containerization, and Gitea CI/CD workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
831 B
Python
24 lines
831 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class KlingRequest(BaseModel):
|
|
image: str = Field(..., description='Base64-encoded image')
|
|
prompt: Optional[str] = None
|
|
duration: Optional[str] = Field(None, description='5 or 10 seconds')
|
|
aspect_ratio: Optional[str] = None
|
|
|
|
|
|
class MinimaxRequest(BaseModel):
|
|
prompt: str = Field(..., min_length=1, max_length=4000)
|
|
first_frame_image: Optional[str] = Field(None, description='Base64-encoded image')
|
|
subject_reference: Optional[str] = Field(None, description='Base64-encoded reference image')
|
|
|
|
|
|
class SeedanceRequest(BaseModel):
|
|
prompt: str = Field(..., min_length=1, max_length=4000)
|
|
image: Optional[str] = Field(None, description='Base64-encoded image')
|
|
duration: Optional[str] = None
|
|
resolution: Optional[str] = None
|