diff --git a/README.md b/README.md index 6e33ec9..c27265e 100644 --- a/README.md +++ b/README.md @@ -73,4 +73,9 @@ Alternative api for 'Upscale or Variation' tab of Fooocus Gradio interface. #### Image Inpaint or Outpaint > POST /v1/generation/image-inpait-outpaint -Alternative api for 'Inpaint or Outpaint' tab of Fooocus Gradio interface. \ No newline at end of file +Alternative api for 'Inpaint or Outpaint' tab of Fooocus Gradio interface. + +#### Image Prompt +> POST /v1/generation/image-prompt + +Alternative api for 'Image Prompt' tab of Fooocus Gradio interface. \ No newline at end of file diff --git a/docs/openapi.json b/docs/openapi.json index 62fd56a..e75d332 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -247,6 +247,91 @@ } } } + }, + "/v1/generation/image-prompt": { + "post": { + "summary": "Img Prompt", + "operationId": "img_prompt_v1_generation_image_prompt_post", + "parameters": [ + { + "name": "accept", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Parameter to overvide 'Accept' header, 'image/png' for output bytes", + "title": "Accept" + }, + "description": "Parameter to overvide 'Accept' header, 'image/png' for output bytes" + }, + { + "name": "accept", + "in": "header", + "required": false, + "schema": { + "type": "string", + "title": "Accept" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Body_img_prompt_v1_generation_image_prompt_post" + } + ], + "title": "Body" + } + } + } + }, + "responses": { + "200": { + "description": "PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageBase64" + }, + "title": "Response Img Prompt V1 Generation Image Prompt Post" + }, + "example": [ + { + "base64": "...very long string...", + "seed": 1050625087, + "finish_reason": "SUCCESS" + } + ] + }, + "image/png": { + "example": "PNG bytes, what did you expect?" + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } } }, "components": { @@ -353,15 +438,334 @@ "default": 1 }, "image_seed": { + "type": "integer", + "title": "Image Seed", + "description": "Seed to generate image, -1 for random", + "default": -1 + }, + "sharpness": { + "type": "number", + "maximum": 30, + "minimum": 0, + "title": "Sharpness", + "default": 2 + }, + "guidance_scale": { + "type": "number", + "maximum": 30, + "minimum": 1, + "title": "Guidance Scale", + "default": 7 + }, + "base_model_name": { + "type": "string", + "title": "Base Model Name", + "default": "sd_xl_base_1.0_0.9vae.safetensors" + }, + "refiner_model_name": { + "type": "string", + "title": "Refiner Model Name", + "default": "sd_xl_refiner_1.0_0.9vae.safetensors" + }, + "l1": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "L1", + "default": "sd_xl_offset_example-lora_1.0.safetensors" + }, + "w1": { + "type": "number", + "maximum": 2, + "minimum": -2, + "title": "W1", + "default": 0.5 + }, + "l2": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "L2" + }, + "w2": { + "type": "number", + "maximum": 2, + "minimum": -2, + "title": "W2", + "default": 0.5 + }, + "l3": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Image Seed" + "title": "L3" + }, + "w3": { + "type": "number", + "maximum": 2, + "minimum": -2, + "title": "W3", + "default": 0.5 + }, + "l4": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "L4" + }, + "w4": { + "type": "number", + "maximum": 2, + "minimum": -2, + "title": "W4", + "default": 0.5 + }, + "l5": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "L5" + }, + "w5": { + "type": "number", + "maximum": 2, + "minimum": -2, + "title": "W5", + "default": 0.5 + } + }, + "type": "object", + "required": [ + "input_image" + ], + "title": "Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post" + }, + "Body_img_prompt_v1_generation_image_prompt_post": { + "properties": { + "cn_img1": { + "type": "string", + "format": "binary", + "title": "Cn Img1", + "description": "Input image for image prompt" + }, + "cn_stop1": { + "type": "number", + "maximum": 1, + "minimum": 0, + "title": "Cn Stop1", + "description": "Stop at for image prompt", + "default": 0.4 + }, + "cn_weight1": { + "anyOf": [ + { + "type": "number", + "maximum": 2, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Cn Weight1", + "description": "Weight for image prompt, None for default value" + }, + "cn_type1": { + "allOf": [ + { + "$ref": "#/components/schemas/ControlNetType" + } + ], + "description": "ControlNet type for image prompt", + "default": "Image Prompt" + }, + "cn_img2": { + "type": "string", + "format": "binary", + "title": "Cn Img2", + "description": "Input image for image prompt" + }, + "cn_stop2": { + "type": "number", + "maximum": 1, + "minimum": 0, + "title": "Cn Stop2", + "description": "Stop at for image prompt", + "default": 0.4 + }, + "cn_weight2": { + "anyOf": [ + { + "type": "number", + "maximum": 2, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Cn Weight2", + "description": "Weight for image prompt, None for default value" + }, + "cn_type2": { + "allOf": [ + { + "$ref": "#/components/schemas/ControlNetType" + } + ], + "description": "ControlNet type for image prompt", + "default": "Image Prompt" + }, + "cn_img3": { + "type": "string", + "format": "binary", + "title": "Cn Img3", + "description": "Input image for image prompt" + }, + "cn_stop3": { + "type": "number", + "maximum": 1, + "minimum": 0, + "title": "Cn Stop3", + "description": "Stop at for image prompt", + "default": 0.4 + }, + "cn_weight3": { + "anyOf": [ + { + "type": "number", + "maximum": 2, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Cn Weight3", + "description": "Weight for image prompt, None for default value" + }, + "cn_type3": { + "allOf": [ + { + "$ref": "#/components/schemas/ControlNetType" + } + ], + "description": "ControlNet type for image prompt", + "default": "Image Prompt" + }, + "cn_img4": { + "type": "string", + "format": "binary", + "title": "Cn Img4", + "description": "Input image for image prompt" + }, + "cn_stop4": { + "type": "number", + "maximum": 1, + "minimum": 0, + "title": "Cn Stop4", + "description": "Stop at for image prompt", + "default": 0.4 + }, + "cn_weight4": { + "anyOf": [ + { + "type": "number", + "maximum": 2, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Cn Weight4", + "description": "Weight for image prompt, None for default value" + }, + "cn_type4": { + "allOf": [ + { + "$ref": "#/components/schemas/ControlNetType" + } + ], + "description": "ControlNet type for image prompt", + "default": "Image Prompt" + }, + "prompt": { + "type": "string", + "title": "Prompt", + "default": "" + }, + "negative_promit": { + "type": "string", + "title": "Negative Promit", + "default": "" + }, + "style_selections": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Style Selections", + "description": "Fooocus style selections, seperated by comma", + "default": [ + "Fooocus V2", + "Default (Slightly Cinematic)" + ] + }, + "performance_selection": { + "allOf": [ + { + "$ref": "#/components/schemas/PerfomanceSelection" + } + ], + "default": "Speed" + }, + "aspect_ratios_selection": { + "allOf": [ + { + "$ref": "#/components/schemas/AspectRatio" + } + ], + "default": "1152×896" + }, + "image_number": { + "type": "integer", + "maximum": 32, + "minimum": 1, + "title": "Image Number", + "description": "Image number", + "default": 1 + }, + "image_seed": { + "type": "integer", + "title": "Image Seed", + "description": "Seed to generate image, -1 for random", + "default": -1 }, "sharpness": { "type": "number", @@ -480,10 +884,7 @@ } }, "type": "object", - "required": [ - "input_image" - ], - "title": "Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post" + "title": "Body_img_prompt_v1_generation_image_prompt_post" }, "Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post": { "properties": { @@ -543,15 +944,10 @@ "default": 1 }, "image_seed": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Image Seed" + "type": "integer", + "title": "Image Seed", + "description": "Seed to generate image, -1 for random", + "default": -1 }, "sharpness": { "type": "number", @@ -676,115 +1072,124 @@ ], "title": "Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post" }, + "ControlNetType": { + "type": "string", + "enum": [ + "Image Prompt", + "PyraCanny", + "CPDS" + ], + "title": "ControlNetType" + }, "FooocusStyle": { "type": "string", "enum": [ "Fooocus V2", "Default (Slightly Cinematic)", - "sai-3d-model", - "sai-analog film", - "sai-anime", - "sai-cinematic", - "sai-comic book", - "sai-craft clay", - "sai-digital art", - "sai-enhance", - "sai-fantasy art", - "sai-isometric", - "sai-line art", - "sai-lowpoly", - "sai-neonpunk", - "sai-origami", - "sai-photographic", - "sai-pixel art", - "sai-texture", - "ads-advertising", - "ads-automotive", - "ads-corporate", - "ads-fashion editorial", - "ads-food photography", - "ads-luxury", - "ads-real estate", - "ads-retail", - "artstyle-abstract", - "artstyle-abstract expressionism", - "artstyle-art deco", - "artstyle-art nouveau", - "artstyle-constructivist", - "artstyle-cubist", - "artstyle-expressionist", - "artstyle-graffiti", - "artstyle-hyperrealism", - "artstyle-impressionist", - "artstyle-pointillism", - "artstyle-pop art", - "artstyle-psychedelic", - "artstyle-renaissance", - "artstyle-steampunk", - "artstyle-surrealist", - "artstyle-typography", - "artstyle-watercolor", - "futuristic-biomechanical", - "futuristic-biomechanical cyberpunk", - "futuristic-cybernetic", - "futuristic-cybernetic robot", - "futuristic-cyberpunk cityscape", - "futuristic-futuristic", - "futuristic-retro cyberpunk", - "futuristic-retro futurism", - "futuristic-sci-fi", - "futuristic-vaporwave", - "game-bubble bobble", - "game-cyberpunk game", - "game-fighting game", - "game-gta", - "game-mario", - "game-minecraft", - "game-pokemon", - "game-retro arcade", - "game-retro game", - "game-rpg fantasy game", - "game-strategy game", - "game-streetfighter", - "game-zelda", - "misc-architectural", - "misc-disco", - "misc-dreamscape", - "misc-dystopian", - "misc-fairy tale", - "misc-gothic", - "misc-grunge", - "misc-horror", - "misc-kawaii", - "misc-lovecraftian", - "misc-macabre", - "misc-manga", - "misc-metropolis", - "misc-minimalist", - "misc-monochrome", - "misc-nautical", - "misc-space", - "misc-stained glass", - "misc-techwear fashion", - "misc-tribal", - "misc-zentangle", - "papercraft-collage", - "papercraft-flat papercut", - "papercraft-kirigami", - "papercraft-paper mache", - "papercraft-paper quilling", - "papercraft-papercut collage", - "papercraft-papercut shadow box", - "papercraft-stacked papercut", - "papercraft-thick layered papercut", - "photo-alien", - "photo-film noir", - "photo-hdr", - "photo-long exposure", - "photo-neon noir", - "photo-silhouette", - "photo-tilt-shift", - "cinematic-diva", + "SAI 3D Model", + "SAI Analog Film", + "SAI Anime", + "SAI Cinematic", + "SAI Comic Book", + "SAI Craft Clay", + "SAI Digital Art", + "SAI Enhance", + "SAI Fantasy Art", + "SAI Isometric", + "SAI Line Art", + "SAI Lowpoly", + "SAI Neonpunk", + "SAI Prigami", + "SAI Photographic", + "SAI Pixel Art", + "SAI Texture", + "Ads Advertising", + "Ads Automotive", + "Ads Corporate", + "Ads Fashion Editorial", + "Ads Food Photography", + "Ads Luxury", + "Ads Real Estate", + "Ads Retail", + "Artstyle Abstract", + "Artstyle Abstract Expressionism", + "Artstyle Art Deco", + "Artstyle Art Nouveau", + "Artstyle Constructivist", + "Artstyle Cubist", + "Artstyle Expressionist", + "Artstyle Graffiti", + "Artstyle Hyperrealism", + "Artstyle Impressionist", + "Artstyle Pointillism", + "Artstyle Pop Art", + "Artstyle Psychedelic", + "Artstyle Renaissance", + "Artstyle Steampunk", + "Artstyle Surrealist", + "Artstyle Typography", + "Artstyle Watercolor", + "Futuristic Biomechanical", + "Futuristic Biomechanical Cyberpunk", + "Futuristic Cybernetic", + "Futuristic Cybernetic Robot", + "Futuristic Cyberpunk Cityscape", + "Futuristic Futuristic", + "Futuristic Retro Cyberpunk", + "Futuristic Retro Futurism", + "Futuristic Sci Fi", + "Futuristic Vaporwave", + "Game Bubble Bobble", + "Game Cyberpunk Game", + "Game Fighting Game", + "Game Gta", + "Game Mario", + "Game Minecraft", + "Game Pokemon", + "Game Retro Arcade", + "Game Retro Game", + "Game Rpg Fantasy Game", + "Game Strategy Game", + "Game Streetfighter", + "Game Zelda", + "Misc Architectural", + "Misc Disco", + "Misc Dreamscape", + "Misc Dystopian", + "Misc Fairy Tale", + "Misc Gothic", + "Misc Grunge", + "Misc Horror", + "Misc Kawaii", + "Misc Lovecraftian", + "Misc Macabre", + "Misc Manga", + "Misc Metropolis", + "Misc Minimalist", + "Misc Monochrome", + "Misc Nautical", + "Misc Space", + "Misc Stained Glass", + "Misc Techwear Fashion", + "Misc Tribal", + "Misc Zentangle", + "Papercraft Collage", + "Papercraft Flat Papercut", + "Papercraft Kirigami", + "Papercraft Paper Mache", + "Papercraft Paper Quilling", + "Papercraft Papercut Collage", + "Papercraft Papercut Shadow Box", + "Papercraft Stacked Papercut", + "Papercraft Thick Layered Papercut", + "Photo Alien", + "Photo Film Noir", + "Photo Hdr", + "Photo Long Exposure", + "Photo Neon Noir", + "Photo Silhouette", + "Photo Tilt Shift", + "Cinematic Diva", "Abstract Expressionism", "Academia", "Action Figure", @@ -793,9 +1198,9 @@ "Art Deco", "Art Nouveau", "Astral Aura", - "Avant-garde", + "Avant Garde", "Baroque", - "Bauhaus-Style Poster", + "Bauhaus Style Poster", "Blueprint Schematic Drawing", "Caricature", "Cel Shaded Art", @@ -820,7 +1225,7 @@ "Fortnite Art Style", "Futurism", "Glitchcore", - "Glo-fi", + "Glo Fi", "Googie Art Style", "Graffiti Art", "Harlem Renaissance Art", @@ -839,14 +1244,14 @@ "Marker Drawing", "Medievalism", "Minimalism", - "Neo-Baroque", - "Neo-Byzantine", - "Neo-Futurism", - "Neo-Impressionism", - "Neo-Rococo", + "Neo Baroque", + "Neo Byzantine", + "Neo Futurism", + "Neo Impressionism", + "Neo Rococo", "Neoclassicism", "Op Art", - "Ornate and Intricate", + "Ornate And Intricate", "Pencil Sketch Drawing", "Pop Art 2", "Rococo", @@ -862,7 +1267,7 @@ "Vibrant Rim Light", "Volumetric Lighting", "Watercolor 2", - "Whimsical and Playful" + "Whimsical And Playful" ], "title": "FooocusStyle" }, @@ -996,15 +1401,10 @@ "min": 1 }, "image_seed": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Image Seed" + "type": "integer", + "title": "Image Seed", + "description": "Seed to generate image, -1 for random", + "default": -1 }, "sharpness": { "type": "number",