VideoGPT [old] - use idea2movie · Ações GPT
GPT actions API
GPT actions API
PUT /api/actions/txt2img/Txt2ImgMake are image from text prompt. Long-running task. Result need check in status endpoint
PUT /api/actions/txt2video/Txt2VideoCreate from long text or summary - video (like slideshow). Video resolution: (1024, 1024), # 1:1 Square (1152, 896), # 9:7 (896, 1152), # 7:9 (1216, 832), # 19:13 (832, 1216), # 13:19 (1344, 768), # 7:4 Horizontal (768, 1344), # 4:7 Vertical Result need check in status endpoint
PUT /api/actions/txt2speech/Txt2SpeechGenerates speech from the input text. https://platform.openai.com/docs/guides/text-to-speech text: The text to generate audio for. The maximum length is 4096 characters. Result need check in status endpoint
PUT /api/actions/url2txt/Url2TxtParse content from url link.
PUT /api/actions/face2face/Face2FaceFaceSwap by 2 images url or base64 string (source and target)
GET /api/status/{dag_uuid}/Get Dagcheck long running task status by dag_uuid (actions result uuid) :param dag_uuid: :param async_db: :return:
Esquema API original
{
"openapi": "3.1.0",
"info": {
"title": "GPT actions API",
"description": "GPT actions API",
"version": "0.1"
},
"servers": [
{
"url": "https://api.superduperai.co/gpt"
}
],
"paths": {
"/api/actions/txt2img/": {
"put": {
"tags": [
"actions"
],
"summary": "Txt2Img",
"description": "Make are image from text prompt. Long-running task.\nResult need check in status endpoint",
"operationId": "txt2img",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Text2ImageConfig"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/actions/txt2video/": {
"put": {
"tags": [
"actions"
],
"summary": "Txt2Video",
"description": "Create from long text or summary - video (like slideshow).\nVideo resolution:\n\n(1024, 1024), # 1:1 Square\n(1152, 896), # 9:7\n(896, 1152), # 7:9\n(1216, 832), # 19:13\n(832, 1216), # 13:19\n(1344, 768), # 7:4 Horizontal\n(768, 1344), # 4:7 Vertical\n\nResult need check in status endpoint",
"operationId": "txt2video",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Text2VideoConfig"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/actions/txt2speech/": {
"put": {
"tags": [
"actions"
],
"summary": "Txt2Speech",
"description": "Generates speech from the input text.\nhttps://platform.openai.com/docs/guides/text-to-speech\n\ntext: The text to generate audio for. The maximum length is 4096 characters.\nResult need check in status endpoint",
"operationId": "txt2speech",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Text2VideoConfig"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/actions/url2txt/": {
"put": {
"tags": [
"actions"
],
"summary": "Url2Txt",
"description": "Parse content from url link.",
"operationId": "url2txt",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Url2TxtConfig"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/actions/face2face/": {
"put": {
"tags": [
"actions"
],
"summary": "Face2Face",
"description": "FaceSwap by 2 images url or base64 string (source and target)",
"operationId": "face2face",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Face2FaceConfig"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/status/{dag_uuid}/": {
"get": {
"tags": [
"status"
],
"summary": "Get Dag",
"description": "check long running task status by dag_uuid (actions result uuid)\n:param dag_uuid:\n:param async_db:\n:return:",
"operationId": "get_dag",
"parameters": [
{
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Dag Uuid"
},
"name": "dag_uuid",
"in": "path"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DagRead"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"DagRead": {
"properties": {
"type": {
"$ref": "#/components/schemas/DagType"
},
"run_id": {
"type": "string",
"title": "Run Id"
},
"config": {
"type": "object",
"title": "Config"
},
"result_data": {
"type": "object",
"title": "Result Data"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/DagStatus"
}
],
"default": "start"
},
"uuid": {
"type": "string",
"format": "uuid",
"title": "Uuid"
},
"project_uuid": {
"type": "string",
"format": "uuid",
"title": "Project Uuid"
},
"result_uuid": {
"type": "string",
"format": "uuid",
"title": "Result Uuid"
},
"result": {
"$ref": "#/components/schemas/FileRead"
}
},
"type": "object",
"required": [
"type",
"config",
"uuid",
"project_uuid"
],
"title": "DagRead"
},
"DagStatus": {
"type": "string",
"enum": [
"start",
"in_progress",
"finish",
"failed"
],
"title": "DagStatus",
"description": "An enumeration."
},
"DagType": {
"type": "string",
"enum": [
"txt2img",
"txt2video",
"txt2script",
"txt2subtitle",
"txt2speech",
"url2txt",
"timeline2video",
"face2face"
],
"title": "DagType",
"description": "An enumeration."
},
"Face2FaceConfig": {
"properties": {
"config": {
"$ref": "#/components/schemas/ReactorConfig"
}
},
"type": "object",
"required": [
"config"
],
"title": "Face2FaceConfig",
"example": {
"config": {
"source_image": "https://upload.wikimedia.org/wikipedia/commons/2/2f/Albert_Einstein_%28Nobel%29.jpg",
"target_image": "https://files.a.superduperai.co/txt2img/018c4fbd-16de-77d1-b591-59c6bd955f80/018c4fd4-a9a2-729c-a1ba-ff875572c2eb/5nmsNQCaYVsgGpvKDtoYKA.jpeg",
"source_faces_index": [
0
],
"face_index": [
0
],
"gender_source": 0,
"gender_target": 0,
"face_restorer": "CodeFormer",
"restorer_visibility": 1,
"codeformer_weight": 0.5
}
}
},
"FileRead": {
"properties": {
"uuid": {
"type": "string",
"format": "uuid",
"title": "Uuid"
},
"file_path": {
"type": "string",
"title": "File Path"
},
"url": {
"type": "string",
"title": "Url"
},
"md5": {
"type": "string",
"title": "Md5"
},
"original_name": {
"type": "string",
"title": "Original Name"
},
"mime_type": {
"type": "string",
"title": "Mime Type"
},
"size": {
"type": "integer",
"title": "Size"
},
"type": {
"$ref": "#/components/schemas/FileType"
},
"additional_data": {
"type": "object",
"title": "Additional Data"
},
"user_uuid": {
"type": "string",
"format": "uuid",
"title": "User Uuid"
}
},
"type": "object",
"required": [
"uuid",
"file_path",
"md5",
"original_name",
"size",
"type"
],
"title": "FileRead"
},
"FileType": {
"type": "string",
"enum": [
"generated_image",
"generated_video",
"generated_subtitle",
"generated_speech",
"generated_faceswap",
"image",
"video",
"audio",
"text",
"other"
],
"title": "FileType",
"description": "An enumeration."
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ReactorConfig": {
"properties": {
"source_image": {
"type": "string",
"title": "Source Image"
},
"target_image": {
"type": "string",
"title": "Target Image"
},
"source_faces_index": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Source Faces Index",
"description": "Comma separated face number(s); Left to rigth, top to bottom. Example: 0,2,1"
},
"face_index": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Face Index",
"description": "Comma separated face number(s); Left to rigth, top to bottom. Example: 0,2,1"
},
"gender_source": {
"type": "integer",
"maximum": 2,
"minimum": 0,
"title": "Gender Source",
"description": "#1 Family, #2 Male",
"default": 0
},
"gender_target": {
"type": "integer",
"maximum": 2,
"minimum": 0,
"title": "Gender Target",
"description": "#1 Family, #2 Male",
"default": 0
},
"mask_face": {
"type": "boolean",
"title": "Mask Face",
"default": false
},
"upscaler": {
"type": "string",
"title": "Upscaler"
},
"scale": {
"type": "integer",
"title": "Scale",
"default": 1
},
"upscale_visibility": {
"type": "integer",
"title": "Upscale Visibility",
"default": 1
},
"face_restorer": {
"type": "string",
"enum": [
"CodeFormer",
"GFPGAN"
],
"title": "Face Restorer",
"default": "CodeFormer"
},
"restorer_visibility": {
"type": "number",
"maximum": 1,
"minimum": 0,
"title": "Restorer Visibility",
"default": 1
},
"codeformer_weight": {
"type": "number",
"maximum": 1,
"minimum": 0,
"title": "Codeformer Weight",
"default": 0.5
},
"restore_first": {
"type": "integer",
"title": "Restore First",
"default": 1
},
"save_to_file": {
"type": "integer",
"title": "Save To File",
"default": 0
},
"result_file_path": {
"type": "string",
"title": "Result File Path",
"default": ""
},
"device": {
"type": "string",
"enum": [
"CUDA",
"CPU"
],
"title": "Device",
"default": "CUDA"
},
"face_model": {
"type": "string",
"title": "Face Model"
}
},
"type": "object",
"title": "ReactorConfig",
"description": "# ReActor\n https://github.com/Gourieff/sd-webui-reactor/blob/main/scripts/reactor_api.py\n\n source_image: str = Body(\"\",title=\"Source Face Image\"),\n target_image: str = Body(\"\",title=\"Target Image\"),\n source_faces_index: list[int] = Body([0],title=\"Comma separated face number(s) from swap-source image\"),\n face_index: list[int] = Body([0],title=\"Comma separated face number(s) for target image (result)\"),\n upscaler: str = Body(\"None\",title=\"Upscaler\"),\n scale: int = Body(1,title=\"Scale by\"),\n upscale_visibility: float = Body(1,title=\"Upscaler visibility (if scale = 1)\"),\n face_restorer: str = Body(\"None\",title=\"Restore Face: 0 - None; 1 - CodeFormer; 2 - GFPGA\"),\n restorer_visibility: float = Body(1,title=\"Restore visibility value\"),\n codeformer_weight: float = Body(0.5,title=\"CodeFormer Weight\"),\n restore_first: int = Body(1,title=\"Restore face -> Then upscale, 1 - True, 0 - False\"),\n model: str = Body(\"inswapper_128.onnx\",title=\"Model\"),\n gender_source: int = Body(0,title=\"Gender Detection (Source) (0 - No, 1 - Female Only, 2 - Male Only)\"),\n gender_target: int = Body(0,title=\"Gender Detection (Target) (0 - No, 1 - Female Only, 2 - Male Only)\"),\n save_to_file: int = Body(0,title=\"Save Result to file, 0 - No, 1 - Yes\"),\n result_file_path: str = Body(\"\",title=\"(if 'save_to_file = 1') Result file path\"),\n device: str = Body(\"CPU\",title=\"CPU or CUDA (if you have it)\"),\n mask_face: int = Body(0,title=\"Face Mask Correction, 1 - True, 0 - False\"),\n select_source: int = Body(0,title=\"Select Source, 0 - Image, 1 - Face Model, 2 - Source Folder\"),\n face_model: str = Body(\"None\",title=\"Filename of the face model (from 'models/reactor/faces'), e.g. elena.safetensors\"),\n source_folder: str = Body(\"\",title=\"The path to the folder containing source faces images\")"
},
"SourceUrlType": {
"type": "string",
"enum": [
"web_full_text",
"news_post",
"telegram",
"youtube"
],
"title": "SourceUrlType",
"description": "An enumeration."
},
"Text2ImageConfig": {
"properties": {
"prompt": {
"type": "string",
"title": "Prompt"
},
"negative_prompt": {
"type": "string",
"title": "Negative Prompt"
},
"style": {
"type": "string",
"title": "Style",
"default": "Cinematic"
},
"height": {
"type": "integer",
"title": "Height",
"default": 576
},
"width": {
"type": "integer",
"title": "Width",
"default": 1024
}
},
"type": "object",
"required": [
"prompt"
],
"title": "Text2ImageConfig",
"example": {
"prompt": "good image",
"negative_prompt": "bad image",
"style": "default",
"width": 1920,
"height": 1080
}
},
"Text2VideoConfig": {
"properties": {
"text": {
"type": "string",
"title": "Text"
},
"width": {
"type": "integer",
"title": "Width"
},
"height": {
"type": "integer",
"title": "Height"
},
"fps": {
"type": "integer",
"title": "Fps",
"default": 30
},
"seed": {
"type": "integer",
"title": "Seed",
"default": -1
},
"duration": {
"type": "number",
"title": "Duration",
"default": 30
},
"audio_file_uuid": {
"type": "string",
"format": "uuid",
"title": "Audio File Uuid"
},
"style": {
"type": "string",
"enum": [
"base",
"3D Model",
"Analog Film",
"Anime",
"Cinematic",
"Comic Book",
"Craft Clay",
"Digital Art",
"Enhance",
"Fantasy Art",
"Isometric Style",
"Line Art",
"Lowpoly",
"Neon Punk",
"Origami",
"Photographic",
"Pixel Art",
"Texture",
"Advertising",
"Food Photography",
"Real Estate",
"Abstract",
"Cubist",
"Graffiti",
"Hyperrealism",
"Impressionist",
"Pointillism",
"Pop Art",
"Psychedelic",
"Renaissance",
"Steampunk",
"Surrealist",
"Typography",
"Watercolor",
"Fighting Game",
"GTA",
"Super Mario",
"Minecraft",
"Pokémon",
"Retro Arcade",
"Retro Game",
"RPG Fantasy Game",
"Strategy Game",
"Street Fighter",
"Legend of Zelda",
"Architectural",
"Disco",
"Dreamscape",
"Dystopian",
"Fairy Tale",
"Gothic",
"Grunge",
"Horror",
"Minimalist",
"Monochrome",
"Nautical",
"Space",
"Stained Glass",
"Techwear Fashion",
"Tribal",
"Zentangle",
"Collage",
"Flat Papercut",
"Kirigami",
"Paper Mache",
"Paper Quilling",
"Papercut Collage",
"Papercut Shadow Box",
"Stacked Papercut",
"Thick Layered Papercut",
"Alien",
"Film Noir",
"HDR",
"Long Exposure",
"Neon Noir",
"Silhouette",
"Tilt-Shift"
],
"title": "Style",
"default": "Cinematic"
}
},
"type": "object",
"required": [
"text",
"width",
"height"
],
"title": "Text2VideoConfig",
"description": "Fullscreen: 4:3 - 1152x896\nWidescreen: 16:9 - 1344x768\nUltrawide: 21:9 - 1536x640\nMobile landscape: 3:2 - 1216x832\nSquare: 1:1 - 1024x1024\nMobile Portrait: 2:3 - 832x1216\nTall: 9:16 - 768x1344",
"example": {
"text": "Hello world",
"width": 1024,
"height": 1024,
"fps": 30,
"seed": -1,
"duration": 30,
"style": "Cinematic"
}
},
"Url2TxtConfig": {
"properties": {
"url": {
"type": "string",
"maxLength": 65536,
"minLength": 1,
"format": "uri",
"title": "Url",
"default": "https://superduperai.co/"
},
"url_type": {
"allOf": [
{
"$ref": "#/components/schemas/SourceUrlType"
}
],
"default": "news_post"
}
},
"type": "object",
"title": "Url2TxtConfig",
"example": {
"url": "https://superduperai.co/",
"url_type": "news_post"
}
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}