From c7b1b63fd68fad3636ac14a9f36424d047520a8f Mon Sep 17 00:00:00 2001 From: Alon Burg Date: Tue, 31 Dec 2024 14:32:09 +0200 Subject: [PATCH] Deploy website - based on a75f5092e079b466b784c6d32da394ee1ab9127c --- 404.html | 4 ++-- assets/js/0036dbab.6cd65390.js | 1 + assets/js/0036dbab.c9d75e43.js | 1 - assets/js/{05fe89fc.b2813528.js => 05fe89fc.4dfba2bf.js} | 2 +- assets/js/084d163f.2158c64b.js | 1 + assets/js/084d163f.baddb63f.js | 1 - assets/js/18678e9e.43f7305f.js | 1 - assets/js/18678e9e.8e294735.js | 1 + assets/js/3ee62890.4e7b9698.js | 1 - assets/js/3ee62890.a0581c26.js | 1 + assets/js/64f51cdd.967e661b.js | 1 - assets/js/64f51cdd.cdf57b69.js | 1 + assets/js/6540dd0c.3b4fc190.js | 1 - assets/js/6540dd0c.e5735a36.js | 1 + assets/js/76161ddb.1f6c53ce.js | 1 - assets/js/76161ddb.ce3d09d4.js | 1 + assets/js/{935f2afb.ec10fb9a.js => 935f2afb.8b7a9b1a.js} | 2 +- assets/js/97179b4d.2aef21c2.js | 1 - assets/js/97179b4d.5a9d1edc.js | 1 + assets/js/a175974d.0a2711a1.js | 1 - assets/js/a175974d.45e2a7ab.js | 1 + assets/js/b4b29f2e.0dd1699d.js | 1 - assets/js/b4b29f2e.72c88383.js | 1 + assets/js/b83527cb.58c1d2c7.js | 1 - assets/js/b83527cb.75f6c9fe.js | 1 + assets/js/c231ecf4.528b9ca7.js | 1 + assets/js/c231ecf4.8a7e9576.js | 1 - assets/js/d3225ce8.63530e7e.js | 1 + assets/js/d3225ce8.849d6a0f.js | 1 - assets/js/dae0e962.935ba3c6.js | 1 - assets/js/dae0e962.b845e406.js | 1 + assets/js/ddb99303.0263c37f.js | 1 - assets/js/ddb99303.0a07bd97.js | 1 + assets/js/e2fc4889.7a57e9f7.js | 1 - assets/js/e2fc4889.98855dae.js | 1 + assets/js/e4fcfa79.5a7070ba.js | 1 + assets/js/e4fcfa79.933a749b.js | 1 - assets/js/eb3f1c80.82eb8c4d.js | 1 + assets/js/eb3f1c80.9b1be7ff.js | 1 - assets/js/eeb7a3e9.4d9f9475.js | 1 - assets/js/eeb7a3e9.8575224d.js | 1 + assets/js/f2bb83c3.15e57691.js | 1 - assets/js/f2bb83c3.35045360.js | 1 + assets/js/{fb723fd6.c5a1da34.js => fb723fd6.494808a1.js} | 2 +- ...{runtime~main.633caae4.js => runtime~main.96c40214.js} | 2 +- docs/api/flux-api/index.html | 6 +++--- docs/api/images/inspect/index.html | 4 ++-- docs/api/like/create/index.html | 4 ++-- docs/api/like/delete/index.html | 4 ++-- docs/api/overview/index.html | 4 ++-- docs/api/pack/list/index.html | 4 ++-- docs/api/pack/pack/index.html | 4 ++-- docs/api/pack/tunes/create/index.html | 4 ++-- docs/api/prompt/create/index.html | 4 ++-- docs/api/prompt/delete/index.html | 4 ++-- docs/api/prompt/list/index.html | 4 ++-- docs/api/prompt/prompt/index.html | 4 ++-- docs/api/prompt/retrieve/index.html | 4 ++-- docs/api/sdxl-api/index.html | 6 +++--- docs/api/themes/create/index.html | 4 ++-- docs/api/tune/create/index.html | 4 ++-- docs/api/tune/delete/index.html | 4 ++-- docs/api/tune/index.html | 4 ++-- docs/api/tune/list/index.html | 4 ++-- docs/api/tune/retrieve/index.html | 4 ++-- docs/category/api/index.html | 4 ++-- docs/category/features/index.html | 4 ++-- docs/category/images/index.html | 4 ++-- docs/category/likes/index.html | 4 ++-- docs/category/pack-tunes/index.html | 4 ++-- docs/category/packs/index.html | 4 ++-- docs/category/prompts/index.html | 4 ++-- docs/category/themes/index.html | 4 ++-- docs/category/tunes/index.html | 4 ++-- docs/category/use-cases/index.html | 6 +++--- docs/changes/index.html | 4 ++-- docs/features/backend-v1/index.html | 4 ++-- docs/features/face-inpainting/index.html | 6 +++--- docs/features/face-swap/index.html | 6 +++--- docs/features/faceid-flux/index.html | 6 +++--- docs/features/faceid/index.html | 6 +++--- docs/features/lcm/index.html | 6 +++--- docs/features/lora/index.html | 4 ++-- docs/features/multiperson/index.html | 6 +++--- docs/features/outpainting/index.html | 6 +++--- docs/features/prompt-masking/index.html | 4 ++-- docs/features/styles/index.html | 6 +++--- docs/features/tiled-upscale/index.html | 6 +++--- docs/tags/ai-avatars/index.html | 4 ++-- docs/tags/ai-headshots/index.html | 4 ++-- docs/tags/ai-photoshoot/index.html | 4 ++-- docs/tags/animated/index.html | 4 ++-- docs/tags/api/index.html | 4 ++-- docs/tags/avatars/index.html | 4 ++-- docs/tags/backend-v-0/index.html | 4 ++-- docs/tags/background-replacement/index.html | 4 ++-- docs/tags/cinematic/index.html | 4 ++-- docs/tags/clarity/index.html | 4 ++-- docs/tags/clothing/index.html | 4 ++-- docs/tags/comic-book/index.html | 4 ++-- docs/tags/creative-upscaler/index.html | 4 ++-- docs/tags/e-commerce/index.html | 4 ++-- docs/tags/ecommerce/index.html | 4 ++-- docs/tags/enhance/index.html | 4 ++-- docs/tags/fantasy-art/index.html | 4 ++-- docs/tags/fashion/index.html | 4 ++-- docs/tags/fine-tuning/index.html | 4 ++-- docs/tags/flux/index.html | 4 ++-- docs/tags/garment/index.html | 4 ++-- docs/tags/headshots/index.html | 4 ++-- docs/tags/image-enhancement/index.html | 4 ++-- docs/tags/index.html | 4 ++-- docs/tags/line-art/index.html | 4 ++-- docs/tags/lineart/index.html | 4 ++-- docs/tags/lo-ra/index.html | 4 ++-- docs/tags/lora/index.html | 4 ++-- docs/tags/lowpoly/index.html | 4 ++-- docs/tags/magnific/index.html | 4 ++-- docs/tags/neonpunk/index.html | 4 ++-- docs/tags/noise-offset/index.html | 4 ++-- docs/tags/oil-painting/index.html | 4 ++-- docs/tags/outpainting/index.html | 4 ++-- docs/tags/photo-optimization/index.html | 4 ++-- docs/tags/photographic/index.html | 4 ++-- docs/tags/product-photo/index.html | 4 ++-- docs/tags/products/index.html | 4 ++-- docs/tags/prompt-styles/index.html | 4 ++-- docs/tags/shopify/index.html | 4 ++-- docs/tags/social-profiles/index.html | 4 ++-- docs/tags/style/index.html | 4 ++-- docs/tags/super-resolution/index.html | 4 ++-- docs/tags/templates/index.html | 4 ++-- docs/tags/training/index.html | 4 ++-- docs/tags/upscaling/index.html | 4 ++-- docs/tags/virtual-influencers/index.html | 4 ++-- docs/tags/virtual-try-on/index.html | 4 ++-- docs/tags/vton/index.html | 4 ++-- docs/use-cases/ai-photoshoot/index.html | 6 +++--- docs/use-cases/controlnet/index.html | 6 +++--- docs/use-cases/faq/index.html | 4 ++-- docs/use-cases/finetuning-guide/index.html | 6 +++--- docs/use-cases/flux-finetuning/index.html | 6 +++--- docs/use-cases/inpainting-and-masking/index.html | 4 ++-- docs/use-cases/masked-portraits/index.html | 8 ++++---- docs/use-cases/product-shots/index.html | 6 +++--- docs/use-cases/room-redesign/index.html | 6 +++--- docs/use-cases/sdxl-training/index.html | 6 +++--- docs/use-cases/toonify/index.html | 6 +++--- docs/use-cases/upscale/index.html | 6 +++--- docs/use-cases/video-generation/index.html | 4 ++-- docs/use-cases/virtual-try-on/index.html | 6 +++--- index.html | 4 ++-- markdown-page/index.html | 4 ++-- 153 files changed, 266 insertions(+), 266 deletions(-) create mode 100644 assets/js/0036dbab.6cd65390.js delete mode 100644 assets/js/0036dbab.c9d75e43.js rename assets/js/{05fe89fc.b2813528.js => 05fe89fc.4dfba2bf.js} (52%) create mode 100644 assets/js/084d163f.2158c64b.js delete mode 100644 assets/js/084d163f.baddb63f.js delete mode 100644 assets/js/18678e9e.43f7305f.js create mode 100644 assets/js/18678e9e.8e294735.js delete mode 100644 assets/js/3ee62890.4e7b9698.js create mode 100644 assets/js/3ee62890.a0581c26.js delete mode 100644 assets/js/64f51cdd.967e661b.js create mode 100644 assets/js/64f51cdd.cdf57b69.js delete mode 100644 assets/js/6540dd0c.3b4fc190.js create mode 100644 assets/js/6540dd0c.e5735a36.js delete mode 100644 assets/js/76161ddb.1f6c53ce.js create mode 100644 assets/js/76161ddb.ce3d09d4.js rename assets/js/{935f2afb.ec10fb9a.js => 935f2afb.8b7a9b1a.js} (92%) delete mode 100644 assets/js/97179b4d.2aef21c2.js create mode 100644 assets/js/97179b4d.5a9d1edc.js delete mode 100644 assets/js/a175974d.0a2711a1.js create mode 100644 assets/js/a175974d.45e2a7ab.js delete mode 100644 assets/js/b4b29f2e.0dd1699d.js create mode 100644 assets/js/b4b29f2e.72c88383.js delete mode 100644 assets/js/b83527cb.58c1d2c7.js create mode 100644 assets/js/b83527cb.75f6c9fe.js create mode 100644 assets/js/c231ecf4.528b9ca7.js delete mode 100644 assets/js/c231ecf4.8a7e9576.js create mode 100644 assets/js/d3225ce8.63530e7e.js delete mode 100644 assets/js/d3225ce8.849d6a0f.js delete mode 100644 assets/js/dae0e962.935ba3c6.js create mode 100644 assets/js/dae0e962.b845e406.js delete mode 100644 assets/js/ddb99303.0263c37f.js create mode 100644 assets/js/ddb99303.0a07bd97.js delete mode 100644 assets/js/e2fc4889.7a57e9f7.js create mode 100644 assets/js/e2fc4889.98855dae.js create mode 100644 assets/js/e4fcfa79.5a7070ba.js delete mode 100644 assets/js/e4fcfa79.933a749b.js create mode 100644 assets/js/eb3f1c80.82eb8c4d.js delete mode 100644 assets/js/eb3f1c80.9b1be7ff.js delete mode 100644 assets/js/eeb7a3e9.4d9f9475.js create mode 100644 assets/js/eeb7a3e9.8575224d.js delete mode 100644 assets/js/f2bb83c3.15e57691.js create mode 100644 assets/js/f2bb83c3.35045360.js rename assets/js/{fb723fd6.c5a1da34.js => fb723fd6.494808a1.js} (57%) rename assets/js/{runtime~main.633caae4.js => runtime~main.96c40214.js} (87%) diff --git a/404.html b/404.html index 7976d1ed..9b98862f 100644 --- a/404.html +++ b/404.html @@ -7,13 +7,13 @@ - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/0036dbab.6cd65390.js b/assets/js/0036dbab.6cd65390.js new file mode 100644 index 00000000..3dde3cfd --- /dev/null +++ b/assets/js/0036dbab.6cd65390.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6688],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>m});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),p=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(o.Provider,{value:t},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),d=p(a),u=r,m=d["".concat(o,".").concat(u)]||d[u]||g[u]||l;return a?n.createElement(m,s(s({ref:t},c),{},{components:a})):n.createElement(m,s({ref:t},c))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,s=new Array(l);s[0]=u;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i[d]="string"==typeof e?e:r,s[1]=i;for(var p=2;p{a.r(t),a.d(t,{assets:()=>o,contentTitle:()=>s,default:()=>g,frontMatter:()=>l,metadata:()=>i,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={hide_table_of_contents:!0,tags:["prompt styles","templates","style","animated","comic book","line art","enhance","fantasy art","lowpoly","neonpunk","photographic"],image:"./img/styles/line-art.jpg"},s="Styles",i={unversionedId:"features/styles",id:"features/styles",title:"Styles",description:"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.",source:"@site/docs/features/styles.md",sourceDirName:"features",slug:"/features/styles",permalink:"/docs/features/styles",draft:!1,tags:[{label:"prompt styles",permalink:"/docs/tags/prompt-styles"},{label:"templates",permalink:"/docs/tags/templates"},{label:"style",permalink:"/docs/tags/style"},{label:"animated",permalink:"/docs/tags/animated"},{label:"comic book",permalink:"/docs/tags/comic-book"},{label:"line art",permalink:"/docs/tags/line-art"},{label:"enhance",permalink:"/docs/tags/enhance"},{label:"fantasy art",permalink:"/docs/tags/fantasy-art"},{label:"lowpoly",permalink:"/docs/tags/lowpoly"},{label:"neonpunk",permalink:"/docs/tags/neonpunk"},{label:"photographic",permalink:"/docs/tags/photographic"}],version:"current",frontMatter:{hide_table_of_contents:!0,tags:["prompt styles","templates","style","animated","comic book","line art","enhance","fantasy art","lowpoly","neonpunk","photographic"],image:"./img/styles/line-art.jpg"},sidebar:"tutorialSidebar",previous:{title:"Prompt Masking",permalink:"/docs/features/prompt-masking"},next:{title:"Tiled upscale",permalink:"/docs/features/tiled-upscale"}},o={image:a(5939).Z},p=[{value:"Usage",id:"usage",level:2}],c={toc:p},d="wrapper";function g(e){let{components:t,...l}=e;return(0,r.kt)(d,(0,n.Z)({},c,l,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"styles"},"Styles"),(0,r.kt)("p",null,"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process."),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Animated"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Animated",src:a(9847).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Comic book"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Comic book",src:a(9439).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Line art"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Lineart",src:a(5939).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Enhance"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Enhance",src:a(6297).Z,width:"768",height:"1024"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Fantasy art"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Fantasy art",src:a(6706).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Lowpoly"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Lowpoly",src:a(6805).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Neonpunk"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Neonpunk",src:a(1202).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Photographic"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Photographic",src:a(9280).Z,width:"768",height:"1024"})))),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"Styles can be used in the GUI style dropdown or in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/prompt/create/#backend_version-optional"},"API")," using the ",(0,r.kt)("inlineCode",{parentName:"p"},"style")," attribute. When using a style template, provide a short prompt text describing the main subject and scene, while leaving the generic style keywords to the template."))}g.isMDXComponent=!0},9847:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/animated-62fe824fb999578365bbd12effeb9a58.jpg"},9439:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/comics-9e9ca83560bb6ad202705575d4105df5.jpg"},6297:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/enhance-f07356dfdb1b319137c06d946dcdf55a.jpg"},6706:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/fantasy-art-a6b7634d213ad38cb62116ea00a51cf4.jpg"},5939:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/line-art-713a5f6c7775999c1dce49442d0917b8.jpg"},6805:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/lowpoly-9455be144ee82ed1fa460c94a501f737.jpg"},1202:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/neonpunk-b39d73b89c4b0a83c2f166d903fed3dc.jpg"},9280:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/photographic-3beffd9b18f7ab73359f712bd4a417cc.jpg"}}]); \ No newline at end of file diff --git a/assets/js/0036dbab.c9d75e43.js b/assets/js/0036dbab.c9d75e43.js deleted file mode 100644 index 85a7d388..00000000 --- a/assets/js/0036dbab.c9d75e43.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6688],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>m});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=n.createContext({}),p=function(e){var t=n.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(i.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,i=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=p(a),g=r,m=d["".concat(i,".").concat(g)]||d[g]||u[g]||l;return a?n.createElement(m,s(s({ref:t},c),{},{components:a})):n.createElement(m,s({ref:t},c))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,s=new Array(l);s[0]=g;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[d]="string"==typeof e?e:r,s[1]=o;for(var p=2;p{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={hide_table_of_contents:!0,tags:["prompt styles","templates","style","animated","comic book","line art","enhance","fantasy art","lowpoly","neonpunk","photographic"]},s="Styles",o={unversionedId:"features/styles",id:"features/styles",title:"Styles",description:"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.",source:"@site/docs/features/styles.md",sourceDirName:"features",slug:"/features/styles",permalink:"/docs/features/styles",draft:!1,tags:[{label:"prompt styles",permalink:"/docs/tags/prompt-styles"},{label:"templates",permalink:"/docs/tags/templates"},{label:"style",permalink:"/docs/tags/style"},{label:"animated",permalink:"/docs/tags/animated"},{label:"comic book",permalink:"/docs/tags/comic-book"},{label:"line art",permalink:"/docs/tags/line-art"},{label:"enhance",permalink:"/docs/tags/enhance"},{label:"fantasy art",permalink:"/docs/tags/fantasy-art"},{label:"lowpoly",permalink:"/docs/tags/lowpoly"},{label:"neonpunk",permalink:"/docs/tags/neonpunk"},{label:"photographic",permalink:"/docs/tags/photographic"}],version:"current",frontMatter:{hide_table_of_contents:!0,tags:["prompt styles","templates","style","animated","comic book","line art","enhance","fantasy art","lowpoly","neonpunk","photographic"]},sidebar:"tutorialSidebar",previous:{title:"Prompt Masking",permalink:"/docs/features/prompt-masking"},next:{title:"Tiled upscale",permalink:"/docs/features/tiled-upscale"}},i={},p=[{value:"Usage",id:"usage",level:2}],c={toc:p},d="wrapper";function u(e){let{components:t,...l}=e;return(0,r.kt)(d,(0,n.Z)({},c,l,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"styles"},"Styles"),(0,r.kt)("p",null,"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process."),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Animated"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Animated",src:a(9847).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Comic book"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Comic book",src:a(9439).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Line art"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Lineart",src:a(5939).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Enhance"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Enhance",src:a(6297).Z,width:"768",height:"1024"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Fantasy art"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Fantasy art",src:a(6706).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Lowpoly"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Lowpoly",src:a(6805).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Neonpunk"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Neonpunk",src:a(1202).Z,width:"768",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Photographic"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Photographic",src:a(9280).Z,width:"768",height:"1024"})))),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"Styles can be used in the GUI style dropdown or in the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/prompt/create/#backend_version-optional"},"API")," using the ",(0,r.kt)("inlineCode",{parentName:"p"},"style")," attribute. When using a style template, provide a short prompt text describing the main subject and scene, while leaving the generic style keywords to the template."))}u.isMDXComponent=!0},9847:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/animated-62fe824fb999578365bbd12effeb9a58.jpg"},9439:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/comics-9e9ca83560bb6ad202705575d4105df5.jpg"},6297:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/enhance-f07356dfdb1b319137c06d946dcdf55a.jpg"},6706:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/fantasy-art-a6b7634d213ad38cb62116ea00a51cf4.jpg"},5939:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/line-art-713a5f6c7775999c1dce49442d0917b8.jpg"},6805:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/lowpoly-9455be144ee82ed1fa460c94a501f737.jpg"},1202:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/neonpunk-b39d73b89c4b0a83c2f166d903fed3dc.jpg"},9280:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/photographic-3beffd9b18f7ab73359f712bd4a417cc.jpg"}}]); \ No newline at end of file diff --git a/assets/js/05fe89fc.b2813528.js b/assets/js/05fe89fc.4dfba2bf.js similarity index 52% rename from assets/js/05fe89fc.b2813528.js rename to assets/js/05fe89fc.4dfba2bf.js index eb74f918..df04a935 100644 --- a/assets/js/05fe89fc.b2813528.js +++ b/assets/js/05fe89fc.4dfba2bf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[3198],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=n.createContext({}),l=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},p=function(e){var t=l(e.components);return n.createElement(c.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(r),f=a,m=u["".concat(c,".").concat(f)]||u[f]||d[f]||o;return r?n.createElement(m,s(s({ref:t},p),{},{components:r})):n.createElement(m,s({ref:t},p))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,s=new Array(o);s[0]=f;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i[u]="string"==typeof e?e:a,s[1]=i;for(var l=2;l{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>l});var n=r(7462),a=(r(7294),r(3905));const o={},s="Latent Consistency Models",i={unversionedId:"features/lcm",id:"features/lcm",title:"Latent Consistency Models",description:"DPM SDE Karras 30 steps 15 seconds for 8 images",source:"@site/docs/features/lcm.md",sourceDirName:"features",slug:"/features/lcm",permalink:"/docs/features/lcm",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"FaceID",permalink:"/docs/features/faceid"},next:{title:"LoRA",permalink:"/docs/features/lora"}},c={},l=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2}],p={toc:l},u="wrapper";function d(e){let{components:t,...o}=e;return(0,a.kt)(u,(0,n.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"latent-consistency-models"},"Latent Consistency Models"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"DPM SDE Karras 30 steps ",(0,a.kt)("br",null)," 15 seconds for 8 images"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"source.png",src:r(2138).Z,width:"512",height:"640"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"LCM scheduler 6 steps ",(0,a.kt)("br",null)," 4 seconds for 8 images"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"faceid-output.png",src:r(9754).Z,width:"512",height:"640"})))),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"Latent Consistency Models (LCM) is a combination of a scheduler and a LoRA which allow generation within 5-6 steps thus reducing processing time significantly."),(0,a.kt)("h2",{id:"usage"},"Usage"),(0,a.kt)("p",null,"Select the ",(0,a.kt)("inlineCode",{parentName:"p"},"lcm")," scheduler from the Schedulers dropdown. For API usage see ",(0,a.kt)("a",{parentName:"p",href:"/docs/api/prompt/create#scheduler-optional"},"prompt API"),"."))}d.isMDXComponent=!0},2138:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/schedulers-dpm-sde-karras-ea7a472d4d98205a06688c86da6d0fc6.jpeg"},9754:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/schedulers-lcm-235b5209584db4d786c70993abbbadfd.jpeg"}}]); \ No newline at end of file +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[3198],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=n.createContext({}),l=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},p=function(e){var t=l(e.components);return n.createElement(c.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(r),f=a,m=u["".concat(c,".").concat(f)]||u[f]||d[f]||o;return r?n.createElement(m,s(s({ref:t},p),{},{components:r})):n.createElement(m,s({ref:t},p))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,s=new Array(o);s[0]=f;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i[u]="string"==typeof e?e:a,s[1]=i;for(var l=2;l{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>l});var n=r(7462),a=(r(7294),r(3905));const o={image:"./img/schedulers-lcm.jpeg"},s="Latent Consistency Models",i={unversionedId:"features/lcm",id:"features/lcm",title:"Latent Consistency Models",description:"DPM SDE Karras 30 steps 15 seconds for 8 images",source:"@site/docs/features/lcm.md",sourceDirName:"features",slug:"/features/lcm",permalink:"/docs/features/lcm",draft:!1,tags:[],version:"current",frontMatter:{image:"./img/schedulers-lcm.jpeg"},sidebar:"tutorialSidebar",previous:{title:"FaceID",permalink:"/docs/features/faceid"},next:{title:"LoRA",permalink:"/docs/features/lora"}},c={image:r(9754).Z},l=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2}],p={toc:l},u="wrapper";function d(e){let{components:t,...o}=e;return(0,a.kt)(u,(0,n.Z)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"latent-consistency-models"},"Latent Consistency Models"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"DPM SDE Karras 30 steps ",(0,a.kt)("br",null)," 15 seconds for 8 images"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"source.png",src:r(2138).Z,width:"512",height:"640"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"LCM scheduler 6 steps ",(0,a.kt)("br",null)," 4 seconds for 8 images"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"faceid-output.png",src:r(9754).Z,width:"512",height:"640"})))),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"Latent Consistency Models (LCM) is a combination of a scheduler and a LoRA which allow generation within 5-6 steps thus reducing processing time significantly."),(0,a.kt)("h2",{id:"usage"},"Usage"),(0,a.kt)("p",null,"Select the ",(0,a.kt)("inlineCode",{parentName:"p"},"lcm")," scheduler from the Schedulers dropdown. For API usage see ",(0,a.kt)("a",{parentName:"p",href:"/docs/api/prompt/create#scheduler-optional"},"prompt API"),"."))}d.isMDXComponent=!0},2138:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/schedulers-dpm-sde-karras-ea7a472d4d98205a06688c86da6d0fc6.jpeg"},9754:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/schedulers-lcm-235b5209584db4d786c70993abbbadfd.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/084d163f.2158c64b.js b/assets/js/084d163f.2158c64b.js new file mode 100644 index 00000000..907ddec8 --- /dev/null +++ b/assets/js/084d163f.2158c64b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[7721],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>m});var o=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function i(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var l=o.createContext({}),p=function(e){var t=o.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return o.createElement(l.Provider,{value:t},e.children)},c="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(a),d=n,m=c["".concat(l,".").concat(d)]||c[d]||h[d]||r;return a?o.createElement(m,i(i({ref:t},u),{},{components:a})):o.createElement(m,i({ref:t},u))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,i=new Array(r);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:n,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>u});var o=a(7462),n=(a(7294),a(3905));const r=a.p+"assets/medias/Astria - AI headshots-360187510735fe13854df43a7994298a.m4a",i={title:"AI Photoshoot - fine-tuning for professional headshots",tags:["fine-tuning","headshots","avatars","social profiles","virtual influencers","AI photoshoot","AI headshots","AI avatars"],image:"../use-cases/img/ai-photoshoot-output.jpg"},s="AI Photoshoot",l={unversionedId:"use-cases/ai-photoshoot",id:"use-cases/ai-photoshoot",title:"AI Photoshoot - fine-tuning for professional headshots",description:"Overview",source:"@site/docs/use-cases/0-ai-photoshoot.md",sourceDirName:"use-cases",slug:"/use-cases/ai-photoshoot",permalink:"/docs/use-cases/ai-photoshoot",draft:!1,tags:[{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"headshots",permalink:"/docs/tags/headshots"},{label:"avatars",permalink:"/docs/tags/avatars"},{label:"social profiles",permalink:"/docs/tags/social-profiles"},{label:"virtual influencers",permalink:"/docs/tags/virtual-influencers"},{label:"AI photoshoot",permalink:"/docs/tags/ai-photoshoot"},{label:"AI headshots",permalink:"/docs/tags/ai-headshots"},{label:"AI avatars",permalink:"/docs/tags/ai-avatars"}],version:"current",sidebarPosition:0,frontMatter:{title:"AI Photoshoot - fine-tuning for professional headshots",tags:["fine-tuning","headshots","avatars","social profiles","virtual influencers","AI photoshoot","AI headshots","AI avatars"],image:"../use-cases/img/ai-photoshoot-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"Use cases",permalink:"/docs/category/use-cases"},next:{title:"Fine-tuning guide",permalink:"/docs/use-cases/finetuning-guide"}},p={},u=[{value:"Overview",id:"overview",level:2},{value:"Steps",id:"steps",level:2},{value:"1. Create a model",id:"1-create-a-model",level:3},{value:"2. Generate images",id:"2-generate-images",level:3},{value:"Tips for training images",id:"tips-for-training-images",level:2},{value:"Tips for inference",id:"tips-for-inference",level:2}],c={toc:u},h="wrapper";function d(e){let{components:t,...i}=e;return(0,n.kt)(h,(0,o.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"ai-photoshoot"},"AI Photoshoot"),(0,n.kt)("audio",{controls:!0,src:r,alt:"AI Photoshoot podcast - Generative image model finetuning"}),(0,n.kt)("h2",{id:"overview"},"Overview"),(0,n.kt)("p",null,'The term "AI Photoshoot", "AI Headshots" or "AI Avatars" refers to the process of creating a generative AI model from around 16 images of a person. This model can then be used to create professional photography imagery of the person, without requiring high-end camera equipment, lighting, or wardrobe.'),(0,n.kt)("p",null,"AI headshots are particularly useful for social profile photos, such as those used on LinkedIn or Facebook, as well as on dating sites."),(0,n.kt)("p",null,"Another recent trend is the creation of virtual social influencers - consistent characters that do not exist in reality, but can be generated consistently in different scenes and everyday life."),(0,n.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,n.kt)("div",null,(0,n.kt)("figcaption",null,"Training images"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fine-tuning training images",src:a(6973).Z,width:"525",height:"671"}))),(0,n.kt)("div",null,(0,n.kt)("figcaption",null,"Output images"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Generated images",src:a(670).Z,width:"1805",height:"2324"})))),(0,n.kt)("h2",{id:"steps"},"Steps"),(0,n.kt)("h3",{id:"1-create-a-model"},"1. Create a model"),(0,n.kt)("p",null,'At this stage, we will create a 2GB numeric (AI) model file that contains the "features" of a person. This is not the part where we generate new images, but only train a dedicated AI model.'),(0,n.kt)("p",null,"To begin, go to the ",(0,n.kt)("a",{parentName:"p",href:"https://www.astria.ai/tunes/new"},"New tune")," page."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Title")," - Enter the person's name, e.g. ",(0,n.kt)("inlineCode",{parentName:"p"},"Elon Musk"),". Or choose whatever title that fits your needs. Choosing a title is not a part of the actual training of the model."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Class Name")," - Enter ",(0,n.kt)("inlineCode",{parentName:"p"},"man")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"woman"),", or possibly ",(0,n.kt)("inlineCode",{parentName:"p"},"boy, girl, cat"),", or ",(0,n.kt)("inlineCode",{parentName:"p"},"dog"),". This is highly important as it is a part of the actual technical training of your model. We automatically generate images of the \"class\" while training, and by comparing them to your images (the training set), the model 'learns' your subject's unique features."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Base tune")," - Select a baseline model on which you would like to train. For best quality we recommend using ",(0,n.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery/tunes/1504944/prompts"},"Flux1.dev"),". "),(0,n.kt)("p",null,"Other settings are optional and can be changed to your preference."),(0,n.kt)("h3",{id:"2-generate-images"},"2. Generate images"),(0,n.kt)("p",null,"Even before the model is ready, you can prepare a queue of prompts (texts) that will be fed into the model and used to generate models."),(0,n.kt)("h2",{id:"tips-for-training-images"},"Tips for training images"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Upload both portrait and full body shots of the person"),(0,n.kt)("li",{parentName:"ol"},"Use 26 pictures of your subject. Preferably cropped to 1:1 aspect ratio."),(0,n.kt)("li",{parentName:"ol"},"Use 6 photos of full body or entire object + 10 medium shot photos from the chest up + 10 close-ups."),(0,n.kt)("li",{parentName:"ol"},"Variation is key - Change body pose for every picture, use pictures from different days backgrounds and lighting. Every picture of your subject should introduce new info about your subject."),(0,n.kt)("li",{parentName:"ol"},"Avoid pictures taken at the same hour/day. For example few pictures with the same shirt will make the model learn the shirt as well as part of the subject."),(0,n.kt)("li",{parentName:"ol"},"Always pick a new background."),(0,n.kt)("li",{parentName:"ol"},"Do not upload pictures mixed with other people"),(0,n.kt)("li",{parentName:"ol"},"Do not upload upload funny faces")),(0,n.kt)("h2",{id:"tips-for-inference"},"Tips for inference"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Use ",(0,n.kt)("inlineCode",{parentName:"li"},"ohwx woman/man")," at the ",(0,n.kt)("em",{parentName:"li"},"beginning")," of the sentence."),(0,n.kt)("li",{parentName:"ol"},"Textual inversion can reduce similarity. Try to avoid it. Specifically TIs such as ",(0,n.kt)("inlineCode",{parentName:"li"},"ng_deepnegative_v1_75t")," or ",(0,n.kt)("inlineCode",{parentName:"li"},"CyberRealistic"),"."),(0,n.kt)("li",{parentName:"ol"},"Use of ",(0,n.kt)("a",{parentName:"li",href:"/docs/features/lora"},"LoRA")," for styles can reduce similarity. Keep LoRA strength low around 0.2-0.3.")))}d.isMDXComponent=!0},6973:(e,t,a)=>{a.d(t,{Z:()=>o});const o=a.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"},670:(e,t,a)=>{a.d(t,{Z:()=>o});const o=a.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg"}}]); \ No newline at end of file diff --git a/assets/js/084d163f.baddb63f.js b/assets/js/084d163f.baddb63f.js deleted file mode 100644 index 140ca4d7..00000000 --- a/assets/js/084d163f.baddb63f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[7721],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>f});var o=a(7294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function i(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var l=o.createContext({}),p=function(e){var t=o.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return o.createElement(l.Provider,{value:t},e.children)},c="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(a),d=n,f=c["".concat(l,".").concat(d)]||c[d]||h[d]||r;return a?o.createElement(f,i(i({ref:t},u),{},{components:a})):o.createElement(f,i({ref:t},u))}));function f(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,i=new Array(r);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:n,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>u});var o=a(7462),n=(a(7294),a(3905));const r=a.p+"assets/medias/Astria - AI headshots-360187510735fe13854df43a7994298a.m4a",i={title:"AI Photoshoot - fine-tuning for professional headshots",tags:["fine-tuning","headshots","avatars","social profiles","virtual influencers","AI photoshoot","AI headshots","AI avatars"]},s="AI Photoshoot",l={unversionedId:"use-cases/ai-photoshoot",id:"use-cases/ai-photoshoot",title:"AI Photoshoot - fine-tuning for professional headshots",description:"Overview",source:"@site/docs/use-cases/0-ai-photoshoot.md",sourceDirName:"use-cases",slug:"/use-cases/ai-photoshoot",permalink:"/docs/use-cases/ai-photoshoot",draft:!1,tags:[{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"headshots",permalink:"/docs/tags/headshots"},{label:"avatars",permalink:"/docs/tags/avatars"},{label:"social profiles",permalink:"/docs/tags/social-profiles"},{label:"virtual influencers",permalink:"/docs/tags/virtual-influencers"},{label:"AI photoshoot",permalink:"/docs/tags/ai-photoshoot"},{label:"AI headshots",permalink:"/docs/tags/ai-headshots"},{label:"AI avatars",permalink:"/docs/tags/ai-avatars"}],version:"current",sidebarPosition:0,frontMatter:{title:"AI Photoshoot - fine-tuning for professional headshots",tags:["fine-tuning","headshots","avatars","social profiles","virtual influencers","AI photoshoot","AI headshots","AI avatars"]},sidebar:"tutorialSidebar",previous:{title:"Use cases",permalink:"/docs/category/use-cases"},next:{title:"Fine-tuning guide",permalink:"/docs/use-cases/finetuning-guide"}},p={},u=[{value:"Overview",id:"overview",level:2},{value:"Steps",id:"steps",level:2},{value:"1. Create a model",id:"1-create-a-model",level:3},{value:"2. Generate images",id:"2-generate-images",level:3},{value:"Tips for training images",id:"tips-for-training-images",level:2},{value:"Tips for inference",id:"tips-for-inference",level:2}],c={toc:u},h="wrapper";function d(e){let{components:t,...i}=e;return(0,n.kt)(h,(0,o.Z)({},c,i,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"ai-photoshoot"},"AI Photoshoot"),(0,n.kt)("audio",{controls:!0,src:r,alt:"AI Photoshoot podcast - Generative image model finetuning"}),(0,n.kt)("h2",{id:"overview"},"Overview"),(0,n.kt)("p",null,'The term "AI Photoshoot", "AI Headshots" or "AI Avatars" refers to the process of creating a generative AI model from around 16 images of a person. This model can then be used to create professional photography imagery of the person, without requiring high-end camera equipment, lighting, or wardrobe.'),(0,n.kt)("p",null,"AI headshots are particularly useful for social profile photos, such as those used on LinkedIn or Facebook, as well as on dating sites."),(0,n.kt)("p",null,"Another recent trend is the creation of virtual social influencers - consistent characters that do not exist in reality, but can be generated consistently in different scenes and everyday life."),(0,n.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,n.kt)("div",null,(0,n.kt)("figcaption",null,"Training images"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Fine-tuning training images",src:a(6973).Z,width:"525",height:"671"}))),(0,n.kt)("div",null,(0,n.kt)("figcaption",null,"Output images"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Generated images",src:a(670).Z,width:"1805",height:"2324"})))),(0,n.kt)("h2",{id:"steps"},"Steps"),(0,n.kt)("h3",{id:"1-create-a-model"},"1. Create a model"),(0,n.kt)("p",null,'At this stage, we will create a 2GB numeric (AI) model file that contains the "features" of a person. This is not the part where we generate new images, but only train a dedicated AI model.'),(0,n.kt)("p",null,"To begin, go to the ",(0,n.kt)("a",{parentName:"p",href:"https://www.astria.ai/tunes/new"},"New tune")," page."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Title")," - Enter the person's name, e.g. ",(0,n.kt)("inlineCode",{parentName:"p"},"Elon Musk"),". Or choose whatever title that fits your needs. Choosing a title is not a part of the actual training of the model."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Class Name")," - Enter ",(0,n.kt)("inlineCode",{parentName:"p"},"man")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"woman"),", or possibly ",(0,n.kt)("inlineCode",{parentName:"p"},"boy, girl, cat"),", or ",(0,n.kt)("inlineCode",{parentName:"p"},"dog"),". This is highly important as it is a part of the actual technical training of your model. We automatically generate images of the \"class\" while training, and by comparing them to your images (the training set), the model 'learns' your subject's unique features."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"Base tune")," - Select a baseline model on which you would like to train. For best quality we recommend using ",(0,n.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery/tunes/1504944/prompts"},"Flux1.dev"),". "),(0,n.kt)("p",null,"Other settings are optional and can be changed to your preference."),(0,n.kt)("h3",{id:"2-generate-images"},"2. Generate images"),(0,n.kt)("p",null,"Even before the model is ready, you can prepare a queue of prompts (texts) that will be fed into the model and used to generate models."),(0,n.kt)("h2",{id:"tips-for-training-images"},"Tips for training images"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Upload both portrait and full body shots of the person"),(0,n.kt)("li",{parentName:"ol"},"Use 26 pictures of your subject. Preferably cropped to 1:1 aspect ratio."),(0,n.kt)("li",{parentName:"ol"},"Use 6 photos of full body or entire object + 10 medium shot photos from the chest up + 10 close-ups."),(0,n.kt)("li",{parentName:"ol"},"Variation is key - Change body pose for every picture, use pictures from different days backgrounds and lighting. Every picture of your subject should introduce new info about your subject."),(0,n.kt)("li",{parentName:"ol"},"Avoid pictures taken at the same hour/day. For example few pictures with the same shirt will make the model learn the shirt as well as part of the subject."),(0,n.kt)("li",{parentName:"ol"},"Always pick a new background."),(0,n.kt)("li",{parentName:"ol"},"Do not upload pictures mixed with other people"),(0,n.kt)("li",{parentName:"ol"},"Do not upload upload funny faces")),(0,n.kt)("h2",{id:"tips-for-inference"},"Tips for inference"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Use ",(0,n.kt)("inlineCode",{parentName:"li"},"ohwx woman/man")," at the ",(0,n.kt)("em",{parentName:"li"},"beginning")," of the sentence."),(0,n.kt)("li",{parentName:"ol"},"Textual inversion can reduce similarity. Try to avoid it. Specifically TIs such as ",(0,n.kt)("inlineCode",{parentName:"li"},"ng_deepnegative_v1_75t")," or ",(0,n.kt)("inlineCode",{parentName:"li"},"CyberRealistic"),"."),(0,n.kt)("li",{parentName:"ol"},"Use of ",(0,n.kt)("a",{parentName:"li",href:"/docs/features/lora"},"LoRA")," for styles can reduce similarity. Keep LoRA strength low around 0.2-0.3.")))}d.isMDXComponent=!0},6973:(e,t,a)=>{a.d(t,{Z:()=>o});const o=a.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"},670:(e,t,a)=>{a.d(t,{Z:()=>o});const o=a.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg"}}]); \ No newline at end of file diff --git a/assets/js/18678e9e.43f7305f.js b/assets/js/18678e9e.43f7305f.js deleted file mode 100644 index 9df3e437..00000000 --- a/assets/js/18678e9e.43f7305f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6667],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>g});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),c=p(n),u=o,g=c["".concat(l,".").concat(u)]||c[u]||m[u]||a;return n?r.createElement(g,i(i({ref:t},d),{},{components:n})):r.createElement(g,i({ref:t},d))}));function g(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:o,i[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>m,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var r=n(7462),o=(n(7294),n(3905));const a={},i="AI Interior Design",s={unversionedId:"use-cases/room-redesign",id:"use-cases/room-redesign",title:"AI Interior Design",description:"Backend V1",source:"@site/docs/use-cases/room-redesign.md",sourceDirName:"use-cases",slug:"/use-cases/room-redesign",permalink:"/docs/use-cases/room-redesign",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Masked portraits",permalink:"/docs/use-cases/masked-portraits"},next:{title:"Upscale",permalink:"/docs/use-cases/upscale"}},l={},p=[{value:"Overview",id:"overview",level:2},{value:"How to use",id:"how-to-use",level:2},{value:"Example prompt",id:"example-prompt",level:3}],d={toc:p},c="wrapper";function m(e){let{components:t,...a}=e;return(0,o.kt)(c,(0,r.Z)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"ai-interior-design"},"AI Interior Design"),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Backend V1")),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Original room"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Original room",src:n(1283).Z,width:"512",height:"512"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated using mlsd"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(8246).Z,width:"1024",height:"1024"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room using segroom + mlsd"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Generated room using segroom + mlsd",src:n(9716).Z,width:"1536",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room with window masking"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(8589).Z,width:"1536",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Original sketch"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Original room",src:n(2593).Z,width:"1453",height:"808"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room with window masking"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(6347).Z,width:"2048",height:"1152"})))),(0,o.kt)("p",null,"See example prompts in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/photobooth?controlnet=mlsd"},"photobooth")," page or in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?controlnet=mlsd"},"gallery"),"."),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"AI Interrior design is the term for the process of generating images of a room with different furniture, wall colors, and decorations all while keeping the original room layout. This can be useful for interior designers, real estate agents, or when planning a renovation."),(0,o.kt)("h2",{id:"how-to-use"},"How to use"),(0,o.kt)("p",null,"In order to preserve the room layout use either controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom"),". Input images can be sketches, 3d models, or photos of the room. Depending on the input, you might need to adjust the strength and combination of controlnets as well as the prompts."),(0,o.kt)("p",null,"Controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom")," is a specific controlnet that was trained to preserve the meaning of the room layout, such as walls and windows."),(0,o.kt)("p",null,"Controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," is a more general model, used with a pre-processor that produces straight lines and is suitable for architecture."),(0,o.kt)("p",null,(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," is support for both SDXL and SD1.5 models while ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom")," is only available for SD1.5 models."),(0,o.kt)("p",null,"Additionally you may decide to automatically mask out windows and doors by using the ",(0,o.kt)("inlineCode",{parentName:"p"},"--mask_prompt windows door --mask_invert")," prompt. See more information on ",(0,o.kt)("a",{parentName:"p",href:"/docs/features/prompt-masking"},"prompt masking syntax"),"."),(0,o.kt)("h3",{id:"example-prompt"},"Example prompt"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-text"},"Clean scandinavian design living room, natural light, architecture magazine cover --mask_prompt windows door --mask_invert --controlnets mlsd segroom --controlnet_weights 0.5 1\nnum_images=1\nnegative_prompt=painted, sketch, deformed, easynegative\nseed=\nsteps=30\ncfg_scale=\ncontrolnet=lineart\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/du6cwkp9nojx3ze66vv5nqi39jxo\nmask_image_url=\ndenoising_strength=1\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=1\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")))}m.isMDXComponent=!0},6347:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-sketch-mlsd-326ee922dbfeeb3edabdf1039ddf5f06.jpeg"},2593:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-sketch-6212a108e423e8896124e3f7ef9f51a4.png"},1283:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-af46f8947fdb4f40c831a3d387479d6f.jpeg"},8246:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-mlsd-c6d13d53f345055ace616d19399d62c8.jpg"},8589:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-segroom-masking-b3b3c041cef3add1eedb0e7f609237a1.jpeg"},9716:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-segroom-8dc0b609de0ade09f903ca8a964a5eb0.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/18678e9e.8e294735.js b/assets/js/18678e9e.8e294735.js new file mode 100644 index 00000000..47288322 --- /dev/null +++ b/assets/js/18678e9e.8e294735.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6667],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>u});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},d=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),c=p(n),g=o,u=c["".concat(l,".").concat(g)]||c[g]||m[g]||i;return n?r.createElement(u,a(a({ref:t},d),{},{components:n})):r.createElement(u,a({ref:t},d))}));function u(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:o,a[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var r=n(7462),o=(n(7294),n(3905));const i={image:"./img/ai-interrior-redesign-segroom.jpeg"},a="AI Interior Design",s={unversionedId:"use-cases/room-redesign",id:"use-cases/room-redesign",title:"AI Interior Design",description:"Backend V1",source:"@site/docs/use-cases/room-redesign.md",sourceDirName:"use-cases",slug:"/use-cases/room-redesign",permalink:"/docs/use-cases/room-redesign",draft:!1,tags:[],version:"current",frontMatter:{image:"./img/ai-interrior-redesign-segroom.jpeg"},sidebar:"tutorialSidebar",previous:{title:"Masked portraits",permalink:"/docs/use-cases/masked-portraits"},next:{title:"Upscale",permalink:"/docs/use-cases/upscale"}},l={image:n(9716).Z},p=[{value:"Overview",id:"overview",level:2},{value:"How to use",id:"how-to-use",level:2},{value:"Example prompt",id:"example-prompt",level:3}],d={toc:p},c="wrapper";function m(e){let{components:t,...i}=e;return(0,o.kt)(c,(0,r.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"ai-interior-design"},"AI Interior Design"),(0,o.kt)("p",null,(0,o.kt)("strong",{parentName:"p"},"Backend V1")),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Original room"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Original room",src:n(1283).Z,width:"512",height:"512"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated using mlsd"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(8246).Z,width:"1024",height:"1024"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room using segroom + mlsd"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Generated room using segroom + mlsd",src:n(9716).Z,width:"1536",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room with window masking"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(8589).Z,width:"1536",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Original sketch"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Original room",src:n(2593).Z,width:"1453",height:"808"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Generated room with window masking"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(6347).Z,width:"2048",height:"1152"})))),(0,o.kt)("p",null,"See example prompts in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/photobooth?controlnet=mlsd"},"photobooth")," page or in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?controlnet=mlsd"},"gallery"),"."),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"AI Interrior design is the term for the process of generating images of a room with different furniture, wall colors, and decorations all while keeping the original room layout. This can be useful for interior designers, real estate agents, or when planning a renovation."),(0,o.kt)("h2",{id:"how-to-use"},"How to use"),(0,o.kt)("p",null,"In order to preserve the room layout use either controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom"),". Input images can be sketches, 3d models, or photos of the room. Depending on the input, you might need to adjust the strength and combination of controlnets as well as the prompts."),(0,o.kt)("p",null,"Controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom")," is a specific controlnet that was trained to preserve the meaning of the room layout, such as walls and windows."),(0,o.kt)("p",null,"Controlnet ",(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," is a more general model, used with a pre-processor that produces straight lines and is suitable for architecture."),(0,o.kt)("p",null,(0,o.kt)("inlineCode",{parentName:"p"},"mlsd")," is support for both SDXL and SD1.5 models while ",(0,o.kt)("inlineCode",{parentName:"p"},"segroom")," is only available for SD1.5 models."),(0,o.kt)("p",null,"Additionally you may decide to automatically mask out windows and doors by using the ",(0,o.kt)("inlineCode",{parentName:"p"},"--mask_prompt windows door --mask_invert")," prompt. See more information on ",(0,o.kt)("a",{parentName:"p",href:"/docs/features/prompt-masking"},"prompt masking syntax"),"."),(0,o.kt)("h3",{id:"example-prompt"},"Example prompt"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-text"},"Clean scandinavian design living room, natural light, architecture magazine cover --mask_prompt windows door --mask_invert --controlnets mlsd segroom --controlnet_weights 0.5 1\nnum_images=1\nnegative_prompt=painted, sketch, deformed, easynegative\nseed=\nsteps=30\ncfg_scale=\ncontrolnet=lineart\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/du6cwkp9nojx3ze66vv5nqi39jxo\nmask_image_url=\ndenoising_strength=1\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=1\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")))}m.isMDXComponent=!0},6347:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-sketch-mlsd-326ee922dbfeeb3edabdf1039ddf5f06.jpeg"},2593:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-sketch-6212a108e423e8896124e3f7ef9f51a4.png"},1283:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-input-af46f8947fdb4f40c831a3d387479d6f.jpeg"},8246:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-mlsd-c6d13d53f345055ace616d19399d62c8.jpg"},8589:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-segroom-masking-b3b3c041cef3add1eedb0e7f609237a1.jpeg"},9716:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-interrior-redesign-segroom-8dc0b609de0ade09f903ca8a964a5eb0.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/3ee62890.4e7b9698.js b/assets/js/3ee62890.4e7b9698.js deleted file mode 100644 index 9e880f9f..00000000 --- a/assets/js/3ee62890.4e7b9698.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2247],{3905:(e,t,i)=>{i.d(t,{Zo:()=>u,kt:()=>m});var n=i(7294);function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}var l=n.createContext({}),p=function(e){var t=n.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):o(o({},t),e)),i},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var i=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(i),g=r,m=c["".concat(l,".").concat(g)]||c[g]||d[g]||a;return i?n.createElement(m,o(o({ref:t},u),{},{components:i})):n.createElement(m,o({ref:t},u))}));function m(e,t){var i=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=i.length,o=new Array(a);o[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:r,o[1]=s;for(var p=2;p{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var n=i(7462),r=(i(7294),i(3905));const a={title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography"},o="Fine-tuning guide",s={unversionedId:"use-cases/finetuning-guide",id:"use-cases/finetuning-guide",title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography",source:"@site/docs/use-cases/05-finetuning-guide.md",sourceDirName:"use-cases",slug:"/use-cases/finetuning-guide",permalink:"/docs/use-cases/finetuning-guide",draft:!1,tags:[],version:"current",sidebarPosition:5,frontMatter:{title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography"},sidebar:"tutorialSidebar",previous:{title:"AI Photoshoot - fine-tuning for professional headshots",permalink:"/docs/use-cases/ai-photoshoot"},next:{title:"Flux training",permalink:"/docs/use-cases/flux-finetuning"}},l={},p=[{value:"Tracking subject similarity",id:"tracking-subject-similarity",level:2},{value:"Fine-tuning training tips",id:"fine-tuning-training-tips",level:2},{value:"Prompt generation tips",id:"prompt-generation-tips",level:2}],u={toc:p},c="wrapper";function d(e){let{components:t,...i}=e;return(0,r.kt)(c,(0,n.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"fine-tuning-guide"},"Fine-tuning guide"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"}," The guide for high quality avatars and AI photography")),(0,r.kt)("p",null,"When building an app for avatars or professional AI photoshoot, you should consider two aspects"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Similarity to the original subject"),(0,r.kt)("li",{parentName:"ol"},"High quality generation which look professional")),(0,r.kt)("h2",{id:"tracking-subject-similarity"},"Tracking subject similarity"),(0,r.kt)("p",null,"Make sure to test results on a person you closely know and can judge similarity. Create a list of candidate prompts and run them on 2-3 subjects. For each prompt ask the person to rate how many of the images look similar. Finally sum the ratios for each prompt and compare prompts. Improve the prompts or reconsider a different prompt if similarity is low. Alternatively, consider switching to a different base model to match ethnicity or avoid biased models."),(0,r.kt)("h2",{id:"fine-tuning-training-tips"},"Fine-tuning training tips"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Enable ",(0,r.kt)("strong",{parentName:"li"},"Face-detection")," in your ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/users/edit#profile"},"account settings page")," - This will augment the training dataset with face-crops from the original training images. This should increase similarity to the subject but can also cause generations to be more toward close-ups instead of nice medium or long shots. In this case you might need to adjust the prompts to use emphasis weights."),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Base model")," - Select plain SD15 for better resemblance. Select ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"Realistic Vision V5.1")," as a base model for nicer pictures. These models are good in realistic results. If you\u2019d like to get generations that are more artistic - consider ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes/538238/prompts"},"Deliberate")," or Reliberate as a base model. For a more diverse ethnically and possibly better similarity to subjects, consider ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/tunes/753832/prompts"},"Life Like Ethnicities"),".\nFinally, we suggest checking training on ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/sdxl-training"},"SDXL with text-embedding + LoRA"),".")),(0,r.kt)("h2",{id:"prompt-generation-tips"},"Prompt generation tips"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Set ",(0,r.kt)("strong",{parentName:"li"},"width and height")," to ",(0,r.kt)("strong",{parentName:"li"},"512 x 640")," - to match Instagram aspect ratio of 4:5 and also create good portraits. Avoid higher aspect ratios as you might get artifacts such as duplicate heads."),(0,r.kt)("li",{parentName:"ol"},"Enable ",(0,r.kt)("strong",{parentName:"li"},"face-inpainting")," - This is one of Astria\u2019s unique features and allows creating long shots while avoiding deformed faces."),(0,r.kt)("li",{parentName:"ol"},"Weighted prompts - when a prompt has multiple keywords that collide and reduce similarity - use the parenthesis syntax for emphasis to increase similarity, such as ",(0,r.kt)("inlineCode",{parentName:"li"},"(ohwx man)"),"\nOn the flip side, try to avoid weighted prompts altogether to preserve similarity to subject."),(0,r.kt)("li",{parentName:"ol"},"Use ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/controlnet"},"Controlnet")," with input image to preserve composition and create unique long-shots. Enable ",(0,r.kt)("inlineCode",{parentName:"li"},"controlnet_txt2img")," if you\u2019d like to create more variation and draw more from the prompt. Increase denoising_strength=1")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3ee62890.a0581c26.js b/assets/js/3ee62890.a0581c26.js new file mode 100644 index 00000000..06c357b4 --- /dev/null +++ b/assets/js/3ee62890.a0581c26.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2247],{3905:(e,t,i)=>{i.d(t,{Zo:()=>u,kt:()=>m});var n=i(7294);function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var l=n.createContext({}),p=function(e){var t=n.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):o(o({},t),e)),i},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var i=e.components,a=e.mdxType,r=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(i),d=a,m=c["".concat(l,".").concat(d)]||c[d]||g[d]||r;return i?n.createElement(m,o(o({ref:t},u),{},{components:i})):n.createElement(m,o({ref:t},u))}));function m(e,t){var i=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=i.length,o=new Array(r);o[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:a,o[1]=s;for(var p=2;p{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>g,frontMatter:()=>r,metadata:()=>s,toc:()=>p});var n=i(7462),a=(i(7294),i(3905));const r={title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography",image:"./img/ai-photoshoot-output.jpg"},o="Fine-tuning guide",s={unversionedId:"use-cases/finetuning-guide",id:"use-cases/finetuning-guide",title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography",source:"@site/docs/use-cases/05-finetuning-guide.md",sourceDirName:"use-cases",slug:"/use-cases/finetuning-guide",permalink:"/docs/use-cases/finetuning-guide",draft:!1,tags:[],version:"current",sidebarPosition:5,frontMatter:{title:"Fine-tuning guide",description:"The guide for high quality avatars and AI photography",image:"./img/ai-photoshoot-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"AI Photoshoot - fine-tuning for professional headshots",permalink:"/docs/use-cases/ai-photoshoot"},next:{title:"Flux training",permalink:"/docs/use-cases/flux-finetuning"}},l={image:i(670).Z},p=[{value:"Tracking subject similarity",id:"tracking-subject-similarity",level:2},{value:"Fine-tuning training tips",id:"fine-tuning-training-tips",level:2},{value:"Prompt generation tips",id:"prompt-generation-tips",level:2}],u={toc:p},c="wrapper";function g(e){let{components:t,...i}=e;return(0,a.kt)(c,(0,n.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"fine-tuning-guide"},"Fine-tuning guide"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"}," The guide for high quality avatars and AI photography")),(0,a.kt)("p",null,"When building an app for avatars or professional AI photoshoot, you should consider two aspects"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Similarity to the original subject"),(0,a.kt)("li",{parentName:"ol"},"High quality generation which look professional")),(0,a.kt)("h2",{id:"tracking-subject-similarity"},"Tracking subject similarity"),(0,a.kt)("p",null,"Make sure to test results on a person you closely know and can judge similarity. Create a list of candidate prompts and run them on 2-3 subjects. For each prompt ask the person to rate how many of the images look similar. Finally sum the ratios for each prompt and compare prompts. Improve the prompts or reconsider a different prompt if similarity is low. Alternatively, consider switching to a different base model to match ethnicity or avoid biased models."),(0,a.kt)("h2",{id:"fine-tuning-training-tips"},"Fine-tuning training tips"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Enable ",(0,a.kt)("strong",{parentName:"li"},"Face-detection")," in your ",(0,a.kt)("a",{parentName:"li",href:"https://www.astria.ai/users/edit#profile"},"account settings page")," - This will augment the training dataset with face-crops from the original training images. This should increase similarity to the subject but can also cause generations to be more toward close-ups instead of nice medium or long shots. In this case you might need to adjust the prompts to use emphasis weights."),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("strong",{parentName:"li"},"Base model")," - Select plain SD15 for better resemblance. Select ",(0,a.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"Realistic Vision V5.1")," as a base model for nicer pictures. These models are good in realistic results. If you\u2019d like to get generations that are more artistic - consider ",(0,a.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes/538238/prompts"},"Deliberate")," or Reliberate as a base model. For a more diverse ethnically and possibly better similarity to subjects, consider ",(0,a.kt)("a",{parentName:"li",href:"https://www.astria.ai/tunes/753832/prompts"},"Life Like Ethnicities"),".\nFinally, we suggest checking training on ",(0,a.kt)("a",{parentName:"li",href:"/docs/use-cases/sdxl-training"},"SDXL with text-embedding + LoRA"),".")),(0,a.kt)("h2",{id:"prompt-generation-tips"},"Prompt generation tips"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Set ",(0,a.kt)("strong",{parentName:"li"},"width and height")," to ",(0,a.kt)("strong",{parentName:"li"},"512 x 640")," - to match Instagram aspect ratio of 4:5 and also create good portraits. Avoid higher aspect ratios as you might get artifacts such as duplicate heads."),(0,a.kt)("li",{parentName:"ol"},"Enable ",(0,a.kt)("strong",{parentName:"li"},"face-inpainting")," - This is one of Astria\u2019s unique features and allows creating long shots while avoiding deformed faces."),(0,a.kt)("li",{parentName:"ol"},"Weighted prompts - when a prompt has multiple keywords that collide and reduce similarity - use the parenthesis syntax for emphasis to increase similarity, such as ",(0,a.kt)("inlineCode",{parentName:"li"},"(ohwx man)"),"\nOn the flip side, try to avoid weighted prompts altogether to preserve similarity to subject."),(0,a.kt)("li",{parentName:"ol"},"Use ",(0,a.kt)("a",{parentName:"li",href:"/docs/use-cases/controlnet"},"Controlnet")," with input image to preserve composition and create unique long-shots. Enable ",(0,a.kt)("inlineCode",{parentName:"li"},"controlnet_txt2img")," if you\u2019d like to create more variation and draw more from the prompt. Increase denoising_strength=1")))}g.isMDXComponent=!0},670:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg"}}]); \ No newline at end of file diff --git a/assets/js/64f51cdd.967e661b.js b/assets/js/64f51cdd.967e661b.js deleted file mode 100644 index 2859f3c5..00000000 --- a/assets/js/64f51cdd.967e661b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[5156],{3905:(t,e,n)=>{n.d(e,{Zo:()=>u,kt:()=>g});var a=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var s=a.createContext({}),p=function(t){var e=a.useContext(s),n=e;return t&&(n="function"==typeof t?t(e):o(o({},e),t)),n},u=function(t){var e=p(t.components);return a.createElement(s.Provider,{value:e},t.children)},c="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},m=a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,s=t.parentName,u=l(t,["components","mdxType","originalType","parentName"]),c=p(n),m=r,g=c["".concat(s,".").concat(m)]||c[m]||d[m]||i;return n?a.createElement(g,o(o({ref:e},u),{},{components:n})):a.createElement(g,o({ref:e},u))}));function g(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,o=new Array(i);o[0]=m;var l={};for(var s in e)hasOwnProperty.call(e,s)&&(l[s]=e[s]);l.originalType=t,l[c]="string"==typeof t?t:r,o[1]=l;for(var p=2;p{n.d(e,{Z:()=>o});var a=n(7294),r=n(6010);const i={tabItem:"tabItem_Ymn6"};function o(t){let{children:e,hidden:n,className:o}=t;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(i.tabItem,o),hidden:n},e)}},4866:(t,e,n)=>{n.d(e,{Z:()=>y});var a=n(7462),r=n(7294),i=n(6010),o=n(2466),l=n(6550),s=n(1980),p=n(7392),u=n(12);function c(t){return function(t){return r.Children.map(t,(t=>{if(!t||(0,r.isValidElement)(t)&&function(t){const{props:e}=t;return!!e&&"object"==typeof e&&"value"in e}(t))return t;throw new Error(`Docusaurus error: Bad child <${"string"==typeof t.type?t.type:t.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(t).map((t=>{let{props:{value:e,label:n,attributes:a,default:r}}=t;return{value:e,label:n,attributes:a,default:r}}))}function d(t){const{values:e,children:n}=t;return(0,r.useMemo)((()=>{const t=e??c(n);return function(t){const e=(0,p.l)(t,((t,e)=>t.value===e.value));if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map((t=>t.value)).join(", ")}" found in . Every value needs to be unique.`)}(t),t}),[e,n])}function m(t){let{value:e,tabValues:n}=t;return n.some((t=>t.value===e))}function g(t){let{queryString:e=!1,groupId:n}=t;const a=(0,l.k6)(),i=function(t){let{queryString:e=!1,groupId:n}=t;if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,s._X)(i),(0,r.useCallback)((t=>{if(!i)return;const e=new URLSearchParams(a.location.search);e.set(i,t),a.replace({...a.location,search:e.toString()})}),[i,a])]}function h(t){const{defaultValue:e,queryString:n=!1,groupId:a}=t,i=d(t),[o,l]=(0,r.useState)((()=>function(t){let{defaultValue:e,tabValues:n}=t;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map((t=>t.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const a=n.find((t=>t.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:e,tabValues:i}))),[s,p]=g({queryString:n,groupId:a}),[c,h]=function(t){let{groupId:e}=t;const n=function(t){return t?`docusaurus.tab.${t}`:null}(e),[a,i]=(0,u.Nk)(n);return[a,(0,r.useCallback)((t=>{n&&i.set(t)}),[n,i])]}({groupId:a}),f=(()=>{const t=s??c;return m({value:t,tabValues:i})?t:null})();(0,r.useLayoutEffect)((()=>{f&&l(f)}),[f]);return{selectedValue:o,selectValue:(0,r.useCallback)((t=>{if(!m({value:t,tabValues:i}))throw new Error(`Can't select invalid tab value=${t}`);l(t),p(t),h(t)}),[p,h,i]),tabValues:i}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function _(t){let{className:e,block:n,selectedValue:l,selectValue:s,tabValues:p}=t;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.o5)(),d=t=>{const e=t.currentTarget,n=u.indexOf(e),a=p[n].value;a!==l&&(c(e),s(a))},m=t=>{let e=null;switch(t.key){case"Enter":d(t);break;case"ArrowRight":{const n=u.indexOf(t.currentTarget)+1;e=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(t.currentTarget)-1;e=u[n]??u[u.length-1];break}}e?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},e)},p.map((t=>{let{value:e,label:n,attributes:o}=t;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===e?0:-1,"aria-selected":l===e,key:e,ref:t=>u.push(t),onKeyDown:m,onClick:d},o,{className:(0,i.Z)("tabs__item",b.tabItem,o?.className,{"tabs__item--active":l===e})}),n??e)})))}function k(t){let{lazy:e,children:n,selectedValue:a}=t;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const t=i.find((t=>t.props.value===a));return t?(0,r.cloneElement)(t,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},i.map(((t,e)=>(0,r.cloneElement)(t,{key:e,hidden:t.props.value!==a}))))}function v(t){const e=h(t);return r.createElement("div",{className:(0,i.Z)("tabs-container",b.tabList)},r.createElement(_,(0,a.Z)({},t,e)),r.createElement(k,(0,a.Z)({},t,e)))}function y(t){const e=(0,f.Z)();return r.createElement(v,(0,a.Z)({key:String(e)},t))}},3026:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>u,contentTitle:()=>s,default:()=>g,frontMatter:()=>l,metadata:()=>p,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),i=n(4866),o=n(5162);const l={title:"Flux Outpainting",description:"LoRA",tags:["Outpainting","cinematic","virtual try-on"],hide_table_of_contents:!0},s="Outpainting",p={unversionedId:"features/outpainting",id:"features/outpainting",title:"Flux Outpainting",description:"LoRA",source:"@site/docs/features/outpainting.md",sourceDirName:"features",slug:"/features/outpainting",permalink:"/docs/features/outpainting",draft:!1,tags:[{label:"Outpainting",permalink:"/docs/tags/outpainting"},{label:"cinematic",permalink:"/docs/tags/cinematic"},{label:"virtual try-on",permalink:"/docs/tags/virtual-try-on"}],version:"current",frontMatter:{title:"Flux Outpainting",description:"LoRA",tags:["Outpainting","cinematic","virtual try-on"],hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"Multi-Person",permalink:"/docs/features/multiperson"},next:{title:"Prompt Masking",permalink:"/docs/features/prompt-masking"}},u={},c=[{value:"Outpainting only",id:"outpainting-only",level:3},{value:"txt2img + Outpainting",id:"txt2img--outpainting",level:3},{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Examples",id:"examples",level:2},{value:"API Usage",id:"api-usage",level:2},{value:"POST /tunes/1504944/prompts",id:"post-tunes1504944prompts",level:4}],d={toc:c},m="wrapper";function g(t){let{components:e,...l}=t;return(0,r.kt)(m,(0,a.Z)({},d,l,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"outpainting"},"Outpainting"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"}," For flux ")),(0,r.kt)("h3",{id:"outpainting-only"},"Outpainting only"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(7098).Z,width:"576",height:"864"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Outpainting only - no txt2img"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting VTON result",src:n(6447).Z,width:"1728",height:"2592"})))),(0,r.kt)("h3",{id:"txt2img--outpainting"},"txt2img + Outpainting"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Txt2img only 1:1 (1024x1024)"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(5992).Z,width:"1024",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint to 9:16"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting with txt2img result",src:n(4116).Z,width:"1024",height:"1792"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint 16:9"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(3301).Z,width:"1792",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint 16:9"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting with txt2img result",src:n(7150).Z,width:"1792",height:"1024"})))),(0,r.kt)("p",null,"See outpaint examples in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=outpaint"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Outpainting is a technique used to extend an image to bring in more context and background into the initally generated subject of the image. Examples for usage could be taking a 1:1 aspect-ratio (1024x1024) and extending it into a 16:9 cinematic view, or taking a waist up portrait 1:1 and extending it into a full body portrait 9:16. One of the advantages of this is better preservation of the face identity, as well as the ability of the model on focusing on the background generation due to it being separated into a separate task."),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"Below are the arguments that should be added at the end of the prompt text to enable outpainting:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint")," - The anchor for outpainting. Options: ",(0,r.kt)("inlineCode",{parentName:"li"},"top-left, top-right, bottom-left, bottom-right, center, top-center, bottom-center, left-center, right-center")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_height")," "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_width")," "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_prompt")," - Optional")),(0,r.kt)("p",null,"In case you're interested in setting an input image and doing only outpainting, and skipping the txt2img/img2img step, make sure to set ",(0,r.kt)("inlineCode",{parentName:"p"},"denoising_strength: 0")),(0,r.kt)("h2",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Outpaint only"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"--outpaint top-center --outpaint_width 864 --outpaint_height 1296\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si\nmask_image_url=\ndenoising_strength=0\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=true\nw=576\nh=864\n")),(0,r.kt)("p",null,"txt2img + outpainting"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=1024\n')),(0,r.kt)("p",null,"txt2img + multi-person outpainting"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint left-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "president Trump the middle of the field"\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=1024\n'))),(0,r.kt)("div",null,(0,r.kt)("h2",{id:"api-usage"},"API Usage"),(0,r.kt)("h4",{id:"post-tunes1504944prompts"},"POST /tunes/1504944/prompts"),(0,r.kt)(i.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\n# Outpaint only example\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]="--outpaint top-center --outpaint_width 864 --outpaint_height 1296" \\\n -F prompt[denoising_strength]=0 \\\n -F prompt[input_image_url]="https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"\n \n# txt2img + outpainting example \ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]=\' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"\' \\\n -F prompt[w]=1024 \\\n -F prompt[h]=1024 \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"\n'))),(0,r.kt)(o.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/1504944/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', '--outpaint top-center --outpaint_width 864 --outpaint_height 1296');\nform.append('prompt[input_image_url]', 'https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si');\n// Alternatively use prompt[input_image]\n// form.append('prompt[input_image]', fs.createReadStream(`./input-image.png`));\nform.append('prompt[denoising_strength]', 0);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n// txt2img + outpainting example\nconst form = new FormData();\nform.append('prompt[text]', ' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt \"fields\"');\nform.append('prompt[w]', 1024);\nform.append('prompt[h]', 1024);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\n"))),(0,r.kt)(o.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/1504944/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': '--outpaint top-center --outpaint_width 864 --outpaint_height 1296',\n 'prompt[denoising_strength]': 0,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n\n# txt2img + outpainting example\ndata = {\n 'prompt[text]': ' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt \"fields\"',\n 'prompt[w]': 1024,\n 'prompt[h]': 1024,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}g.isMDXComponent=!0},7098:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint1-input-b5d163b9792b9504bdda840576fc9d8f.png"},6447:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint1-out-d2b73ae432b23ddc64a3e564581b87d8.jpg"},5992:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-input-e7390c2fc24213b0acd02ec81e86e912.jpg"},3301:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-16-9-c61b36455bca3e5539434aaea55f9163.jpg"},4116:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-9-16-467aae6e40fa6043ff6efecdda6190cb.jpg"},7150:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-multi-person-d01b5eb044ee4469b18c3e234f27af8e.jpg"}}]); \ No newline at end of file diff --git a/assets/js/64f51cdd.cdf57b69.js b/assets/js/64f51cdd.cdf57b69.js new file mode 100644 index 00000000..95ead7a3 --- /dev/null +++ b/assets/js/64f51cdd.cdf57b69.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[5156],{3905:(t,e,n)=>{n.d(e,{Zo:()=>u,kt:()=>g});var a=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function o(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var p=a.createContext({}),s=function(t){var e=a.useContext(p),n=e;return t&&(n="function"==typeof t?t(e):o(o({},e),t)),n},u=function(t){var e=s(t.components);return a.createElement(p.Provider,{value:e},t.children)},c="mdxType",d={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},m=a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,i=t.originalType,p=t.parentName,u=l(t,["components","mdxType","originalType","parentName"]),c=s(n),m=r,g=c["".concat(p,".").concat(m)]||c[m]||d[m]||i;return n?a.createElement(g,o(o({ref:e},u),{},{components:n})):a.createElement(g,o({ref:e},u))}));function g(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var i=n.length,o=new Array(i);o[0]=m;var l={};for(var p in e)hasOwnProperty.call(e,p)&&(l[p]=e[p]);l.originalType=t,l[c]="string"==typeof t?t:r,o[1]=l;for(var s=2;s{n.d(e,{Z:()=>o});var a=n(7294),r=n(6010);const i={tabItem:"tabItem_Ymn6"};function o(t){let{children:e,hidden:n,className:o}=t;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(i.tabItem,o),hidden:n},e)}},4866:(t,e,n)=>{n.d(e,{Z:()=>y});var a=n(7462),r=n(7294),i=n(6010),o=n(2466),l=n(6550),p=n(1980),s=n(7392),u=n(12);function c(t){return function(t){return r.Children.map(t,(t=>{if(!t||(0,r.isValidElement)(t)&&function(t){const{props:e}=t;return!!e&&"object"==typeof e&&"value"in e}(t))return t;throw new Error(`Docusaurus error: Bad child <${"string"==typeof t.type?t.type:t.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(t).map((t=>{let{props:{value:e,label:n,attributes:a,default:r}}=t;return{value:e,label:n,attributes:a,default:r}}))}function d(t){const{values:e,children:n}=t;return(0,r.useMemo)((()=>{const t=e??c(n);return function(t){const e=(0,s.l)(t,((t,e)=>t.value===e.value));if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map((t=>t.value)).join(", ")}" found in . Every value needs to be unique.`)}(t),t}),[e,n])}function m(t){let{value:e,tabValues:n}=t;return n.some((t=>t.value===e))}function g(t){let{queryString:e=!1,groupId:n}=t;const a=(0,l.k6)(),i=function(t){let{queryString:e=!1,groupId:n}=t;if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,p._X)(i),(0,r.useCallback)((t=>{if(!i)return;const e=new URLSearchParams(a.location.search);e.set(i,t),a.replace({...a.location,search:e.toString()})}),[i,a])]}function h(t){const{defaultValue:e,queryString:n=!1,groupId:a}=t,i=d(t),[o,l]=(0,r.useState)((()=>function(t){let{defaultValue:e,tabValues:n}=t;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map((t=>t.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const a=n.find((t=>t.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:e,tabValues:i}))),[p,s]=g({queryString:n,groupId:a}),[c,h]=function(t){let{groupId:e}=t;const n=function(t){return t?`docusaurus.tab.${t}`:null}(e),[a,i]=(0,u.Nk)(n);return[a,(0,r.useCallback)((t=>{n&&i.set(t)}),[n,i])]}({groupId:a}),f=(()=>{const t=p??c;return m({value:t,tabValues:i})?t:null})();(0,r.useLayoutEffect)((()=>{f&&l(f)}),[f]);return{selectedValue:o,selectValue:(0,r.useCallback)((t=>{if(!m({value:t,tabValues:i}))throw new Error(`Can't select invalid tab value=${t}`);l(t),s(t),h(t)}),[s,h,i]),tabValues:i}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function _(t){let{className:e,block:n,selectedValue:l,selectValue:p,tabValues:s}=t;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.o5)(),d=t=>{const e=t.currentTarget,n=u.indexOf(e),a=s[n].value;a!==l&&(c(e),p(a))},m=t=>{let e=null;switch(t.key){case"Enter":d(t);break;case"ArrowRight":{const n=u.indexOf(t.currentTarget)+1;e=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(t.currentTarget)-1;e=u[n]??u[u.length-1];break}}e?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},e)},s.map((t=>{let{value:e,label:n,attributes:o}=t;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===e?0:-1,"aria-selected":l===e,key:e,ref:t=>u.push(t),onKeyDown:m,onClick:d},o,{className:(0,i.Z)("tabs__item",b.tabItem,o?.className,{"tabs__item--active":l===e})}),n??e)})))}function k(t){let{lazy:e,children:n,selectedValue:a}=t;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const t=i.find((t=>t.props.value===a));return t?(0,r.cloneElement)(t,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},i.map(((t,e)=>(0,r.cloneElement)(t,{key:e,hidden:t.props.value!==a}))))}function v(t){const e=h(t);return r.createElement("div",{className:(0,i.Z)("tabs-container",b.tabList)},r.createElement(_,(0,a.Z)({},t,e)),r.createElement(k,(0,a.Z)({},t,e)))}function y(t){const e=(0,f.Z)();return r.createElement(v,(0,a.Z)({key:String(e)},t))}},3026:(t,e,n)=>{n.r(e),n.d(e,{assets:()=>u,contentTitle:()=>p,default:()=>g,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),i=n(4866),o=n(5162);const l={title:"Flux Outpainting",description:"LoRA",tags:["Outpainting","cinematic","virtual try-on"],hide_table_of_contents:!0,image:"./img/outpaint/outpaint2-out-16-9.jpg"},p="Outpainting",s={unversionedId:"features/outpainting",id:"features/outpainting",title:"Flux Outpainting",description:"LoRA",source:"@site/docs/features/outpainting.md",sourceDirName:"features",slug:"/features/outpainting",permalink:"/docs/features/outpainting",draft:!1,tags:[{label:"Outpainting",permalink:"/docs/tags/outpainting"},{label:"cinematic",permalink:"/docs/tags/cinematic"},{label:"virtual try-on",permalink:"/docs/tags/virtual-try-on"}],version:"current",frontMatter:{title:"Flux Outpainting",description:"LoRA",tags:["Outpainting","cinematic","virtual try-on"],hide_table_of_contents:!0,image:"./img/outpaint/outpaint2-out-16-9.jpg"},sidebar:"tutorialSidebar",previous:{title:"Multi-Person",permalink:"/docs/features/multiperson"},next:{title:"Prompt Masking",permalink:"/docs/features/prompt-masking"}},u={image:n(3301).Z},c=[{value:"Outpainting only",id:"outpainting-only",level:3},{value:"txt2img + Outpainting",id:"txt2img--outpainting",level:3},{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Examples",id:"examples",level:2},{value:"API Usage",id:"api-usage",level:2},{value:"POST /tunes/1504944/prompts",id:"post-tunes1504944prompts",level:4}],d={toc:c},m="wrapper";function g(t){let{components:e,...l}=t;return(0,r.kt)(m,(0,a.Z)({},d,l,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"outpainting"},"Outpainting"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"}," For flux ")),(0,r.kt)("h3",{id:"outpainting-only"},"Outpainting only"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(7098).Z,width:"576",height:"864"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Outpainting only - no txt2img"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting VTON result",src:n(6447).Z,width:"1728",height:"2592"})))),(0,r.kt)("h3",{id:"txt2img--outpainting"},"txt2img + Outpainting"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Txt2img only 1:1 (1024x1024)"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(5992).Z,width:"1024",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint to 9:16"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting with txt2img result",src:n(4116).Z,width:"1024",height:"1792"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint 16:9"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"outpainting for VTON",src:n(3301).Z,width:"1792",height:"1024"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"txt2img + outpaint 16:9"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Outpainting with txt2img result",src:n(7150).Z,width:"1792",height:"1024"})))),(0,r.kt)("p",null,"See outpaint examples in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=outpaint"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Outpainting is a technique used to extend an image to bring in more context and background into the initally generated subject of the image. Examples for usage could be taking a 1:1 aspect-ratio (1024x1024) and extending it into a 16:9 cinematic view, or taking a waist up portrait 1:1 and extending it into a full body portrait 9:16. One of the advantages of this is better preservation of the face identity, as well as the ability of the model on focusing on the background generation due to it being separated into a separate task."),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"Below are the arguments that should be added at the end of the prompt text to enable outpainting:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint")," - The anchor for outpainting. Options: ",(0,r.kt)("inlineCode",{parentName:"li"},"top-left, top-right, bottom-left, bottom-right, center, top-center, bottom-center, left-center, right-center")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_height")," "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_width")," "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--outpaint_prompt")," - Optional")),(0,r.kt)("p",null,"In case you're interested in setting an input image and doing only outpainting, and skipping the txt2img/img2img step, make sure to set ",(0,r.kt)("inlineCode",{parentName:"p"},"denoising_strength: 0")),(0,r.kt)("h2",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Outpaint only"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"--outpaint top-center --outpaint_width 864 --outpaint_height 1296\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si\nmask_image_url=\ndenoising_strength=0\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=true\nw=576\nh=864\n")),(0,r.kt)("p",null,"txt2img + outpainting"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=1024\n')),(0,r.kt)("p",null,"txt2img + multi-person outpainting"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint left-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "president Trump the middle of the field"\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=0\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=1024\n'))),(0,r.kt)("div",null,(0,r.kt)("h2",{id:"api-usage"},"API Usage"),(0,r.kt)("h4",{id:"post-tunes1504944prompts"},"POST /tunes/1504944/prompts"),(0,r.kt)(i.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\n# Outpaint only example\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]="--outpaint top-center --outpaint_width 864 --outpaint_height 1296" \\\n -F prompt[denoising_strength]=0 \\\n -F prompt[input_image_url]="https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"\n \n# txt2img + outpainting example \ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]=\' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"\' \\\n -F prompt[w]=1024 \\\n -F prompt[h]=1024 \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"\n'))),(0,r.kt)(o.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/1504944/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', '--outpaint top-center --outpaint_width 864 --outpaint_height 1296');\nform.append('prompt[input_image_url]', 'https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si');\n// Alternatively use prompt[input_image]\n// form.append('prompt[input_image]', fs.createReadStream(`./input-image.png`));\nform.append('prompt[denoising_strength]', 0);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n// txt2img + outpainting example\nconst form = new FormData();\nform.append('prompt[text]', ' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt \"fields\"');\nform.append('prompt[w]', 1024);\nform.append('prompt[h]', 1024);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\n"))),(0,r.kt)(o.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/1504944/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': '--outpaint top-center --outpaint_width 864 --outpaint_height 1296',\n 'prompt[denoising_strength]': 0,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n\n# txt2img + outpainting example\ndata = {\n 'prompt[text]': ' ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt \"fields\"',\n 'prompt[w]': 1024,\n 'prompt[h]': 1024,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}g.isMDXComponent=!0},7098:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint1-input-b5d163b9792b9504bdda840576fc9d8f.png"},6447:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint1-out-d2b73ae432b23ddc64a3e564581b87d8.jpg"},5992:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-input-e7390c2fc24213b0acd02ec81e86e912.jpg"},3301:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-16-9-c61b36455bca3e5539434aaea55f9163.jpg"},4116:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-9-16-467aae6e40fa6043ff6efecdda6190cb.jpg"},7150:(t,e,n)=>{n.d(e,{Z:()=>a});const a=n.p+"assets/images/outpaint2-out-multi-person-d01b5eb044ee4469b18c3e234f27af8e.jpg"}}]); \ No newline at end of file diff --git a/assets/js/6540dd0c.3b4fc190.js b/assets/js/6540dd0c.3b4fc190.js deleted file mode 100644 index e969dec0..00000000 --- a/assets/js/6540dd0c.3b4fc190.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[9075],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>h});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),p=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(a),m=r,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||o;return a?n.createElement(h,i(i({ref:t},u),{},{components:a})):n.createElement(h,i({ref:t},u))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,i=new Array(o);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.d(t,{Z:()=>i});var n=a(7294),r=a(6010);const o={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,i),hidden:a},t)}},4866:(e,t,a)=>{a.d(t,{Z:()=>_});var n=a(7462),r=a(7294),o=a(6010),i=a(2466),s=a(6550),l=a(1980),p=a(7392),u=a(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function d(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??c(a);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function m(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:a}=e;const n=(0,s.k6)(),o=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,l._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})}),[o,n])]}function f(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,o=d(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[l,p]=h({queryString:a,groupId:n}),[c,f]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,o]=(0,u.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&o.set(e)}),[a,o])]}({groupId:n}),g=(()=>{const e=l??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&s(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);s(e),p(e),f(e)}),[p,f,o]),tabValues:o}}var g=a(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function k(e){let{className:t,block:a,selectedValue:s,selectValue:l,tabValues:p}=e;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),d=e=>{const t=e.currentTarget,a=u.indexOf(t),n=p[a].value;n!==s&&(c(t),l(n))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const a=u.indexOf(e.currentTarget)+1;t=u[a]??u[0];break}case"ArrowLeft":{const a=u.indexOf(e.currentTarget)-1;t=u[a]??u[u.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":a},t)},p.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,key:t,ref:e=>u.push(e),onKeyDown:m,onClick:d},i,{className:(0,o.Z)("tabs__item",b.tabItem,i?.className,{"tabs__item--active":s===t})}),a??t)})))}function w(e){let{lazy:t,children:a,selectedValue:n}=e;const o=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(k,(0,n.Z)({},e,t)),r.createElement(w,(0,n.Z)({},e,t)))}function _(e){const t=(0,g.Z)();return r.createElement(y,(0,n.Z)({key:String(t)},e))}},4336:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>p,toc:()=>c});var n=a(7462),r=(a(7294),a(3905)),o=a(4866),i=a(5162);const s={hide_table_of_contents:!0},l="FaceID",p={unversionedId:"features/faceid",id:"features/faceid",title:"FaceID",description:"BETA",source:"@site/docs/features/faceid.md",sourceDirName:"features",slug:"/features/faceid",permalink:"/docs/features/faceid",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"FaceID for Flux",permalink:"/docs/features/faceid-flux"},next:{title:"Latent Consistency Models",permalink:"/docs/features/lcm"}},u={},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Notes",id:"notes",level:2},{value:"API",id:"api",level:2},{value:"Step 1: Create fine-tune",id:"step-1-create-fine-tune",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Response",id:"response",level:4},{value:"Step 2: Create prompts",id:"step-2-create-prompts",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...s}=e;return(0,r.kt)(m,(0,n.Z)({},d,s,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"faceid"},"FaceID"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(6973).Z,width:"525",height:"671"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid"},"FaceID")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(8167).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(6361).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(1250).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(7432).Z,width:"1024",height:"1536"}))))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid_portrait"},"FaceID portrait")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(3257).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(6113).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(9814).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(8497).Z,width:"1024",height:"1536"})))))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready.\n",(0,r.kt)("img",{alt:"faceid-new-fine-tune.png",src:a(1158).Z,width:"740",height:"544"})),(0,r.kt)("li",{parentName:"ol"},"Generate the image using the FaceID adapter using a syntax similar to LoRA - ",(0,r.kt)("inlineCode",{parentName:"li"},"")," ")),(0,r.kt)("h2",{id:"notes"},"Notes"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Use ",(0,r.kt)("inlineCode",{parentName:"li"},"cfg_scale=3")),(0,r.kt)("li",{parentName:"ol"},"FaceID can work nicely together with ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/face-swap"},"Face Swap")," to improve similarity."),(0,r.kt)("li",{parentName:"ol"},"Disable Face-Swap in case your prompt is animation style. Additionally, make sure to select an animated model from the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes?title=pixar"},"gallery"),". "),(0,r.kt)("li",{parentName:"ol"},"For fast generation use the ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/lcm"},"LCM schedulers"),"."),(0,r.kt)("li",{parentName:"ol"},"For realistic images, please consider enabling face-correct to improve facial features."),(0,r.kt)("li",{parentName:"ol"},"When creating a fine-tune: Base-model is only used as a default for UI generation but does not affect FaceID."),(0,r.kt)("li",{parentName:"ol"},"When creating a fine-tune: ",(0,r.kt)("inlineCode",{parentName:"li"},"steps")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"training_face_correct")," are not used for FaceID.")),(0,r.kt)("h2",{id:"api"},"API"),(0,r.kt)("p",null,"FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery.\nThe fine-tune's ",(0,r.kt)("inlineCode",{parentName:"p"},"trained_at")," is set upon creation and there is no training time. As such no callback is needed."),(0,r.kt)("admonition",{type:"warning"},(0,r.kt)("p",{parentName:"admonition"},"If you are receiving ",(0,r.kt)("inlineCode",{parentName:"p"},"422")," error ",(0,r.kt)("inlineCode",{parentName:"p"},"model_type=faceid is not supported. Use a checkpoint instead")," - Change the request URL to ",(0,r.kt)("a",{parentName:"p",href:"https://api.astria.ai/tunes/690204/prompts"},"https://api.astria.ai/tunes/690204/prompts")," with ",(0,r.kt)("inlineCode",{parentName:"p"},"690204")," as a hard-coded tune_id of Realistic Vision v5.1 from the gallery. See explanation above. "))),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-create-fine-tune"},"Step 1: Create fine-tune"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/690204/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "John Doe - UUID - 1234-6789-1234-56789",\n "name": "man",\n "model_type": "faceid",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n \"base_tune_id\": 690204,\n \"name\": \"man\",\n \"model_type\": \"faceid\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ]\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch()\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n formData.append('tune[model_type]', 'faceid');\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n formData.append('tune[base_tune_id]', 690204);\n formData.append('tune[name]', 'man');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `tune.images` are already defined in your context\n# If not, you should define them before the below code\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[base_tune_id]": 690204,\n "tune[model_type]": "faceid",\n "tune[token]": "ohwx"\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h4",{id:"response"},"Response"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'\n[\n {\n "id": 1,\n "title": "John Doe",\n "name": "woman",\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": false,\n "ckpt_url": null,\n "ckpt_urls": [],\n "eta": "2023-10-02T14:32:40.363Z",\n "trained_at": "2023-10-02T14:32:40.363Z",\n "started_training_at": "2023-10-02T14:32:05.229Z",\n "expires_at": "2023-11-01T14:32:40.363Z",\n "created_at": "2023-10-02T14:32:05.067Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-10-02T14:32:40.363Z",\n "url": "https://www.astria.ai/tunes/788416.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n },\n {\n "id": 775459,\n "title": "Marry Jane",\n "name": null,\n "is_api": false,\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": null,\n "ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",\n "ckpt_urls": [\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ],\n "eta": "2023-09-23T16:07:49.137Z",\n "trained_at": "2023-09-23T16:07:49.137Z",\n "started_training_at": "2023-09-23T16:07:37.334Z",\n "expires_at": "2023-10-23T16:07:49.137Z",\n "created_at": "2023-09-23T16:07:36.606Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-09-23T16:07:49.138Z",\n "url": "https://www.astria.ai/tunes/775459.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n }\n ]\n')),(0,r.kt)("h3",{id:"step-2-create-prompts"},"Step 2: Create prompts"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=" woman trekking in the alps" \\\n -F prompt[negative_prompt]="" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[face_swap]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' woman trekking in the alps');\nform.append('prompt[negative_prompt]', '');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[face_swap]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' woman trekking in the alps',\n 'prompt[negative_prompt]': '',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[face_swap]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0},1158:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-new-fine-tune-cc128107ac919832509e97a8ca45918b.png"},8167:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output1-aa799eba49b320b187e29cec267a3258.jpg"},6361:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output2-e44e20e05a5a6cffaba2d97ee9ac1947.jpg"},1250:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output3-b4745421562fc7a28a7be8eb46f4853e.jpg"},7432:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output4-8e3f3c0ebd0449c2adf1d12015229097.jpg"},3257:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output1-8c5ea4967162c608b58d6b56dcb60cce.jpg"},6113:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output2-890a11d787c8827591af150362b1af05.jpg"},9814:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output3-92853d1bee638e8a6785ae5961ef96b8.jpg"},8497:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output4-4d41c4f7de56b0befb40e69b89bc0190.jpg"},6973:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"}}]); \ No newline at end of file diff --git a/assets/js/6540dd0c.e5735a36.js b/assets/js/6540dd0c.e5735a36.js new file mode 100644 index 00000000..02a6e627 --- /dev/null +++ b/assets/js/6540dd0c.e5735a36.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[9075],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>h});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),p=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),c=p(a),m=r,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||o;return a?n.createElement(h,i(i({ref:t},u),{},{components:a})):n.createElement(h,i({ref:t},u))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,i=new Array(o);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.d(t,{Z:()=>i});var n=a(7294),r=a(6010);const o={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:a,className:i}=e;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,i),hidden:a},t)}},4866:(e,t,a)=>{a.d(t,{Z:()=>_});var n=a(7462),r=a(7294),o=a(6010),i=a(2466),s=a(6550),l=a(1980),p=a(7392),u=a(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:a,attributes:n,default:r}}=e;return{value:t,label:a,attributes:n,default:r}}))}function d(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??c(a);return function(e){const t=(0,p.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function m(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:a}=e;const n=(0,s.k6)(),o=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,l._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})}),[o,n])]}function f(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,o=d(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=a.find((e=>e.default))??a[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[l,p]=h({queryString:a,groupId:n}),[c,f]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,o]=(0,u.Nk)(a);return[n,(0,r.useCallback)((e=>{a&&o.set(e)}),[a,o])]}({groupId:n}),g=(()=>{const e=l??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&s(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);s(e),p(e),f(e)}),[p,f,o]),tabValues:o}}var g=a(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function k(e){let{className:t,block:a,selectedValue:s,selectValue:l,tabValues:p}=e;const u=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),d=e=>{const t=e.currentTarget,a=u.indexOf(t),n=p[a].value;n!==s&&(c(t),l(n))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const a=u.indexOf(e.currentTarget)+1;t=u[a]??u[0];break}case"ArrowLeft":{const a=u.indexOf(e.currentTarget)-1;t=u[a]??u[u.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":a},t)},p.map((e=>{let{value:t,label:a,attributes:i}=e;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,key:t,ref:e=>u.push(e),onKeyDown:m,onClick:d},i,{className:(0,o.Z)("tabs__item",b.tabItem,i?.className,{"tabs__item--active":s===t})}),a??t)})))}function w(e){let{lazy:t,children:a,selectedValue:n}=e;const o=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function y(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(k,(0,n.Z)({},e,t)),r.createElement(w,(0,n.Z)({},e,t)))}function _(e){const t=(0,g.Z)();return r.createElement(y,(0,n.Z)({key:String(t)},e))}},4336:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>p,toc:()=>c});var n=a(7462),r=(a(7294),a(3905)),o=a(4866),i=a(5162);const s={hide_table_of_contents:!0,image:"./img/faceid-output3.jpg"},l="FaceID",p={unversionedId:"features/faceid",id:"features/faceid",title:"FaceID",description:"BETA",source:"@site/docs/features/faceid.md",sourceDirName:"features",slug:"/features/faceid",permalink:"/docs/features/faceid",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0,image:"./img/faceid-output3.jpg"},sidebar:"tutorialSidebar",previous:{title:"FaceID for Flux",permalink:"/docs/features/faceid-flux"},next:{title:"Latent Consistency Models",permalink:"/docs/features/lcm"}},u={image:a(1250).Z},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Notes",id:"notes",level:2},{value:"API",id:"api",level:2},{value:"Step 1: Create fine-tune",id:"step-1-create-fine-tune",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Response",id:"response",level:4},{value:"Step 2: Create prompts",id:"step-2-create-prompts",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...s}=e;return(0,r.kt)(m,(0,n.Z)({},d,s,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"faceid"},"FaceID"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(6973).Z,width:"525",height:"671"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid"},"FaceID")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(8167).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(6361).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(1250).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(7432).Z,width:"1024",height:"1536"}))))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid_portrait"},"FaceID portrait")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(3257).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(6113).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(9814).Z,width:"1024",height:"1536"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:a(8497).Z,width:"1024",height:"1536"})))))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready.\n",(0,r.kt)("img",{alt:"faceid-new-fine-tune.png",src:a(1158).Z,width:"740",height:"544"})),(0,r.kt)("li",{parentName:"ol"},"Generate the image using the FaceID adapter using a syntax similar to LoRA - ",(0,r.kt)("inlineCode",{parentName:"li"},"")," ")),(0,r.kt)("h2",{id:"notes"},"Notes"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Use ",(0,r.kt)("inlineCode",{parentName:"li"},"cfg_scale=3")),(0,r.kt)("li",{parentName:"ol"},"FaceID can work nicely together with ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/face-swap"},"Face Swap")," to improve similarity."),(0,r.kt)("li",{parentName:"ol"},"Disable Face-Swap in case your prompt is animation style. Additionally, make sure to select an animated model from the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/gallery/tunes?title=pixar"},"gallery"),". "),(0,r.kt)("li",{parentName:"ol"},"For fast generation use the ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/lcm"},"LCM schedulers"),"."),(0,r.kt)("li",{parentName:"ol"},"For realistic images, please consider enabling face-correct to improve facial features."),(0,r.kt)("li",{parentName:"ol"},"When creating a fine-tune: Base-model is only used as a default for UI generation but does not affect FaceID."),(0,r.kt)("li",{parentName:"ol"},"When creating a fine-tune: ",(0,r.kt)("inlineCode",{parentName:"li"},"steps")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"training_face_correct")," are not used for FaceID.")),(0,r.kt)("h2",{id:"api"},"API"),(0,r.kt)("p",null,"FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery.\nThe fine-tune's ",(0,r.kt)("inlineCode",{parentName:"p"},"trained_at")," is set upon creation and there is no training time. As such no callback is needed."),(0,r.kt)("admonition",{type:"warning"},(0,r.kt)("p",{parentName:"admonition"},"If you are receiving ",(0,r.kt)("inlineCode",{parentName:"p"},"422")," error ",(0,r.kt)("inlineCode",{parentName:"p"},"model_type=faceid is not supported. Use a checkpoint instead")," - Change the request URL to ",(0,r.kt)("a",{parentName:"p",href:"https://api.astria.ai/tunes/690204/prompts"},"https://api.astria.ai/tunes/690204/prompts")," with ",(0,r.kt)("inlineCode",{parentName:"p"},"690204")," as a hard-coded tune_id of Realistic Vision v5.1 from the gallery. See explanation above. "))),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-create-fine-tune"},"Step 1: Create fine-tune"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/690204/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "John Doe - UUID - 1234-6789-1234-56789",\n "name": "man",\n "model_type": "faceid",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n \"base_tune_id\": 690204,\n \"name\": \"man\",\n \"model_type\": \"faceid\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ]\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch()\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n formData.append('tune[model_type]', 'faceid');\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n formData.append('tune[base_tune_id]', 690204);\n formData.append('tune[name]', 'man');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `tune.images` are already defined in your context\n# If not, you should define them before the below code\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[base_tune_id]": 690204,\n "tune[model_type]": "faceid",\n "tune[token]": "ohwx"\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h4",{id:"response"},"Response"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'\n[\n {\n "id": 1,\n "title": "John Doe",\n "name": "woman",\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": false,\n "ckpt_url": null,\n "ckpt_urls": [],\n "eta": "2023-10-02T14:32:40.363Z",\n "trained_at": "2023-10-02T14:32:40.363Z",\n "started_training_at": "2023-10-02T14:32:05.229Z",\n "expires_at": "2023-11-01T14:32:40.363Z",\n "created_at": "2023-10-02T14:32:05.067Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-10-02T14:32:40.363Z",\n "url": "https://www.astria.ai/tunes/788416.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n },\n {\n "id": 775459,\n "title": "Marry Jane",\n "name": null,\n "is_api": false,\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": null,\n "ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",\n "ckpt_urls": [\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ],\n "eta": "2023-09-23T16:07:49.137Z",\n "trained_at": "2023-09-23T16:07:49.137Z",\n "started_training_at": "2023-09-23T16:07:37.334Z",\n "expires_at": "2023-10-23T16:07:49.137Z",\n "created_at": "2023-09-23T16:07:36.606Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-09-23T16:07:49.138Z",\n "url": "https://www.astria.ai/tunes/775459.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n }\n ]\n')),(0,r.kt)("h3",{id:"step-2-create-prompts"},"Step 2: Create prompts"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=" woman trekking in the alps" \\\n -F prompt[negative_prompt]="" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[face_swap]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' woman trekking in the alps');\nform.append('prompt[negative_prompt]', '');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[face_swap]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' woman trekking in the alps',\n 'prompt[negative_prompt]': '',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[face_swap]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0},1158:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-new-fine-tune-cc128107ac919832509e97a8ca45918b.png"},8167:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output1-aa799eba49b320b187e29cec267a3258.jpg"},6361:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output2-e44e20e05a5a6cffaba2d97ee9ac1947.jpg"},1250:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output3-b4745421562fc7a28a7be8eb46f4853e.jpg"},7432:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-output4-8e3f3c0ebd0449c2adf1d12015229097.jpg"},3257:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output1-8c5ea4967162c608b58d6b56dcb60cce.jpg"},6113:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output2-890a11d787c8827591af150362b1af05.jpg"},9814:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output3-92853d1bee638e8a6785ae5961ef96b8.jpg"},8497:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/faceid-portrait-output4-4d41c4f7de56b0befb40e69b89bc0190.jpg"},6973:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"}}]); \ No newline at end of file diff --git a/assets/js/76161ddb.1f6c53ce.js b/assets/js/76161ddb.1f6c53ce.js deleted file mode 100644 index 33bca321..00000000 --- a/assets/js/76161ddb.1f6c53ce.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1433],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>m});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var c=n.createContext({}),p=function(e){var t=n.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return n.createElement(c.Provider,{value:t},e.children)},o="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},A=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,c=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),o=p(a),A=r,m=o["".concat(c,".").concat(A)]||o[A]||d[A]||l;return a?n.createElement(m,i(i({ref:t},u),{},{components:a})):n.createElement(m,i({ref:t},u))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=A;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[o]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={tags:["upscaling","super-resolution","image enhancement","creative upscaler","clarity","magnific"]},i="Tiled upscale",s={unversionedId:"features/tiled-upscale",id:"features/tiled-upscale",title:"Tiled upscale",description:"BETA",source:"@site/docs/features/tiled-upscale.md",sourceDirName:"features",slug:"/features/tiled-upscale",permalink:"/docs/features/tiled-upscale",draft:!1,tags:[{label:"upscaling",permalink:"/docs/tags/upscaling"},{label:"super-resolution",permalink:"/docs/tags/super-resolution"},{label:"image enhancement",permalink:"/docs/tags/image-enhancement"},{label:"creative upscaler",permalink:"/docs/tags/creative-upscaler"},{label:"clarity",permalink:"/docs/tags/clarity"},{label:"magnific",permalink:"/docs/tags/magnific"}],version:"current",frontMatter:{tags:["upscaling","super-resolution","image enhancement","creative upscaler","clarity","magnific"]},sidebar:"tutorialSidebar",previous:{title:"Styles",permalink:"/docs/features/styles"},next:{title:"API",permalink:"/docs/category/api"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Tiled Upscale V2",id:"tiled-upscale-v2",level:2},{value:"Example",id:"example",level:2}],u={toc:p},o="wrapper";function d(e){let{components:t,...l}=e;return(0,r.kt)(o,(0,n.Z)({},u,l,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"tiled-upscale"},"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Super-Resolution"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Super resolution",src:a(780).Z,width:"2048",height:"3072"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"HiRes fix"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Hi-Res fix",src:a(3165).Z,width:"2048",height:"3072"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale V2"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale V2",src:a(2693).Z,width:"1672",height:"2504"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale",src:a(9693).Z,width:"1024",height:"1536"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Super-Resolution"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Super Resolution",src:a(1030).Z,width:"445",height:"428"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"HiRes fix"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"HiRes fix",src:a(5407).Z,width:"450",height:"425"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale v2"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale V2",src:a(7904).Z,width:"380",height:"362"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale",src:a(8115).Z,width:"232",height:"217"})))),(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://astria.ai/gallery?text=tiled_upscale"},"gallery"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Tiled upscale iterates over tiles of the image to upscale them individually while using Tile controlnet to remove blur, add details to the generated image, improve skin tones and give a more realistic look.\nSee example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=tiled_upscale"},"gallery")),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"To enable tiled upscale, add ",(0,r.kt)("inlineCode",{parentName:"p"},"--tiled_upscale_v2")," to the prompt text, or ",(0,r.kt)("inlineCode",{parentName:"p"},"--tiled_upscale")," for the legacy version.\nTiled upscale V2 requires Backend V1.\nCustomize parameters tiled upscale if needed with the following flags and the default values:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--hires_cfg_scale 5.5")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--resemblance 0.65"))),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost details."),(0,r.kt)("h2",{id:"tiled-upscale-v2"},"Tiled Upscale V2"),(0,r.kt)("p",null,"Tiled upscale V2 uses SDXL tile controlnet which better preserves identity and similarity while adding details and skin tones, and helps avoid the oversmoothing and painterly look of the original image."),(0,r.kt)("h2",{id:"example"},"Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"photograph of a woman, (smiling facial expression:1.1), textured skin, goosebumps, (blonde hair:1.2), (unbuttoned white shirt:1.2), distressed boyfriend jeans, long sleeves, (candlelight,chiaroscuro:1.1), cowboy shot, dark and mysterious cave with unique rock formations and hidden wonders, perfect eyes, Porta 160 color, shot on ARRI ALEXA 65, bokeh, sharp focus on subject, shot by Don McCullin --tiled_upscale_v2\nnum_images=2\nnegative_prompt=nude, nsfw, (CyberRealistic_Negative-neg:0.8), (deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation\nseed=43\nsteps=30\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=512\nh=768\n")))}d.isMDXComponent=!0},5407:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/hiresfix-1-detail-cb3dfa592dc81c3758b233b0b0852742.jpeg"},3165:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/hiresfix-1-e280a53d4326eab3aece7e4bdf04edec.jpeg"},1030:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/sr-1-detail-86c0e083e452548a5dcfab21fc127b21.jpeg"},780:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/sr-1-da25c1c7696cfedc9b739c41ca698428.jpeg"},8115:(e,t,a)=>{a.d(t,{Z:()=>n});const n="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA6KADAAQAAAABAAAA2QAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgA2QDoAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/dAAQAD//aAAwDAQACEQMRAD8A83CvIeKuw2hwNyn8RTLVORnNbEEg244/OuK7PRsVksNxGAP+AnmrUdq5XB+YDvjpT1lAwCBkVJ54znGDjrT5mPlESzwc4x7Z4NVbm1cfd4I6CtFLzC4OCPfmkaRHBBC/lRz2DkuYi3FxApjkXIP8QOCPeqc95NGfv7kz8p9a3JYkP8IJqhPZo2cA89atVEQ6bWxWg1SQ48uXa4/hJyD+Na1j4puIgEYgnPIJ4rAfT2VvkUE+lVmikjIJBz9Oab5WQuZM9MtPEsROJQVJGQD0/A1u2mpRXEe9TnHvXlVpdh4xFLnpwfetvS9Qa2lALHI4I9qynA6IVD0qC5R+QetWRLnjvXMWV78zDrtPp61sJc5289a55Kx0p3NiOYbcZPpVhHAUL6VkLcAHHJz3xVqObipuNo0BLjinh+OuKqpLnFOLkZBIxVXJLAlBPTBqRX7/ANaos4A5pyzdeaLha6NJZOKlWQEZJrN+0AAZNPS44yTirUiHE1A2RnipFf3rMW5zwG/KplmAHUVSkZOBo76cDmqSzjHUVMsy43ZFWpGbiPkXINU5o+CParDXKMPlIzUX2iKQ4JAbpipmk0VBtHLazanaTisP7Ma7HU4Q8R6Vi/ZTXm1IWkejTqJxP//Q4qJNuKlL4B4pdjJ2471DJJtzzkelcW56YPLg5BNAuvLX5nGD61QnuDnan546VChQt87DJ/vc1SiS5WNdNRizhUd/dF4qwl8zfKlq5PuwFZK3ttEXST7w6c8UW2uiF0fywSrfNxRyXJdSxt+fOFJNm/4EGoJNQRP9bbyx+uU4rR0/xbZ8rcRLkjAz9RXTW8uhaqgyE54xVezD2pwqXtpMcJIoPoae8EUo+bBPqK6HV/BtrNH5tt8pIzge9cZMt3pNwYpstGDjJpOFilJMufYowcAVNHEySqwIINNhnWRAwPXtTjIV5FRqNWRu2NyUY8jBPTNbttc7lBznP6VxtvcjjFbdlc8ferOaN6cjp4ZT361oQTYxn1rDtZN5BB+ta0IORkDaeawOjc0RJt55K+1PaTH0PSo41JXr9KSUMOCKCBr3A5HdetULnUPK2ruwTTLmXaSRx2NYtxIzSFuoAH68U0Jmrc6wI4d38Tcj8az5fEjBABIAv/oVYt20rttzwCV/CsufzDlFXB6f7q1rGK6mcpM35fGdxHynK9M/096hXx7fxuPlDD8elczKkijCoSR/Exz+XpVR1uD1Dtnjjitoxic8pSPQbfx3cTMASvqcZ4rTi8T3LnJK7T0IfmvKwLnaF5VB0HvV23inGHIlJHO0DGatqJKcj0+LxFIGBZWPPUf1q5/aqyqJAXVvRuAf/rVwlnd3bR7YopNncAY/Dnmta3S6MeXjdVP91sYrN2NYnTyawyxYPzL3B6//AF6r/wBsx/8APA1joTCuxl3huxOaduT/AJ96xklc2R//0cGe2dVO0ZGOh61i3CFc/Iy/rXYyQjBFZlzZEEgDOfXrXnwketOJxN5K4Xao2sD1wKz5JJ2JLnj1FdLqOnlW4U1mLphcnAANdKaOSUWZ0aPMRsXPGSxoiWSQl2LbT1AOM10+m2UWGjlGxunPeqX2M2MxtrhCu0nax4DA1d9NDJxa3KEcujrLGlx9rX5G3kMCQ2Rgj2xmt+60a2stIh1TSdfW6SbGYJMhw2DkfmKzm8PwXUyyIWLMcYBrQGiLYRAsduBnB5qlJWM2nck0rxrfWZ8q5HmIxAJccD/9VdDcDT/ENq0kTgtjgMOfr+NaXhTwbBd6NcvfwAx3GCoPBUeorjdX0268JanILV2a1Byp/u/X1pSWhrCetiiYZdNu2gkBAB+U9iKsGTdmtNLu28QWoVwEuVUbT61nXFrLauY5AQRx9axaOhMhSVkcdK3tPn3Y9a51uGBFbel5bFZzWhpTep11mfu7u9dJawkqOvtisPS4mYLwCK6+wt/l4yPUVyvc672QsUORgDnFJNbbQeTmtdLcbeR9DUFxbgrkDNOSsjJTuzlryDceeayWswrMc9RXQajtgBPSucuL0ZODxWepv0K720YPOKg8iDkBQSetRy3aknnis2bV443KKdzeijmtEpEOxpGKMnHlqfpQtuhONmR71nR3N5MNyQhT23nmr1vDqMzhN8CsRnkGtVGRnJxNGKxjKj90v5VpW+nxIN2xPxFZjafrMVr56NZyjIACuV5PbmoJNav9JcpqGnSwgHlhhl/OqcZLclOL2Opis4DxsOD6AVoR2EBIOwHI65rm9P1+2uwDHIuD6VtRX4JyW+mOlZOVi+S+xLcafblNqjBPcCqn9lL/AHn/ADrQ+0bh6570bx/dFTcfKz//0rPk7vSoprX257VfjG4ZBzjqKlaDenYj3ryE9T3nE5e+s884BIrOSGPcMgD1rrbiz3IcNjtWBd2LxyZQjjnFbxkc8oEBsgw+UgDPUcH8KkCPGNssInhzgpIN2B9PWokuZISN4Iq9Feoy8961U7Ecie4+ytdJYPM1k9synCCNzj646Vp6ZpukXpW4ZJZArlR5r4XIPU+x7VWhuI9nyvt74IyKmF4VG3IOSTwvc9atVCHQT1OtZrjyWgje3j2cEE5PQY6Vz2peH7y93yJJaSE84Oew6VGmoqVG5ATgY3deKli1by2KE5XIBz1X3/WqcmxKmo7HA6p4Xv8ARLmO4MZSFiD8nIBPPHpXR/Zo9R8NrPIR5sXGcdfrXSNqIuLdrWXMkBDcMv3fT/PauYidoYJbdAdpPf8ArQK9zmZrUgEHHHatHR4/nH1pbmLOTjrV7RYMy7sVhN6G1NanZ6RCcKa7SyhGwEr14BrndKiwE6DIHbrXXWaMqAcYrOnG7NK8rIn8pdn9cVQu8ID1/CtR8Y4NZF6cgjp71dVWRz0XdnE65M5dlHArk5CxJY4I969Cm0g3cuMHmsHxLY2eiacJWUSSuT5cfqaiFO50yqdDibgyzZUOYo+7Hr+FZ8l3Z2AIBBI6kfeqSeLUdSDSBfJROdjHBK+oH5Uz/hGw2hXt0EaS4iZWDE9Fzzx+NbwgYVKjRVXxHMxjEcbhw+Aw75NXB4k1W3uElEMwaJChIXOBnr/Ks+700yWLiIHOMjFZen6zqNhqCyRGUsrAup/iA7VpT5W9TnqTkldHoWkfEYNJbx38Q8uNyxO3nPrXX2msaXfhilwkc1w/RxkBfp+VeQaxJc6u7X1wkaTOANsabQD7fmKuXem6loRW605yysgLRt/DwM4qpJEwm92ejal4Lt7jNxYf6HddVMRzG59x2zWJa6pd6detp2rRtDOOAxHyv7isbQvHk9s8SvLKSp+bPVfXjvXW3N9pfi2y8mcgT4JilT+Ej09PpXPUpJrQ66VZp6lyC7JAweB+tT/bT6Vy2mXFzZXRsrwEunRuzD1Fbf2pPSuKSadjtTTVz//T07f5Rj15q8AQueKz4G5BGcCtOEg4B5x2zXjs+jSHi3Dg7sH8KrT6Wkgw0a89PlrVhXcvpzVpId3PSnG5MkjjrjQAzf6sj6cVRfw9h/lP6V6Cbb5QVOD6U37GJXOY8/3TWupi0jz7+xZE6M4qZNLkONzt+VdsbIMQenqMU3+zsJ90A9RVxuS0ckmlgDO9j7VaTT1BJXO4c4A4NdF9jRUIwuMZGRzVWR441JABzxg9RWvMkZuDZQliEdoeAGYdc8GuenTYCD941s3MvmE5JwB61kzkvk88dKhzuP2djMmAZcDGa1tFiIccfWqCJljn8Kv6bKEkC5Iz1qJbFwWp3emxgou7r2IrpLaTy1xgnNczpu51WROM8YrpLX5Rz+lKle4q6VtS8zFo8kEcVnSpv+tXZGyvB4qArlaupqznp6FQfu4WOPmPTHWsXVbKz1clbn5HB2owOAPoa3WQElcdR0xWRqVrKqgpxgcYP6VcHoN73OEuvDMMU7kX5lK/IGyMj/Cm22kzQMRBeq4ZSrRyH5XB689qtapbTBmlA6D5gO9Z1tebflbkd1aq50mX7PmRAvhu7txm3aOePsm75gPr3qE+H5xL5j2LKx9UJ/lW9GiXCyGKTyyVxxV9f7QQqRcuV/wNLmiRKi9jnrbwpN9thmkjaeFcFYo49u49sk+9XtU0u4vlWOYwW+5d/wA7ZJHTt71ux2dzPc7JJXCvGDy3GQf/AK1SSaUMASAbh178jv8ArVOa6EqkeSal4WdXLi5V3H8aAjNQ6fp+qWrKRuAGDvjX+Y716+ukCR9pTCkfMSvFWrfQIk2sUXcPTpis3UNPZJHn1uZ7sBroAhW+SUo3/wCsVd+zp/z8L/3y1d22jwoS8Sbc9cdDTP7P9v0rnbuzeLsj/9S/b5fGOp71q2+Dzxnuax7d+gzweOK14F+XGe1eOz6RGnDgrlTx3q7HGpKsc5XgVRtwoOwYJHoa04ccYAqoEz2LMaZU9zUvl/eyMGmxtwx6YFT5A+Y/xDiuqKVjjk3chaHjHoKilAVuAP6Zq0SC3NUbhyOuMe/anLRCjdszLqUBuevrWHdPwcjrWleuNxArDmcueTnB6VzOV2dKVkVZ2wmAfxqicuvX71W5hk9KrEhdoB/CqiSyNAOcZzin20Z3jPXOaFUJJ9atwQmWT5QDj2qpbBFanZaOxMSjGRgce9dVZdCpzx39a5PRYXCgenOK7K1UJF9aqgtTLFPQZOwB4zTFFPlGX56UgGB+lEtzBbDHTFNktxNHtxn2qfGaVV7VUBNnKX+lBg+V5Jz06VzN9oHmFyq7SOcqa9PuLVZgCMVkXGmkOWPA7ZqpRLp1Oh5obK9sz8q7x61bt9SmiO2RHUjiu2+wKWKspz2G3j60n9mx7fu5B6gYrBo6VIw4NTBCnb83+7zWlb3PmkZDDPqOa0YtNgBG1SvHRTgfkeKtxWvlk4XH+7x+lJRZMppFeCDJyUKj/aXrV9Y19RUiIRzx9MCpPqBmrUTnlO7KjwgA/wCFR+TV11GDUW2olHUtPQ//1bVpjZwcE1r2p6EnkelYVpIODke1bNu3qBn1ryGj6OJsQbc57nqa0oCBgZPtWTDIpwOpPer0co3gHr1pxYS1Rpq2Dz0qRWGwD0GKppKC2Ceaf5nXB+tdEZHNKBZd8AkVRuTgPkjjtUklyAADj27VQuLhT0Ix3yaJy0FGNjLvj3HOc1iTzKjkHGfWrl/cqgOD16Yrn3le4lGCcCsIrU1b6C3N1lzx9KqG6yc8ZParE1scL16VnKhN15eOhreOxjK9zVtYnnIbHX1rp9LtMEEgnI9OlU9NtxsU4GMZ6V0Nii5TaCQDyRWbZtFWRpabDtlA/P6Vvx7jn+6KzIIyAGXg/wBK1rdcruIINdFNWRx4h3ZCy/NmnEcU+VfmpimoktTNO6ExTl4agdKXOKcRMlTjj1oZFfqvPSkByM04EYrdGfmVXtxnj8qha0DdQK0Mc0ECk4Jlqo0Ulh+XpUyR4FTbM04R0uQTqXISuKac+lTkVC7YBqZKwJ3IZDwV6+9RbRUknK/WocVzyeptFaH/1qtpISAM4OeRW1b3GzbnPWuVtLgBgQa2beXcFDEY+teZJHvQkdLDNkZyKuxzdMsPrWHFMowoPJ7CrccynuazNbmuLgD5ieM9al+0kDlsqayRcbQeahkvAOn6U02hWRpS3mzPIA7YNZtzeBvWqUlyzHGTioHLYIYg+hp3E0rGdqd2wU1Fp53DJPWs/WpsSbc9TT7C5wBzW0VoYX1OilUNFnHUViWoVtQZj/exWnLcg2xwc8flXPwXarcEnruppWCbR3+n7fKAwAPSug0yAJ0GAa5HSrtX2nNdhp84Cjnistmav4dDetYcnk1oogHSsyzulYnBGK0BOvTPWuyElY8yspXGyjk1WH38VLNJu6dqjU554rOdmxxVkDMVpPOBpZBxWRPc+TIeelZuXKawhzG0rg07d7iseK+V/cVcS4Bxz+INaRqJilRaL6v3pd3eqokP1qVZK1UjFwJ1PfPWnZqEPTw/tVXRDiObmq7Cpd2RzUbkYNZz1KjoV3HBqLFSS1DmuVvU6Fsf/9flIJDgAHkVr28xGBjmufgY7h7VqW0pB7YHauCSPXhI6GKXOCcZ9c1djuFHVuO9YaTgEbRjPYUr3nlgbQaysbcxtS3ZVeOnrUCSPOeOlZ8EcknzyjjqFrRikwRtz9fSiw1ItJHtxn8ajnwE5pFmLEDnI9utEwLDIzQO+hxHiRnV9ycAHOKp2l+GjDZ6da2dYtvNBrkZbWWGQtGSPWuiOxyTdmdSupZjwehHrWdK7ByyHvWKXaQbZP0qE2zK2Y3ZT14NUlYnmbO80PU9rBWJ/Ou4stRyOpBx0rx3TL2RJlSf72eHHH4Eetdna6iUVSWxgVnOF9TenO2jPSba/IAbPTritmLUQyAk9a86stW8w7M9e9bJvPJt/MlkCIO5PWsveRrKMZHWJfq74z3q7HKDXlzeMbC2l2+dKee0Zx+ddDpXieG9x5b5Hrgimm1uZSpp7HayOChNczfShpWx1Bxj1rWikaWElRwaoXNvweP0onqhUkosx0uDGx+Yj29K1Le+yo/hNc/qKvES3Qe1R2WojdtJNYarU67J7nbRXO7BIq1HMCOtc9bXQbHXH1rSim75H0xW0KjZzVKa6Gssny08Nx1NUEm5H9KlVx71spnO6ZaMhBAwTSsxx1zUG/jrSF/ek5E8gkrdahz70SycE96h801jKSubRjof/9DioV/ekVrRwsAOMZ/WsyHHnEeh5roYoQyxnjOeK8+bsetDUnht2AJI7c01Y1j/AH0nLdga3Fth9iPByFrH1FTBEW5Hyisou7NZKwxrsgcd/QdKfFdhmByMgYx61zZ1KNnIDYPrVy3vEZl9e/vWvIzJT1Okjcs6noo4wTzUzknIPb3rOtplKjn7tX1KuuAcjr9KhmqM29hDgisG6tAc56iupa342npk4qnJab8k5qlKxEoXORlswM8daqmAq2BmuufTC2flqt/ZDu/Axir50RyM50QZ5P8AKtu0miaJUkLKw6kdDVt9KKJkrg/SoU045zilzopQZpadJbxOGZy2D90Dk10kSre8v8wUcL2A9q52201yuQtdPo9q2CGByKzlM1USFvDaXcgKRjBrf0TwrDbsJJBn27Vp2UAXBHUVswqdvcZqoLmInNxWhIsSrGFAAA6AVXnhBBz1q4o/So5hweM1q0rHPGTuczqenrKpyB09K4O+jm0y7O77jHhq9PuTkH+lc3q9hHewsjgYIwDjpXLLRnZBtoytP1JXRQDz/OuhtL5XGTkZ4z715xIs+j3hjkP7sn5XrobDUQ23pz+tTtsa8yeh3CzcAhiT61Ok3rzXP2118gwTnsM9a0IrjfjnDCnzkuBrCUeopu/APPWs8XCkHackHn608TggdvUUnMz9mWJJeOtRed71A8hI60zeahz1KSP/0eNT5bjHY102nHfGF/jB5965djsaNhjg10Wlz4Kr15rz5rQ9Wm9TsrVBLa47sM1n3VoJItjKPT61oac37sZOKluUDKxArni7M6JK55H4l0SWGR57fI78VysesXVrJhx0NezX1qkmUdcjFcB4h8K/elhHPpiu6nK6szkqU3uivp3icsMnPWt638SJnJb8a84WOSwudsqkKTg1tw2gmXdGeCM05QRMarWjO6j1+JgctU41dHPJFcNZ2skiEhjkHrmpZftVmc8sp71PskbxqndJqkf3WXjtWjZXdrKVDHHavPYLufCs6MAehxV6G8zxuwfY1LpI1U0z07+z7e5X7ysPapE8NqxBA471wdrqk6Y8uZseldBZ+JL2LGWLDJ5zmodLsaWvsdbbeHwo+YZx0NadrpCx9RXOWviqcrghc988VqQ+J5P4ox145qOS25DhU6HRxWmwdKtCPAFYlt4mjkGJIyDWpFqkMqgjIFbRaWxyThU6ossCBxUMmdvNP+0I3INRSSKQTilKSISaMy8Y7MjisKadRnccHvWxfSKoJ/SuS1K+WNuCAVrmlqdkHZEepW8V5G0MoByPlrnLVJrO5a1k6D7jeorSur7IgcHkHFGoQebbx3Q+/GwP4UovuUnqaNrO4yrA8da1oZtrcdD7VRtoRJFFIq4J6+9TxKEUlj8oGM+mKhs06E7XWJnQEe/171aSQuinPWsO0LSzSO3dsk+tbkS8A9u1ZjWxMc7OvTim7T/fqO/mFpYTTMQAiE1yv/CVJ/z0FaRjdESauf/S45hntWjp0m0rk9DWdnH4irFm2Hx2riauj04uzO702f5cZ5B9etackoyFJ5Ncvp04GMHBFbPnZCtXI46nUnoMuojnd0ANZ9zGrxMGyfStVzvRuazZ+VORz0Bram2mSzldT0K3v4nwPm71gWel3mlrcBlMkCHt1FdiW8uZhk4PU0+d4/KHcP8AeNdVyFTjNnOaAFuYuQVbeflIwfyrf1TTI5LLcAQRjIxS22mK8v7tenpSX2l3l2AsVzJsjbdsB+UkHvTUhPCy3Rq6Zo8bQKCoI96nu/CtrcKWEWD6jirOk3saqsFynky+/wB0/SuiwhiPIPGeDQZuMoPU82sfC08l5NGJWKI2BzXR2/gqZsbLhhn1Ga39LiiBaQfxOWrprby8dsUETqyi9DzW/wDDWpadGZRKsi9emKgsrXWpY9/khk7ZPNel6tEk9uY+PmwPwp9tbQx24VVHHFZuN2arENRuebSaheWUgjmhZWPTBzWjHrE8MYkeKZR9OK3rzToLjV0JAwgzj3pNcW2s9Lkbhdw2g/Ws+U0+svRGXH4s2RZyxHfANZ2p/E2304hJUkaRh8qqOTUbQGGxdYoi7rwoAzk1ylt4MvtVvDNc5Z5GyzEdP8KagnuEpN7ImvPihd3e4W1g+Txl2ArMS61zVblJZyI4uu1R1/Gu907wDb2agugZx04rSbRobfhFAXsMVE3GIlFs5OS3kBtoW5P3j+NdJHa+dYCLH3hUa2atel2UY6fhW7DbDZkAYGCMVzSdzaKsLYWgSFEOcgVBqURhhaJf+WhI49O9bMUeB6e1VLqPzrksRjbxUNFJ3ZQtLURqgAP/ANbtWokeOgIA9KIYwMYGKnYYzmhIGzlPHF2YNFMCn95OQB9K8w8q4/56Guu8W3Rv9fFrGcrANpA6Z71lf2cfSumKsjlnK7P/0+MVsnH5VKm4PjNVkIPIODVgE8H864rnpGxZzYwwOCeorajnJTr9K5i3fDDJ4rVhlJBH5VnJGkZG0k+U68jrVacgkjPJ5FVopfmwefepJmJUj8alGnQzbtCOR1qlHcYcK/Y1qSfOvHcVkXMHOQORW0WQm4u5q2twVJw2A4/StewnjFu6tkEnIPWuRhndMBuK2LS6V12k1R6FGpGWjOrtI4by5BZF2btuMcn1rTGhxvH/AKPO8QZiMZ4x2rmbKYq2VP3ulbUF4dqknjtz0q1JWHUouWwrafqWnyiNJ1deoyma04JdTgUFoo2JHU5FUhfNI2JG5XABz2rVi1OU2+CwZsc4/wA/SmrMxqUWlsU7hNTu3jJmESg5Cqn+NXo3vAmwlSRxnaatR6iWA+RSAe9Wlvk3KWQA9uafIu5hOL25Tnf7Guv7WOpLcTec4CkZO3A6cf1rUm0Y3vF1hgOVDdKvm9kIKqgHPWk3PIwJbJxUtJEa3vaxRi0S3GFUAMpyGB6VowWEEIKxxhe+MVNGpwO3tVgDH1qWzOU2UpYAR0rKvbfKkjPFbsq5rNuU3ZrkqIuEjnIoG83OMHNa8CdNox6io0h2yZwOasLwnSsbG97kvRTVcptJqXqopMZNMS0FRcLwetVNWvo9N02e5kbAjUkfXtVz7vJ6V5x451V9T1G30G1JYs6+bt9c/wCHP4VcI3ZE5WRlacjyQz6lMpLysSB6k1N9ql/54V1mmaMjiKJUzFENox/EfWtj+wY/+eIrZxOTnP/U4JH7HAq2jAjBNUl6CrEfT8K4T0mXVII/StCzkOMbicVmJ90VoQ96GOJe5WQHPvVpRuHHU1A3RPpVmL7prNmyIdjYIPPPWqs9uSDkY9DWh/y0akuPuihMqxhtBztYcetNFvJH80bVozfdH1pkf3Wq73J+F6EEN9c25BdDgdxWtb66hGH4z6is6X7q1A33D9adzeFeSN9NWjaQ4PU9q1YtQRlX5hyRXA/8vS/Stuz+6KLnTCq5bnWxX5wwDdMf1q7FeO4UAH65rl4u/wBa29O++PpRzMqTOkt5d8Qy+cmtGFMgHBrKsvv1uR/cFLmbPPqy6FhBgCnnpTF6U89KfQ43uRMOtVZkz7+9Wm61DJ0NZSNYszzGF6dKibBNTy9agPRvpWDOhMU8DHWmjPPFIP8AXTfQUP0/CgLmH4p1+LRNMaXIM7DEaj1ri/BWnTXupT6rccySNiPPcnq1M+JH/IStPoP510/gj/jxX/gX8xXVTSUbnJVk27HUErYW6xW67p2GABx9Kr+frH/PI/nUy/8AIYl/3T/I1YqkY7H/2Q=="},9693:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale-1-77589f81054986904af10fe067b3c4cf.jpeg"},7904:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale_v2-1-detail-96f797f76447b479a271f3f796bbc94c.jpeg"},2693:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale_v2-1-f7de0d054a93366994c69bf38b8c40d9.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/76161ddb.ce3d09d4.js b/assets/js/76161ddb.ce3d09d4.js new file mode 100644 index 00000000..31e47f4b --- /dev/null +++ b/assets/js/76161ddb.ce3d09d4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1433],{3905:(e,t,a)=>{a.d(t,{Zo:()=>u,kt:()=>m});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var c=n.createContext({}),p=function(e){var t=n.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=p(e.components);return n.createElement(c.Provider,{value:t},e.children)},o="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},A=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,c=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),o=p(a),A=r,m=o["".concat(c,".").concat(A)]||o[A]||d[A]||l;return a?n.createElement(m,i(i({ref:t},u),{},{components:a})):n.createElement(m,i({ref:t},u))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=A;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[o]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={tags:["upscaling","super-resolution","image enhancement","creative upscaler","clarity","magnific"],image:"./img/tiled-upscale/tiledupscale_v2-1.jpeg"},i="Tiled upscale",s={unversionedId:"features/tiled-upscale",id:"features/tiled-upscale",title:"Tiled upscale",description:"BETA",source:"@site/docs/features/tiled-upscale.md",sourceDirName:"features",slug:"/features/tiled-upscale",permalink:"/docs/features/tiled-upscale",draft:!1,tags:[{label:"upscaling",permalink:"/docs/tags/upscaling"},{label:"super-resolution",permalink:"/docs/tags/super-resolution"},{label:"image enhancement",permalink:"/docs/tags/image-enhancement"},{label:"creative upscaler",permalink:"/docs/tags/creative-upscaler"},{label:"clarity",permalink:"/docs/tags/clarity"},{label:"magnific",permalink:"/docs/tags/magnific"}],version:"current",frontMatter:{tags:["upscaling","super-resolution","image enhancement","creative upscaler","clarity","magnific"],image:"./img/tiled-upscale/tiledupscale_v2-1.jpeg"},sidebar:"tutorialSidebar",previous:{title:"Styles",permalink:"/docs/features/styles"},next:{title:"API",permalink:"/docs/category/api"}},c={image:a(2693).Z},p=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Tiled Upscale V2",id:"tiled-upscale-v2",level:2},{value:"Example",id:"example",level:2}],u={toc:p},o="wrapper";function d(e){let{components:t,...l}=e;return(0,r.kt)(o,(0,n.Z)({},u,l,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"tiled-upscale"},"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Super-Resolution"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Super resolution",src:a(780).Z,width:"2048",height:"3072"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"HiRes fix"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Hi-Res fix",src:a(3165).Z,width:"2048",height:"3072"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale V2"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale V2",src:a(2693).Z,width:"1672",height:"2504"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale",src:a(9693).Z,width:"1024",height:"1536"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Super-Resolution"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Super Resolution",src:a(1030).Z,width:"445",height:"428"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"HiRes fix"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"HiRes fix",src:a(5407).Z,width:"450",height:"425"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale v2"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale V2",src:a(7904).Z,width:"380",height:"362"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Tiled upscale"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Tiled upscale",src:a(8115).Z,width:"232",height:"217"})))),(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://astria.ai/gallery?text=tiled_upscale"},"gallery"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Tiled upscale iterates over tiles of the image to upscale them individually while using Tile controlnet to remove blur, add details to the generated image, improve skin tones and give a more realistic look.\nSee example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=tiled_upscale"},"gallery")),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("p",null,"To enable tiled upscale, add ",(0,r.kt)("inlineCode",{parentName:"p"},"--tiled_upscale_v2")," to the prompt text, or ",(0,r.kt)("inlineCode",{parentName:"p"},"--tiled_upscale")," for the legacy version.\nTiled upscale V2 requires Backend V1.\nCustomize parameters tiled upscale if needed with the following flags and the default values:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--hires_cfg_scale 5.5")),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("inlineCode",{parentName:"li"},"--resemblance 0.65"))),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost details."),(0,r.kt)("h2",{id:"tiled-upscale-v2"},"Tiled Upscale V2"),(0,r.kt)("p",null,"Tiled upscale V2 uses SDXL tile controlnet which better preserves identity and similarity while adding details and skin tones, and helps avoid the oversmoothing and painterly look of the original image."),(0,r.kt)("h2",{id:"example"},"Example"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"photograph of a woman, (smiling facial expression:1.1), textured skin, goosebumps, (blonde hair:1.2), (unbuttoned white shirt:1.2), distressed boyfriend jeans, long sleeves, (candlelight,chiaroscuro:1.1), cowboy shot, dark and mysterious cave with unique rock formations and hidden wonders, perfect eyes, Porta 160 color, shot on ARRI ALEXA 65, bokeh, sharp focus on subject, shot by Don McCullin --tiled_upscale_v2\nnum_images=2\nnegative_prompt=nude, nsfw, (CyberRealistic_Negative-neg:0.8), (deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation\nseed=43\nsteps=30\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=512\nh=768\n")))}d.isMDXComponent=!0},5407:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/hiresfix-1-detail-cb3dfa592dc81c3758b233b0b0852742.jpeg"},3165:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/hiresfix-1-e280a53d4326eab3aece7e4bdf04edec.jpeg"},1030:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/sr-1-detail-86c0e083e452548a5dcfab21fc127b21.jpeg"},780:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/sr-1-da25c1c7696cfedc9b739c41ca698428.jpeg"},8115:(e,t,a)=>{a.d(t,{Z:()=>n});const n="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA6KADAAQAAAABAAAA2QAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgA2QDoAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/dAAQAD//aAAwDAQACEQMRAD8A83CvIeKuw2hwNyn8RTLVORnNbEEg244/OuK7PRsVksNxGAP+AnmrUdq5XB+YDvjpT1lAwCBkVJ54znGDjrT5mPlESzwc4x7Z4NVbm1cfd4I6CtFLzC4OCPfmkaRHBBC/lRz2DkuYi3FxApjkXIP8QOCPeqc95NGfv7kz8p9a3JYkP8IJqhPZo2cA89atVEQ6bWxWg1SQ48uXa4/hJyD+Na1j4puIgEYgnPIJ4rAfT2VvkUE+lVmikjIJBz9Oab5WQuZM9MtPEsROJQVJGQD0/A1u2mpRXEe9TnHvXlVpdh4xFLnpwfetvS9Qa2lALHI4I9qynA6IVD0qC5R+QetWRLnjvXMWV78zDrtPp61sJc5289a55Kx0p3NiOYbcZPpVhHAUL6VkLcAHHJz3xVqObipuNo0BLjinh+OuKqpLnFOLkZBIxVXJLAlBPTBqRX7/ANaos4A5pyzdeaLha6NJZOKlWQEZJrN+0AAZNPS44yTirUiHE1A2RnipFf3rMW5zwG/KplmAHUVSkZOBo76cDmqSzjHUVMsy43ZFWpGbiPkXINU5o+CParDXKMPlIzUX2iKQ4JAbpipmk0VBtHLazanaTisP7Ma7HU4Q8R6Vi/ZTXm1IWkejTqJxP//Q4qJNuKlL4B4pdjJ2471DJJtzzkelcW56YPLg5BNAuvLX5nGD61QnuDnan546VChQt87DJ/vc1SiS5WNdNRizhUd/dF4qwl8zfKlq5PuwFZK3ttEXST7w6c8UW2uiF0fywSrfNxRyXJdSxt+fOFJNm/4EGoJNQRP9bbyx+uU4rR0/xbZ8rcRLkjAz9RXTW8uhaqgyE54xVezD2pwqXtpMcJIoPoae8EUo+bBPqK6HV/BtrNH5tt8pIzge9cZMt3pNwYpstGDjJpOFilJMufYowcAVNHEySqwIINNhnWRAwPXtTjIV5FRqNWRu2NyUY8jBPTNbttc7lBznP6VxtvcjjFbdlc8ferOaN6cjp4ZT361oQTYxn1rDtZN5BB+ta0IORkDaeawOjc0RJt55K+1PaTH0PSo41JXr9KSUMOCKCBr3A5HdetULnUPK2ruwTTLmXaSRx2NYtxIzSFuoAH68U0Jmrc6wI4d38Tcj8az5fEjBABIAv/oVYt20rttzwCV/CsufzDlFXB6f7q1rGK6mcpM35fGdxHynK9M/096hXx7fxuPlDD8elczKkijCoSR/Exz+XpVR1uD1Dtnjjitoxic8pSPQbfx3cTMASvqcZ4rTi8T3LnJK7T0IfmvKwLnaF5VB0HvV23inGHIlJHO0DGatqJKcj0+LxFIGBZWPPUf1q5/aqyqJAXVvRuAf/rVwlnd3bR7YopNncAY/Dnmta3S6MeXjdVP91sYrN2NYnTyawyxYPzL3B6//AF6r/wBsx/8APA1joTCuxl3huxOaduT/AJ96xklc2R//0cGe2dVO0ZGOh61i3CFc/Iy/rXYyQjBFZlzZEEgDOfXrXnwketOJxN5K4Xao2sD1wKz5JJ2JLnj1FdLqOnlW4U1mLphcnAANdKaOSUWZ0aPMRsXPGSxoiWSQl2LbT1AOM10+m2UWGjlGxunPeqX2M2MxtrhCu0nax4DA1d9NDJxa3KEcujrLGlx9rX5G3kMCQ2Rgj2xmt+60a2stIh1TSdfW6SbGYJMhw2DkfmKzm8PwXUyyIWLMcYBrQGiLYRAsduBnB5qlJWM2nck0rxrfWZ8q5HmIxAJccD/9VdDcDT/ENq0kTgtjgMOfr+NaXhTwbBd6NcvfwAx3GCoPBUeorjdX0268JanILV2a1Byp/u/X1pSWhrCetiiYZdNu2gkBAB+U9iKsGTdmtNLu28QWoVwEuVUbT61nXFrLauY5AQRx9axaOhMhSVkcdK3tPn3Y9a51uGBFbel5bFZzWhpTep11mfu7u9dJawkqOvtisPS4mYLwCK6+wt/l4yPUVyvc672QsUORgDnFJNbbQeTmtdLcbeR9DUFxbgrkDNOSsjJTuzlryDceeayWswrMc9RXQajtgBPSucuL0ZODxWepv0K720YPOKg8iDkBQSetRy3aknnis2bV443KKdzeijmtEpEOxpGKMnHlqfpQtuhONmR71nR3N5MNyQhT23nmr1vDqMzhN8CsRnkGtVGRnJxNGKxjKj90v5VpW+nxIN2xPxFZjafrMVr56NZyjIACuV5PbmoJNav9JcpqGnSwgHlhhl/OqcZLclOL2Opis4DxsOD6AVoR2EBIOwHI65rm9P1+2uwDHIuD6VtRX4JyW+mOlZOVi+S+xLcafblNqjBPcCqn9lL/AHn/ADrQ+0bh6570bx/dFTcfKz//0rPk7vSoprX257VfjG4ZBzjqKlaDenYj3ryE9T3nE5e+s884BIrOSGPcMgD1rrbiz3IcNjtWBd2LxyZQjjnFbxkc8oEBsgw+UgDPUcH8KkCPGNssInhzgpIN2B9PWokuZISN4Iq9Feoy8961U7Ecie4+ytdJYPM1k9synCCNzj646Vp6ZpukXpW4ZJZArlR5r4XIPU+x7VWhuI9nyvt74IyKmF4VG3IOSTwvc9atVCHQT1OtZrjyWgje3j2cEE5PQY6Vz2peH7y93yJJaSE84Oew6VGmoqVG5ATgY3deKli1by2KE5XIBz1X3/WqcmxKmo7HA6p4Xv8ARLmO4MZSFiD8nIBPPHpXR/Zo9R8NrPIR5sXGcdfrXSNqIuLdrWXMkBDcMv3fT/PauYidoYJbdAdpPf8ArQK9zmZrUgEHHHatHR4/nH1pbmLOTjrV7RYMy7sVhN6G1NanZ6RCcKa7SyhGwEr14BrndKiwE6DIHbrXXWaMqAcYrOnG7NK8rIn8pdn9cVQu8ID1/CtR8Y4NZF6cgjp71dVWRz0XdnE65M5dlHArk5CxJY4I969Cm0g3cuMHmsHxLY2eiacJWUSSuT5cfqaiFO50yqdDibgyzZUOYo+7Hr+FZ8l3Z2AIBBI6kfeqSeLUdSDSBfJROdjHBK+oH5Uz/hGw2hXt0EaS4iZWDE9Fzzx+NbwgYVKjRVXxHMxjEcbhw+Aw75NXB4k1W3uElEMwaJChIXOBnr/Ks+700yWLiIHOMjFZen6zqNhqCyRGUsrAup/iA7VpT5W9TnqTkldHoWkfEYNJbx38Q8uNyxO3nPrXX2msaXfhilwkc1w/RxkBfp+VeQaxJc6u7X1wkaTOANsabQD7fmKuXem6loRW605yysgLRt/DwM4qpJEwm92ejal4Lt7jNxYf6HddVMRzG59x2zWJa6pd6detp2rRtDOOAxHyv7isbQvHk9s8SvLKSp+bPVfXjvXW3N9pfi2y8mcgT4JilT+Ej09PpXPUpJrQ66VZp6lyC7JAweB+tT/bT6Vy2mXFzZXRsrwEunRuzD1Fbf2pPSuKSadjtTTVz//T07f5Rj15q8AQueKz4G5BGcCtOEg4B5x2zXjs+jSHi3Dg7sH8KrT6Wkgw0a89PlrVhXcvpzVpId3PSnG5MkjjrjQAzf6sj6cVRfw9h/lP6V6Cbb5QVOD6U37GJXOY8/3TWupi0jz7+xZE6M4qZNLkONzt+VdsbIMQenqMU3+zsJ90A9RVxuS0ckmlgDO9j7VaTT1BJXO4c4A4NdF9jRUIwuMZGRzVWR441JABzxg9RWvMkZuDZQliEdoeAGYdc8GuenTYCD941s3MvmE5JwB61kzkvk88dKhzuP2djMmAZcDGa1tFiIccfWqCJljn8Kv6bKEkC5Iz1qJbFwWp3emxgou7r2IrpLaTy1xgnNczpu51WROM8YrpLX5Rz+lKle4q6VtS8zFo8kEcVnSpv+tXZGyvB4qArlaupqznp6FQfu4WOPmPTHWsXVbKz1clbn5HB2owOAPoa3WQElcdR0xWRqVrKqgpxgcYP6VcHoN73OEuvDMMU7kX5lK/IGyMj/Cm22kzQMRBeq4ZSrRyH5XB689qtapbTBmlA6D5gO9Z1tebflbkd1aq50mX7PmRAvhu7txm3aOePsm75gPr3qE+H5xL5j2LKx9UJ/lW9GiXCyGKTyyVxxV9f7QQqRcuV/wNLmiRKi9jnrbwpN9thmkjaeFcFYo49u49sk+9XtU0u4vlWOYwW+5d/wA7ZJHTt71ux2dzPc7JJXCvGDy3GQf/AK1SSaUMASAbh178jv8ArVOa6EqkeSal4WdXLi5V3H8aAjNQ6fp+qWrKRuAGDvjX+Y716+ukCR9pTCkfMSvFWrfQIk2sUXcPTpis3UNPZJHn1uZ7sBroAhW+SUo3/wCsVd+zp/z8L/3y1d22jwoS8Sbc9cdDTP7P9v0rnbuzeLsj/9S/b5fGOp71q2+Dzxnuax7d+gzweOK14F+XGe1eOz6RGnDgrlTx3q7HGpKsc5XgVRtwoOwYJHoa04ccYAqoEz2LMaZU9zUvl/eyMGmxtwx6YFT5A+Y/xDiuqKVjjk3chaHjHoKilAVuAP6Zq0SC3NUbhyOuMe/anLRCjdszLqUBuevrWHdPwcjrWleuNxArDmcueTnB6VzOV2dKVkVZ2wmAfxqicuvX71W5hk9KrEhdoB/CqiSyNAOcZzin20Z3jPXOaFUJJ9atwQmWT5QDj2qpbBFanZaOxMSjGRgce9dVZdCpzx39a5PRYXCgenOK7K1UJF9aqgtTLFPQZOwB4zTFFPlGX56UgGB+lEtzBbDHTFNktxNHtxn2qfGaVV7VUBNnKX+lBg+V5Jz06VzN9oHmFyq7SOcqa9PuLVZgCMVkXGmkOWPA7ZqpRLp1Oh5obK9sz8q7x61bt9SmiO2RHUjiu2+wKWKspz2G3j60n9mx7fu5B6gYrBo6VIw4NTBCnb83+7zWlb3PmkZDDPqOa0YtNgBG1SvHRTgfkeKtxWvlk4XH+7x+lJRZMppFeCDJyUKj/aXrV9Y19RUiIRzx9MCpPqBmrUTnlO7KjwgA/wCFR+TV11GDUW2olHUtPQ//1bVpjZwcE1r2p6EnkelYVpIODke1bNu3qBn1ryGj6OJsQbc57nqa0oCBgZPtWTDIpwOpPer0co3gHr1pxYS1Rpq2Dz0qRWGwD0GKppKC2Ceaf5nXB+tdEZHNKBZd8AkVRuTgPkjjtUklyAADj27VQuLhT0Ix3yaJy0FGNjLvj3HOc1iTzKjkHGfWrl/cqgOD16Yrn3le4lGCcCsIrU1b6C3N1lzx9KqG6yc8ZParE1scL16VnKhN15eOhreOxjK9zVtYnnIbHX1rp9LtMEEgnI9OlU9NtxsU4GMZ6V0Nii5TaCQDyRWbZtFWRpabDtlA/P6Vvx7jn+6KzIIyAGXg/wBK1rdcruIINdFNWRx4h3ZCy/NmnEcU+VfmpimoktTNO6ExTl4agdKXOKcRMlTjj1oZFfqvPSkByM04EYrdGfmVXtxnj8qha0DdQK0Mc0ECk4Jlqo0Ulh+XpUyR4FTbM04R0uQTqXISuKac+lTkVC7YBqZKwJ3IZDwV6+9RbRUknK/WocVzyeptFaH/1qtpISAM4OeRW1b3GzbnPWuVtLgBgQa2beXcFDEY+teZJHvQkdLDNkZyKuxzdMsPrWHFMowoPJ7CrccynuazNbmuLgD5ieM9al+0kDlsqayRcbQeahkvAOn6U02hWRpS3mzPIA7YNZtzeBvWqUlyzHGTioHLYIYg+hp3E0rGdqd2wU1Fp53DJPWs/WpsSbc9TT7C5wBzW0VoYX1OilUNFnHUViWoVtQZj/exWnLcg2xwc8flXPwXarcEnruppWCbR3+n7fKAwAPSug0yAJ0GAa5HSrtX2nNdhp84Cjnistmav4dDetYcnk1oogHSsyzulYnBGK0BOvTPWuyElY8yspXGyjk1WH38VLNJu6dqjU554rOdmxxVkDMVpPOBpZBxWRPc+TIeelZuXKawhzG0rg07d7iseK+V/cVcS4Bxz+INaRqJilRaL6v3pd3eqokP1qVZK1UjFwJ1PfPWnZqEPTw/tVXRDiObmq7Cpd2RzUbkYNZz1KjoV3HBqLFSS1DmuVvU6Fsf/9flIJDgAHkVr28xGBjmufgY7h7VqW0pB7YHauCSPXhI6GKXOCcZ9c1djuFHVuO9YaTgEbRjPYUr3nlgbQaysbcxtS3ZVeOnrUCSPOeOlZ8EcknzyjjqFrRikwRtz9fSiw1ItJHtxn8ajnwE5pFmLEDnI9utEwLDIzQO+hxHiRnV9ycAHOKp2l+GjDZ6da2dYtvNBrkZbWWGQtGSPWuiOxyTdmdSupZjwehHrWdK7ByyHvWKXaQbZP0qE2zK2Y3ZT14NUlYnmbO80PU9rBWJ/Ou4stRyOpBx0rx3TL2RJlSf72eHHH4Eetdna6iUVSWxgVnOF9TenO2jPSba/IAbPTritmLUQyAk9a86stW8w7M9e9bJvPJt/MlkCIO5PWsveRrKMZHWJfq74z3q7HKDXlzeMbC2l2+dKee0Zx+ddDpXieG9x5b5Hrgimm1uZSpp7HayOChNczfShpWx1Bxj1rWikaWElRwaoXNvweP0onqhUkosx0uDGx+Yj29K1Le+yo/hNc/qKvES3Qe1R2WojdtJNYarU67J7nbRXO7BIq1HMCOtc9bXQbHXH1rSim75H0xW0KjZzVKa6Gssny08Nx1NUEm5H9KlVx71spnO6ZaMhBAwTSsxx1zUG/jrSF/ek5E8gkrdahz70SycE96h801jKSubRjof/9DioV/ekVrRwsAOMZ/WsyHHnEeh5roYoQyxnjOeK8+bsetDUnht2AJI7c01Y1j/AH0nLdga3Fth9iPByFrH1FTBEW5Hyisou7NZKwxrsgcd/QdKfFdhmByMgYx61zZ1KNnIDYPrVy3vEZl9e/vWvIzJT1Okjcs6noo4wTzUzknIPb3rOtplKjn7tX1KuuAcjr9KhmqM29hDgisG6tAc56iupa342npk4qnJab8k5qlKxEoXORlswM8daqmAq2BmuufTC2flqt/ZDu/Axir50RyM50QZ5P8AKtu0miaJUkLKw6kdDVt9KKJkrg/SoU045zilzopQZpadJbxOGZy2D90Dk10kSre8v8wUcL2A9q52201yuQtdPo9q2CGByKzlM1USFvDaXcgKRjBrf0TwrDbsJJBn27Vp2UAXBHUVswqdvcZqoLmInNxWhIsSrGFAAA6AVXnhBBz1q4o/So5hweM1q0rHPGTuczqenrKpyB09K4O+jm0y7O77jHhq9PuTkH+lc3q9hHewsjgYIwDjpXLLRnZBtoytP1JXRQDz/OuhtL5XGTkZ4z715xIs+j3hjkP7sn5XrobDUQ23pz+tTtsa8yeh3CzcAhiT61Ok3rzXP2118gwTnsM9a0IrjfjnDCnzkuBrCUeopu/APPWs8XCkHackHn608TggdvUUnMz9mWJJeOtRed71A8hI60zeahz1KSP/0eNT5bjHY102nHfGF/jB5965djsaNhjg10Wlz4Kr15rz5rQ9Wm9TsrVBLa47sM1n3VoJItjKPT61oac37sZOKluUDKxArni7M6JK55H4l0SWGR57fI78VysesXVrJhx0NezX1qkmUdcjFcB4h8K/elhHPpiu6nK6szkqU3uivp3icsMnPWt638SJnJb8a84WOSwudsqkKTg1tw2gmXdGeCM05QRMarWjO6j1+JgctU41dHPJFcNZ2skiEhjkHrmpZftVmc8sp71PskbxqndJqkf3WXjtWjZXdrKVDHHavPYLufCs6MAehxV6G8zxuwfY1LpI1U0z07+z7e5X7ysPapE8NqxBA471wdrqk6Y8uZseldBZ+JL2LGWLDJ5zmodLsaWvsdbbeHwo+YZx0NadrpCx9RXOWviqcrghc988VqQ+J5P4ox145qOS25DhU6HRxWmwdKtCPAFYlt4mjkGJIyDWpFqkMqgjIFbRaWxyThU6ossCBxUMmdvNP+0I3INRSSKQTilKSISaMy8Y7MjisKadRnccHvWxfSKoJ/SuS1K+WNuCAVrmlqdkHZEepW8V5G0MoByPlrnLVJrO5a1k6D7jeorSur7IgcHkHFGoQebbx3Q+/GwP4UovuUnqaNrO4yrA8da1oZtrcdD7VRtoRJFFIq4J6+9TxKEUlj8oGM+mKhs06E7XWJnQEe/171aSQuinPWsO0LSzSO3dsk+tbkS8A9u1ZjWxMc7OvTim7T/fqO/mFpYTTMQAiE1yv/CVJ/z0FaRjdESauf/S45hntWjp0m0rk9DWdnH4irFm2Hx2riauj04uzO702f5cZ5B9etackoyFJ5Ncvp04GMHBFbPnZCtXI46nUnoMuojnd0ANZ9zGrxMGyfStVzvRuazZ+VORz0Bram2mSzldT0K3v4nwPm71gWel3mlrcBlMkCHt1FdiW8uZhk4PU0+d4/KHcP8AeNdVyFTjNnOaAFuYuQVbeflIwfyrf1TTI5LLcAQRjIxS22mK8v7tenpSX2l3l2AsVzJsjbdsB+UkHvTUhPCy3Rq6Zo8bQKCoI96nu/CtrcKWEWD6jirOk3saqsFynky+/wB0/SuiwhiPIPGeDQZuMoPU82sfC08l5NGJWKI2BzXR2/gqZsbLhhn1Ga39LiiBaQfxOWrprby8dsUETqyi9DzW/wDDWpadGZRKsi9emKgsrXWpY9/khk7ZPNel6tEk9uY+PmwPwp9tbQx24VVHHFZuN2arENRuebSaheWUgjmhZWPTBzWjHrE8MYkeKZR9OK3rzToLjV0JAwgzj3pNcW2s9Lkbhdw2g/Ws+U0+svRGXH4s2RZyxHfANZ2p/E2304hJUkaRh8qqOTUbQGGxdYoi7rwoAzk1ylt4MvtVvDNc5Z5GyzEdP8KagnuEpN7ImvPihd3e4W1g+Txl2ArMS61zVblJZyI4uu1R1/Gu907wDb2agugZx04rSbRobfhFAXsMVE3GIlFs5OS3kBtoW5P3j+NdJHa+dYCLH3hUa2atel2UY6fhW7DbDZkAYGCMVzSdzaKsLYWgSFEOcgVBqURhhaJf+WhI49O9bMUeB6e1VLqPzrksRjbxUNFJ3ZQtLURqgAP/ANbtWokeOgIA9KIYwMYGKnYYzmhIGzlPHF2YNFMCn95OQB9K8w8q4/56Guu8W3Rv9fFrGcrANpA6Z71lf2cfSumKsjlnK7P/0+MVsnH5VKm4PjNVkIPIODVgE8H864rnpGxZzYwwOCeorajnJTr9K5i3fDDJ4rVhlJBH5VnJGkZG0k+U68jrVacgkjPJ5FVopfmwefepJmJUj8alGnQzbtCOR1qlHcYcK/Y1qSfOvHcVkXMHOQORW0WQm4u5q2twVJw2A4/StewnjFu6tkEnIPWuRhndMBuK2LS6V12k1R6FGpGWjOrtI4by5BZF2btuMcn1rTGhxvH/AKPO8QZiMZ4x2rmbKYq2VP3ulbUF4dqknjtz0q1JWHUouWwrafqWnyiNJ1deoyma04JdTgUFoo2JHU5FUhfNI2JG5XABz2rVi1OU2+CwZsc4/wA/SmrMxqUWlsU7hNTu3jJmESg5Cqn+NXo3vAmwlSRxnaatR6iWA+RSAe9Wlvk3KWQA9uafIu5hOL25Tnf7Guv7WOpLcTec4CkZO3A6cf1rUm0Y3vF1hgOVDdKvm9kIKqgHPWk3PIwJbJxUtJEa3vaxRi0S3GFUAMpyGB6VowWEEIKxxhe+MVNGpwO3tVgDH1qWzOU2UpYAR0rKvbfKkjPFbsq5rNuU3ZrkqIuEjnIoG83OMHNa8CdNox6io0h2yZwOasLwnSsbG97kvRTVcptJqXqopMZNMS0FRcLwetVNWvo9N02e5kbAjUkfXtVz7vJ6V5x451V9T1G30G1JYs6+bt9c/wCHP4VcI3ZE5WRlacjyQz6lMpLysSB6k1N9ql/54V1mmaMjiKJUzFENox/EfWtj+wY/+eIrZxOTnP/U4JH7HAq2jAjBNUl6CrEfT8K4T0mXVII/StCzkOMbicVmJ90VoQ96GOJe5WQHPvVpRuHHU1A3RPpVmL7prNmyIdjYIPPPWqs9uSDkY9DWh/y0akuPuihMqxhtBztYcetNFvJH80bVozfdH1pkf3Wq73J+F6EEN9c25BdDgdxWtb66hGH4z6is6X7q1A33D9adzeFeSN9NWjaQ4PU9q1YtQRlX5hyRXA/8vS/Stuz+6KLnTCq5bnWxX5wwDdMf1q7FeO4UAH65rl4u/wBa29O++PpRzMqTOkt5d8Qy+cmtGFMgHBrKsvv1uR/cFLmbPPqy6FhBgCnnpTF6U89KfQ43uRMOtVZkz7+9Wm61DJ0NZSNYszzGF6dKibBNTy9agPRvpWDOhMU8DHWmjPPFIP8AXTfQUP0/CgLmH4p1+LRNMaXIM7DEaj1ri/BWnTXupT6rccySNiPPcnq1M+JH/IStPoP510/gj/jxX/gX8xXVTSUbnJVk27HUErYW6xW67p2GABx9Kr+frH/PI/nUy/8AIYl/3T/I1YqkY7H/2Q=="},9693:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale-1-77589f81054986904af10fe067b3c4cf.jpeg"},7904:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale_v2-1-detail-96f797f76447b479a271f3f796bbc94c.jpeg"},2693:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/tiledupscale_v2-1-f7de0d054a93366994c69bf38b8c40d9.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.ec10fb9a.js b/assets/js/935f2afb.8b7a9b1a.js similarity index 92% rename from assets/js/935f2afb.ec10fb9a.js rename to assets/js/935f2afb.8b7a9b1a.js index 7aaef7b7..9e542224 100644 --- a/assets/js/935f2afb.ec10fb9a.js +++ b/assets/js/935f2afb.8b7a9b1a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Changes","href":"/docs/changes","docId":"changes"},{"type":"category","label":"Use cases","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"AI Photoshoot - fine-tuning for professional headshots","href":"/docs/use-cases/ai-photoshoot","docId":"use-cases/ai-photoshoot"},{"type":"link","label":"Fine-tuning guide","href":"/docs/use-cases/finetuning-guide","docId":"use-cases/finetuning-guide"},{"type":"link","label":"Flux training","href":"/docs/use-cases/flux-finetuning","docId":"use-cases/flux-finetuning"},{"type":"link","label":"SDXL training","href":"/docs/use-cases/sdxl-training","docId":"use-cases/sdxl-training"},{"type":"link","label":"Controlnet","href":"/docs/use-cases/controlnet","docId":"use-cases/controlnet"},{"type":"link","label":"Inpainting and masking","href":"/docs/use-cases/inpainting-and-masking","docId":"use-cases/inpainting-and-masking"},{"type":"link","label":"Virtual Try-on for Flux","href":"/docs/use-cases/virtual-try-on","docId":"use-cases/virtual-try-on"},{"type":"link","label":"Product placement","href":"/docs/use-cases/product-shots","docId":"use-cases/product-shots"},{"type":"link","label":"Toonify","href":"/docs/use-cases/toonify","docId":"use-cases/toonify"},{"type":"link","label":"Video Generation","href":"/docs/use-cases/video-generation","docId":"use-cases/video-generation"},{"type":"link","label":"FAQ","href":"/docs/use-cases/faq","docId":"use-cases/faq"},{"type":"link","label":"Masked portraits","href":"/docs/use-cases/masked-portraits","docId":"use-cases/masked-portraits"},{"type":"link","label":"AI Interior Design","href":"/docs/use-cases/room-redesign","docId":"use-cases/room-redesign"},{"type":"link","label":"Upscale","href":"/docs/use-cases/upscale","docId":"use-cases/upscale"}],"href":"/docs/category/use-cases"},{"type":"category","label":"Features","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Backend V1","href":"/docs/features/backend-v1","docId":"features/backend-v1"},{"type":"link","label":"Face Inpainting","href":"/docs/features/face-inpainting","docId":"features/face-inpainting"},{"type":"link","label":"Face Swap","href":"/docs/features/face-swap","docId":"features/face-swap"},{"type":"link","label":"FaceID for Flux","href":"/docs/features/faceid-flux","docId":"features/faceid-flux"},{"type":"link","label":"FaceID","href":"/docs/features/faceid","docId":"features/faceid"},{"type":"link","label":"Latent Consistency Models","href":"/docs/features/lcm","docId":"features/lcm"},{"type":"link","label":"LoRA","href":"/docs/features/lora","docId":"features/lora"},{"type":"link","label":"Multi-Person","href":"/docs/features/multiperson","docId":"features/multiperson"},{"type":"link","label":"Flux Outpainting","href":"/docs/features/outpainting","docId":"features/outpainting"},{"type":"link","label":"Prompt Masking","href":"/docs/features/prompt-masking","docId":"features/prompt-masking"},{"type":"link","label":"Styles","href":"/docs/features/styles","docId":"features/styles"},{"type":"link","label":"Tiled upscale","href":"/docs/features/tiled-upscale","docId":"features/tiled-upscale"}],"href":"/docs/category/features"},{"type":"category","label":"API","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Overview","href":"/docs/api/overview","docId":"api/overview"},{"type":"category","label":"Tunes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The tune object","href":"/docs/api/tune/","docId":"api/tune/tune"},{"type":"link","label":"Create a tune","href":"/docs/api/tune/create","docId":"api/tune/create"},{"type":"link","label":"Retrieve a tune","href":"/docs/api/tune/retrieve","docId":"api/tune/retrieve"},{"type":"link","label":"List all tunes","href":"/docs/api/tune/list","docId":"api/tune/list"},{"type":"link","label":"Delete a tune","href":"/docs/api/tune/delete","docId":"api/tune/delete"}],"href":"/docs/category/tunes"},{"type":"category","label":"Prompts","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The prompt object","href":"/docs/api/prompt/prompt","docId":"api/prompt/prompt"},{"type":"link","label":"Create a prompt","href":"/docs/api/prompt/create","docId":"api/prompt/create"},{"type":"link","label":"Retrieve a prompt","href":"/docs/api/prompt/retrieve","docId":"api/prompt/retrieve"},{"type":"link","label":"List all prompts","href":"/docs/api/prompt/list","docId":"api/prompt/list"},{"type":"link","label":"Delete a prompt","href":"/docs/api/prompt/delete","docId":"api/prompt/delete"}],"href":"/docs/category/prompts"},{"type":"category","label":"Packs","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The pack object","href":"/docs/api/pack/pack","docId":"api/pack/pack"},{"type":"link","label":"List all packs","href":"/docs/api/pack/list","docId":"api/pack/list"},{"type":"category","label":"Pack tunes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a tune from a pack","href":"/docs/api/pack/tunes/create","docId":"api/pack/tunes/create"}],"href":"/docs/category/pack-tunes"}],"href":"/docs/category/packs"},{"type":"category","label":"Likes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a like","href":"/docs/api/like/create","docId":"api/like/create"},{"type":"link","label":"Delete a like","href":"/docs/api/like/delete","docId":"api/like/delete"}],"href":"/docs/category/likes"},{"type":"category","label":"Images","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Inspect image","href":"/docs/api/images/inspect","docId":"api/images/inspect"}],"href":"/docs/category/images"},{"type":"link","label":"Flux API usage","href":"/docs/api/flux-api","docId":"api/flux-api"},{"type":"category","label":"Themes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a theme","href":"/docs/api/themes/create","docId":"api/themes/create"}],"href":"/docs/category/themes"},{"type":"link","label":"SDXL API usage","href":"/docs/api/sdxl-api","docId":"api/sdxl-api"}],"href":"/docs/category/api"},{"type":"category","label":"API links","items":[{"type":"link","label":"Headshots Opens-source app","href":"https://github.com/astriaai/headshots-starter"},{"type":"link","label":"Python SDK","href":"https://github.com/aronbrand/astriaclient"},{"type":"link","label":"Postman","href":"https://documenter.getpostman.com/view/273068/2s8YmSrfgD"},{"type":"link","label":"Bubble.io Plugin","href":"https://bubble.io/plugin/astria-api---stable-diffusion-1674501522435x732640117689417700"},{"type":"link","label":"API key","href":"https://www.astria.ai/users/edit#api"}],"collapsed":false,"collapsible":true}]},"docs":{"api/flux-api":{"id":"api/flux-api","title":"Flux API usage","description":"For an overview of Flux fine-tuning, see Flux fine-tuning","sidebar":"tutorialSidebar"},"api/images/inspect":{"id":"api/images/inspect","title":"Inspect image","description":"Inspects an image to extract attributes both for filtering/warning about bad training set images and as characteristics to be added to the fine tune.","sidebar":"tutorialSidebar"},"api/like/create":{"id":"api/like/create","title":"Create a like","description":"Adds a like to a prompt.","sidebar":"tutorialSidebar"},"api/like/delete":{"id":"api/like/delete","title":"Delete a like","description":"Delete a like from a prompt.","sidebar":"tutorialSidebar"},"api/overview":{"id":"api/overview","title":"Overview","description":"Billing","sidebar":"tutorialSidebar"},"api/pack/list":{"id":"api/pack/list","title":"List all packs","description":"Parameters","sidebar":"tutorialSidebar"},"api/pack/pack":{"id":"api/pack/pack","title":"The pack object","description":"A pack represents a list of grouped prompts, as well as the fine-tune to be created from the training images.","sidebar":"tutorialSidebar"},"api/pack/tunes/create":{"id":"api/pack/tunes/create","title":"Create a tune from a pack","description":"Creates a new fine-tune model from training images according to the pack base tune id, model type and adds prompts to generate images.","sidebar":"tutorialSidebar"},"api/prompt/create":{"id":"api/prompt/create","title":"Create a prompt","description":"Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.","sidebar":"tutorialSidebar"},"api/prompt/delete":{"id":"api/prompt/delete","title":"Delete a prompt","description":"Deletes a specific prompt associated with a tune.","sidebar":"tutorialSidebar"},"api/prompt/list":{"id":"api/prompt/list","title":"List all prompts","description":"Parameters","sidebar":"tutorialSidebar"},"api/prompt/prompt":{"id":"api/prompt/prompt","title":"The prompt object","description":"The prompt object is usually used as a nested resource of tune as prompts are generated using a fine-tune model. A prompt is a text that is used to generate images using a fine-tune model. The prompt object contains the generated images.","sidebar":"tutorialSidebar"},"api/prompt/retrieve":{"id":"api/prompt/retrieve","title":"Retrieve a prompt","description":"Parameters","sidebar":"tutorialSidebar"},"api/sdxl-api":{"id":"api/sdxl-api","title":"SDXL API usage","description":"For general tips on SDXL training and inference, see SDXL training","sidebar":"tutorialSidebar"},"api/themes/create":{"id":"api/themes/create","title":"Create a theme","description":"Themes API leverages a LLM (Large Language Models) to generate a variety of prompts based on a theme. The theme can be a short description of a concept, a mood, or a style. The API call will create 10 prompts which will start processing and generating images.","sidebar":"tutorialSidebar"},"api/tune/create":{"id":"api/tune/create","title":"Create a tune","description":"Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.","sidebar":"tutorialSidebar"},"api/tune/delete":{"id":"api/tune/delete","title":"Delete a tune","description":"Deletes a specific tune by its ID, and associated prompts in case of a checkpoint.","sidebar":"tutorialSidebar"},"api/tune/list":{"id":"api/tune/list","title":"List all tunes","description":"Parameters","sidebar":"tutorialSidebar"},"api/tune/retrieve":{"id":"api/tune/retrieve","title":"Retrieve a tune","description":"Parameters","sidebar":"tutorialSidebar"},"api/tune/tune":{"id":"api/tune/tune","title":"The tune object","description":"Tune (or Fine-tune) represents a model that is created using training images to learn a new concept or subject. At its core a fine-tune is a neural-network weights file (usually weights 2GB) and contains the information of the trained images.","sidebar":"tutorialSidebar"},"changes":{"id":"changes","title":"Changes","description":"* 2024-12-20 Outpainting syntax for extending image, creating more cinematic images or longer portraits with high quality faces.","sidebar":"tutorialSidebar"},"features/backend-v1":{"id":"features/backend-v1","title":"Backend V1","description":"BETA","sidebar":"tutorialSidebar"},"features/face-inpainting":{"id":"features/face-inpainting","title":"Face Inpainting","description":"Overview","sidebar":"tutorialSidebar"},"features/face-swap":{"id":"features/face-swap","title":"Face Swap","description":"Without face-swap","sidebar":"tutorialSidebar"},"features/faceid":{"id":"features/faceid","title":"FaceID","description":"BETA","sidebar":"tutorialSidebar"},"features/faceid-flux":{"id":"features/faceid-flux","title":"FaceID for Flux","description":"BETA","sidebar":"tutorialSidebar"},"features/lcm":{"id":"features/lcm","title":"Latent Consistency Models","description":"DPM SDE Karras 30 steps 15 seconds for 8 images","sidebar":"tutorialSidebar"},"features/lora":{"id":"features/lora","title":"LoRA","description":"LoRA","sidebar":"tutorialSidebar"},"features/multiperson":{"id":"features/multiperson","title":"Multi-Person","description":"BETA","sidebar":"tutorialSidebar"},"features/outpainting":{"id":"features/outpainting","title":"Flux Outpainting","description":"LoRA","sidebar":"tutorialSidebar"},"features/prompt-masking":{"id":"features/prompt-masking","title":"Prompt Masking","description":"Prompt masking uses a short text to create a mask from the input image. The mask can then be used to inpaint parts of the image. Use the below parameters as part of the prompts to use auto-masking","sidebar":"tutorialSidebar"},"features/styles":{"id":"features/styles","title":"Styles","description":"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.","sidebar":"tutorialSidebar"},"features/tiled-upscale":{"id":"features/tiled-upscale","title":"Tiled upscale","description":"BETA","sidebar":"tutorialSidebar"},"use-cases/ai-photoshoot":{"id":"use-cases/ai-photoshoot","title":"AI Photoshoot - fine-tuning for professional headshots","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/controlnet":{"id":"use-cases/controlnet","title":"Controlnet","description":"Preserve composition","sidebar":"tutorialSidebar"},"use-cases/faq":{"id":"use-cases/faq","title":"FAQ","description":"What image size should I upload? Is there a size limit to uploads?","sidebar":"tutorialSidebar"},"use-cases/finetuning-guide":{"id":"use-cases/finetuning-guide","title":"Fine-tuning guide","description":"The guide for high quality avatars and AI photography","sidebar":"tutorialSidebar"},"use-cases/flux-finetuning":{"id":"use-cases/flux-finetuning","title":"Flux training","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/inpainting-and-masking":{"id":"use-cases/inpainting-and-masking","title":"Inpainting and masking","description":"Input image","sidebar":"tutorialSidebar"},"use-cases/masked-portraits":{"id":"use-cases/masked-portraits","title":"Masked portraits","description":"BETA","sidebar":"tutorialSidebar"},"use-cases/product-shots":{"id":"use-cases/product-shots","title":"Product placement","description":"Background replacement","sidebar":"tutorialSidebar"},"use-cases/room-redesign":{"id":"use-cases/room-redesign","title":"AI Interior Design","description":"Backend V1","sidebar":"tutorialSidebar"},"use-cases/sdxl-training":{"id":"use-cases/sdxl-training","title":"SDXL training","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/toonify":{"id":"use-cases/toonify","title":"Toonify","description":"Input image","sidebar":"tutorialSidebar"},"use-cases/upscale":{"id":"use-cases/upscale","title":"Upscale","description":"BETA","sidebar":"tutorialSidebar"},"use-cases/video-generation":{"id":"use-cases/video-generation","title":"Video Generation","description":"Generate videos using text","sidebar":"tutorialSidebar"},"use-cases/virtual-try-on":{"id":"use-cases/virtual-try-on","title":"Virtual Try-on for Flux","description":"BETA. Flux + Backend V0 only feature.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2197],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Changes","href":"/docs/changes","docId":"changes"},{"type":"category","label":"Use cases","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"AI Photoshoot - fine-tuning for professional headshots","href":"/docs/use-cases/ai-photoshoot","docId":"use-cases/ai-photoshoot"},{"type":"link","label":"Fine-tuning guide","href":"/docs/use-cases/finetuning-guide","docId":"use-cases/finetuning-guide"},{"type":"link","label":"Flux training","href":"/docs/use-cases/flux-finetuning","docId":"use-cases/flux-finetuning"},{"type":"link","label":"SDXL training","href":"/docs/use-cases/sdxl-training","docId":"use-cases/sdxl-training"},{"type":"link","label":"Controlnet","href":"/docs/use-cases/controlnet","docId":"use-cases/controlnet"},{"type":"link","label":"Inpainting and masking","href":"/docs/use-cases/inpainting-and-masking","docId":"use-cases/inpainting-and-masking"},{"type":"link","label":"Virtual Try-on for Flux","href":"/docs/use-cases/virtual-try-on","docId":"use-cases/virtual-try-on"},{"type":"link","label":"Product placement","href":"/docs/use-cases/product-shots","docId":"use-cases/product-shots"},{"type":"link","label":"Toonify","href":"/docs/use-cases/toonify","docId":"use-cases/toonify"},{"type":"link","label":"Video Generation","href":"/docs/use-cases/video-generation","docId":"use-cases/video-generation"},{"type":"link","label":"FAQ","href":"/docs/use-cases/faq","docId":"use-cases/faq"},{"type":"link","label":"Masked portraits","href":"/docs/use-cases/masked-portraits","docId":"use-cases/masked-portraits"},{"type":"link","label":"AI Interior Design","href":"/docs/use-cases/room-redesign","docId":"use-cases/room-redesign"},{"type":"link","label":"Upscale","href":"/docs/use-cases/upscale","docId":"use-cases/upscale"}],"href":"/docs/category/use-cases"},{"type":"category","label":"Features","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Backend V1","href":"/docs/features/backend-v1","docId":"features/backend-v1"},{"type":"link","label":"Face Inpainting","href":"/docs/features/face-inpainting","docId":"features/face-inpainting"},{"type":"link","label":"Face Swap","href":"/docs/features/face-swap","docId":"features/face-swap"},{"type":"link","label":"FaceID for Flux","href":"/docs/features/faceid-flux","docId":"features/faceid-flux"},{"type":"link","label":"FaceID","href":"/docs/features/faceid","docId":"features/faceid"},{"type":"link","label":"Latent Consistency Models","href":"/docs/features/lcm","docId":"features/lcm"},{"type":"link","label":"LoRA","href":"/docs/features/lora","docId":"features/lora"},{"type":"link","label":"Multi-Person","href":"/docs/features/multiperson","docId":"features/multiperson"},{"type":"link","label":"Flux Outpainting","href":"/docs/features/outpainting","docId":"features/outpainting"},{"type":"link","label":"Prompt Masking","href":"/docs/features/prompt-masking","docId":"features/prompt-masking"},{"type":"link","label":"Styles","href":"/docs/features/styles","docId":"features/styles"},{"type":"link","label":"Tiled upscale","href":"/docs/features/tiled-upscale","docId":"features/tiled-upscale"}],"href":"/docs/category/features"},{"type":"category","label":"API","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Overview","href":"/docs/api/overview","docId":"api/overview"},{"type":"category","label":"Tunes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The tune object","href":"/docs/api/tune/","docId":"api/tune/tune"},{"type":"link","label":"Create a tune","href":"/docs/api/tune/create","docId":"api/tune/create"},{"type":"link","label":"Retrieve a tune","href":"/docs/api/tune/retrieve","docId":"api/tune/retrieve"},{"type":"link","label":"List all tunes","href":"/docs/api/tune/list","docId":"api/tune/list"},{"type":"link","label":"Delete a tune","href":"/docs/api/tune/delete","docId":"api/tune/delete"}],"href":"/docs/category/tunes"},{"type":"category","label":"Prompts","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The prompt object","href":"/docs/api/prompt/prompt","docId":"api/prompt/prompt"},{"type":"link","label":"Create a prompt","href":"/docs/api/prompt/create","docId":"api/prompt/create"},{"type":"link","label":"Retrieve a prompt","href":"/docs/api/prompt/retrieve","docId":"api/prompt/retrieve"},{"type":"link","label":"List all prompts","href":"/docs/api/prompt/list","docId":"api/prompt/list"},{"type":"link","label":"Delete a prompt","href":"/docs/api/prompt/delete","docId":"api/prompt/delete"}],"href":"/docs/category/prompts"},{"type":"category","label":"Packs","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"The pack object","href":"/docs/api/pack/pack","docId":"api/pack/pack"},{"type":"link","label":"List all packs","href":"/docs/api/pack/list","docId":"api/pack/list"},{"type":"category","label":"Pack tunes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a tune from a pack","href":"/docs/api/pack/tunes/create","docId":"api/pack/tunes/create"}],"href":"/docs/category/pack-tunes"}],"href":"/docs/category/packs"},{"type":"category","label":"Likes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a like","href":"/docs/api/like/create","docId":"api/like/create"},{"type":"link","label":"Delete a like","href":"/docs/api/like/delete","docId":"api/like/delete"}],"href":"/docs/category/likes"},{"type":"category","label":"Images","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Inspect image","href":"/docs/api/images/inspect","docId":"api/images/inspect"}],"href":"/docs/category/images"},{"type":"link","label":"Flux API usage","href":"/docs/api/flux-api","docId":"api/flux-api"},{"type":"category","label":"Themes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Create a theme","href":"/docs/api/themes/create","docId":"api/themes/create"}],"href":"/docs/category/themes"},{"type":"link","label":"SDXL API usage","href":"/docs/api/sdxl-api","docId":"api/sdxl-api"}],"href":"/docs/category/api"},{"type":"category","label":"API links","items":[{"type":"link","label":"Headshots Opens-source app","href":"https://github.com/astriaai/headshots-starter"},{"type":"link","label":"Python SDK","href":"https://github.com/aronbrand/astriaclient"},{"type":"link","label":"Postman","href":"https://documenter.getpostman.com/view/273068/2s8YmSrfgD"},{"type":"link","label":"Bubble.io Plugin","href":"https://bubble.io/plugin/astria-api---stable-diffusion-1674501522435x732640117689417700"},{"type":"link","label":"API key","href":"https://www.astria.ai/users/edit#api"}],"collapsed":false,"collapsible":true}]},"docs":{"api/flux-api":{"id":"api/flux-api","title":"Flux API usage","description":"For an overview of Flux fine-tuning, see Flux fine-tuning","sidebar":"tutorialSidebar"},"api/images/inspect":{"id":"api/images/inspect","title":"Inspect image","description":"Inspects an image to extract attributes both for filtering/warning about bad training set images and as characteristics to be added to the fine tune.","sidebar":"tutorialSidebar"},"api/like/create":{"id":"api/like/create","title":"Create a like","description":"Adds a like to a prompt.","sidebar":"tutorialSidebar"},"api/like/delete":{"id":"api/like/delete","title":"Delete a like","description":"Delete a like from a prompt.","sidebar":"tutorialSidebar"},"api/overview":{"id":"api/overview","title":"Overview","description":"Billing","sidebar":"tutorialSidebar"},"api/pack/list":{"id":"api/pack/list","title":"List all packs","description":"Parameters","sidebar":"tutorialSidebar"},"api/pack/pack":{"id":"api/pack/pack","title":"The pack object","description":"A pack represents a list of grouped prompts, as well as the fine-tune to be created from the training images.","sidebar":"tutorialSidebar"},"api/pack/tunes/create":{"id":"api/pack/tunes/create","title":"Create a tune from a pack","description":"Creates a new fine-tune model from training images according to the pack base tune id, model type and adds prompts to generate images.","sidebar":"tutorialSidebar"},"api/prompt/create":{"id":"api/prompt/create","title":"Create a prompt","description":"Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.","sidebar":"tutorialSidebar"},"api/prompt/delete":{"id":"api/prompt/delete","title":"Delete a prompt","description":"Deletes a specific prompt associated with a tune.","sidebar":"tutorialSidebar"},"api/prompt/list":{"id":"api/prompt/list","title":"List all prompts","description":"Parameters","sidebar":"tutorialSidebar"},"api/prompt/prompt":{"id":"api/prompt/prompt","title":"The prompt object","description":"The prompt object is usually used as a nested resource of tune as prompts are generated using a fine-tune model. A prompt is a text that is used to generate images using a fine-tune model. The prompt object contains the generated images.","sidebar":"tutorialSidebar"},"api/prompt/retrieve":{"id":"api/prompt/retrieve","title":"Retrieve a prompt","description":"Parameters","sidebar":"tutorialSidebar"},"api/sdxl-api":{"id":"api/sdxl-api","title":"SDXL API usage","description":"For general tips on SDXL training and inference, see SDXL training","sidebar":"tutorialSidebar"},"api/themes/create":{"id":"api/themes/create","title":"Create a theme","description":"Themes API leverages a LLM (Large Language Models) to generate a variety of prompts based on a theme. The theme can be a short description of a concept, a mood, or a style. The API call will create 10 prompts which will start processing and generating images.","sidebar":"tutorialSidebar"},"api/tune/create":{"id":"api/tune/create","title":"Create a tune","description":"Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.","sidebar":"tutorialSidebar"},"api/tune/delete":{"id":"api/tune/delete","title":"Delete a tune","description":"Deletes a specific tune by its ID, and associated prompts in case of a checkpoint.","sidebar":"tutorialSidebar"},"api/tune/list":{"id":"api/tune/list","title":"List all tunes","description":"Parameters","sidebar":"tutorialSidebar"},"api/tune/retrieve":{"id":"api/tune/retrieve","title":"Retrieve a tune","description":"Parameters","sidebar":"tutorialSidebar"},"api/tune/tune":{"id":"api/tune/tune","title":"The tune object","description":"Tune (or Fine-tune) represents a model that is created using training images to learn a new concept or subject. At its core a fine-tune is a neural-network weights file (usually weights 2GB) and contains the information of the trained images.","sidebar":"tutorialSidebar"},"changes":{"id":"changes","title":"Changes","description":"* 2024-12-20 Outpainting syntax for extending image, creating more cinematic images or longer portraits with high quality faces.","sidebar":"tutorialSidebar"},"features/backend-v1":{"id":"features/backend-v1","title":"Backend V1","description":"BETA","sidebar":"tutorialSidebar"},"features/face-inpainting":{"id":"features/face-inpainting","title":"Face Inpainting","description":"Overview","sidebar":"tutorialSidebar"},"features/face-swap":{"id":"features/face-swap","title":"Face Swap","description":"Without face-swap","sidebar":"tutorialSidebar"},"features/faceid":{"id":"features/faceid","title":"FaceID","description":"BETA","sidebar":"tutorialSidebar"},"features/faceid-flux":{"id":"features/faceid-flux","title":"FaceID for Flux","description":"BETA","sidebar":"tutorialSidebar"},"features/lcm":{"id":"features/lcm","title":"Latent Consistency Models","description":"DPM SDE Karras 30 steps 15 seconds for 8 images","sidebar":"tutorialSidebar"},"features/lora":{"id":"features/lora","title":"LoRA","description":"LoRA","sidebar":"tutorialSidebar"},"features/multiperson":{"id":"features/multiperson","title":"Multi-Person","description":"BETA","sidebar":"tutorialSidebar"},"features/outpainting":{"id":"features/outpainting","title":"Flux Outpainting","description":"LoRA","sidebar":"tutorialSidebar"},"features/prompt-masking":{"id":"features/prompt-masking","title":"Prompt Masking","description":"Prompt masking uses a short text to create a mask from the input image. The mask can then be used to inpaint parts of the image. Use the below parameters as part of the prompts to use auto-masking","sidebar":"tutorialSidebar"},"features/styles":{"id":"features/styles","title":"Styles","description":"Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.","sidebar":"tutorialSidebar"},"features/tiled-upscale":{"id":"features/tiled-upscale","title":"Tiled upscale","description":"BETA","sidebar":"tutorialSidebar"},"use-cases/ai-photoshoot":{"id":"use-cases/ai-photoshoot","title":"AI Photoshoot - fine-tuning for professional headshots","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/controlnet":{"id":"use-cases/controlnet","title":"Controlnet","description":"Preserve composition","sidebar":"tutorialSidebar"},"use-cases/faq":{"id":"use-cases/faq","title":"FAQ","description":"What image size should I upload? Is there a size limit to uploads?","sidebar":"tutorialSidebar"},"use-cases/finetuning-guide":{"id":"use-cases/finetuning-guide","title":"Fine-tuning guide","description":"The guide for high quality avatars and AI photography","sidebar":"tutorialSidebar"},"use-cases/flux-finetuning":{"id":"use-cases/flux-finetuning","title":"Flux training","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/inpainting-and-masking":{"id":"use-cases/inpainting-and-masking","title":"Inpainting and masking","description":"Input image","sidebar":"tutorialSidebar"},"use-cases/masked-portraits":{"id":"use-cases/masked-portraits","title":"Masked portraits","description":"Input image","sidebar":"tutorialSidebar"},"use-cases/product-shots":{"id":"use-cases/product-shots","title":"Product placement","description":"Background replacement","sidebar":"tutorialSidebar"},"use-cases/room-redesign":{"id":"use-cases/room-redesign","title":"AI Interior Design","description":"Backend V1","sidebar":"tutorialSidebar"},"use-cases/sdxl-training":{"id":"use-cases/sdxl-training","title":"SDXL training","description":"Overview","sidebar":"tutorialSidebar"},"use-cases/toonify":{"id":"use-cases/toonify","title":"Toonify","description":"Input image","sidebar":"tutorialSidebar"},"use-cases/upscale":{"id":"use-cases/upscale","title":"Upscale","description":"BETA","sidebar":"tutorialSidebar"},"use-cases/video-generation":{"id":"use-cases/video-generation","title":"Video Generation","description":"Generate videos using text","sidebar":"tutorialSidebar"},"use-cases/virtual-try-on":{"id":"use-cases/virtual-try-on","title":"Virtual Try-on for Flux","description":"BETA. Flux + Backend V0 only feature.","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/97179b4d.2aef21c2.js b/assets/js/97179b4d.2aef21c2.js deleted file mode 100644 index 409d93cc..00000000 --- a/assets/js/97179b4d.2aef21c2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[5139],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=u(n),m=r,h=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:r,i[1]=l;for(var u=2;u{n.d(t,{Z:()=>i});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:n,className:i}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,i),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>_});var a=n(7462),r=n(7294),o=n(6010),i=n(2466),l=n(6550),s=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,l.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[i,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[s,u]=h({queryString:n,groupId:a}),[c,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,p.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&l(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var g=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:n,selectedValue:l,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),d=e=>{const t=e.currentTarget,n=p.indexOf(t),a=u[n].value;a!==l&&(c(t),s(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:i}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},i,{className:(0,o.Z)("tabs__item",b.tabItem,i?.className,{"tabs__item--active":l===t})}),n??t)})))}function v(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function k(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(y,(0,a.Z)({},e,t)),r.createElement(v,(0,a.Z)({},e,t)))}function _(e){const t=(0,g.Z)();return r.createElement(k,(0,a.Z)({key:String(t)},e))}},3714:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>u,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),i=n(5162);const l={hide_table_of_contents:!0,tags:["flux","api","training","fine-tuning","lora"]},s="Flux API usage",u={unversionedId:"api/flux-api",id:"api/flux-api",title:"Flux API usage",description:"For an overview of Flux fine-tuning, see Flux fine-tuning",source:"@site/docs/api/05-flux-api.md",sourceDirName:"api",slug:"/api/flux-api",permalink:"/docs/api/flux-api",draft:!1,tags:[{label:"flux",permalink:"/docs/tags/flux"},{label:"api",permalink:"/docs/tags/api"},{label:"training",permalink:"/docs/tags/training"},{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"lora",permalink:"/docs/tags/lora"}],version:"current",sidebarPosition:5,frontMatter:{hide_table_of_contents:!0,tags:["flux","api","training","fine-tuning","lora"]},sidebar:"tutorialSidebar",previous:{title:"Inspect image",permalink:"/docs/api/images/inspect"},next:{title:"Themes",permalink:"/docs/category/themes"}},p={},c=[{value:"Step 1: Fine-tune a lora model",id:"step-1-fine-tune-a-lora-model",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Step 2: Generate images using the fine-tuned model",id:"step-2-generate-images-using-the-fine-tuned-model",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...n}=e;return(0,r.kt)(m,(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"flux-api-usage"},"Flux API usage"),(0,r.kt)("p",null,"For an overview of Flux fine-tuning, see ",(0,r.kt)("a",{parentName:"p",href:"/docs/use-cases/flux-finetuning/"},"Flux fine-tuning")),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Unlike SD15 checkpoint training, Flux is trained as a LoRA model type. As such, inference is taking place on a base model such as Flux1.dev and ",(0,r.kt)("inlineCode",{parentName:"li"},"prompt.text")," should specify the loaded lora such as ",(0,r.kt)("inlineCode",{parentName:"li"},"")," - will load lora with id=123456 and strength=1"),(0,r.kt)("li",{parentName:"ul"},"Flux1.Dev requires commercial license which Astria provides to its customers, and as such LoRA downloading is not available for API usage.")),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/lora"},"LoRA docs")," on lora syntax"),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"To avoid cloning inference details of different model types such as Flux LoRA vs SD1.5 checkpoint, please consider using the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/pack/pack/"},"Packs API"),". Packs will help you abstract the inference logic so that you do not have to hard-code prompts and parameters such as ",(0,r.kt)("inlineCode",{parentName:"p"},"w,h, cfg_scale")," in your backend. Moreover this will allow the creative department to launch packs, make modifications and even track likes, without needing to touch the backend code."))),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-fine-tune-a-lora-model"},"Step 1: Fine-tune a lora model"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/1504944/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[preset]=flux-lora-portrait \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=1504944 \\\n -F tune[model_type]="lora" \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="Grumpy cat - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=cat \\\n -F tune[preset]=flux-lora-portrait \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=1504944 \\\n -F tune[model_type]="lora" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "Grumpy Cat - UUID - 1234-6789-1234-56789",\n "name": "cat",\n "base_tune_id": 1504944,\n "model_type": "lora",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/1504944/prompts\n \"base_tune_id\": 1504944,\n \"model_type\": \"lora\",\n \"name\": \"cat\",\n \"preet\": \"flux-lora-portrait\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ],\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch() and nested prompts\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n // Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/1504944/prompts\n formData.append('tune[base_tune_id]', 1504944);\n formData.append('tune[model_type]', 'lora');\n formData.append('tune[name]', 'man');\n formData.append('tune[preset]', 'flux-lora-portrait');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `prompts` and `tune.images` are already defined in your context\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[preset]": "flux-lora-portrait",\n "tune[base_tune_id]": 1504944,\n "tune[model_type]": "lora",\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h3",{id:"step-2-generate-images-using-the-fine-tuned-model"},"Step 2: Generate images using the fine-tuned model"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]=" a painting of ohwx man in the style of Van Gogh" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/1504944/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' a painting of ohwx man in the style of Van Gogh');\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/1504944/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' a painting of ohwx man in the style of Van Gogh',\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/97179b4d.5a9d1edc.js b/assets/js/97179b4d.5a9d1edc.js new file mode 100644 index 00000000..1597bc3a --- /dev/null +++ b/assets/js/97179b4d.5a9d1edc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[5139],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=u(n),m=r,h=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,i(i({ref:t},p),{},{components:n})):a.createElement(h,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:r,i[1]=l;for(var u=2;u{n.d(t,{Z:()=>i});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function i(e){let{children:t,hidden:n,className:i}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,i),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>_});var a=n(7462),r=n(7294),o=n(6010),i=n(2466),l=n(6550),s=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,l.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[i,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[s,u]=h({queryString:n,groupId:a}),[c,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,p.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&l(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var g=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:n,selectedValue:l,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.o5)(),d=e=>{const t=e.currentTarget,n=p.indexOf(t),a=u[n].value;a!==l&&(c(t),s(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:i}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},i,{className:(0,o.Z)("tabs__item",b.tabItem,i?.className,{"tabs__item--active":l===t})}),n??t)})))}function v(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function k(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(y,(0,a.Z)({},e,t)),r.createElement(v,(0,a.Z)({},e,t)))}function _(e){const t=(0,g.Z)();return r.createElement(k,(0,a.Z)({key:String(t)},e))}},3714:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>u,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),i=n(5162);const l={hide_table_of_contents:!0,tags:["flux","api","training","fine-tuning","lora"],image:"../use-cases/img/ai-photoshoot-output.jpg"},s="Flux API usage",u={unversionedId:"api/flux-api",id:"api/flux-api",title:"Flux API usage",description:"For an overview of Flux fine-tuning, see Flux fine-tuning",source:"@site/docs/api/05-flux-api.md",sourceDirName:"api",slug:"/api/flux-api",permalink:"/docs/api/flux-api",draft:!1,tags:[{label:"flux",permalink:"/docs/tags/flux"},{label:"api",permalink:"/docs/tags/api"},{label:"training",permalink:"/docs/tags/training"},{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"lora",permalink:"/docs/tags/lora"}],version:"current",sidebarPosition:5,frontMatter:{hide_table_of_contents:!0,tags:["flux","api","training","fine-tuning","lora"],image:"../use-cases/img/ai-photoshoot-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"Inspect image",permalink:"/docs/api/images/inspect"},next:{title:"Themes",permalink:"/docs/category/themes"}},p={},c=[{value:"Step 1: Fine-tune a lora model",id:"step-1-fine-tune-a-lora-model",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Step 2: Generate images using the fine-tuned model",id:"step-2-generate-images-using-the-fine-tuned-model",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...n}=e;return(0,r.kt)(m,(0,a.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"flux-api-usage"},"Flux API usage"),(0,r.kt)("p",null,"For an overview of Flux fine-tuning, see ",(0,r.kt)("a",{parentName:"p",href:"/docs/use-cases/flux-finetuning/"},"Flux fine-tuning")),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Unlike SD15 checkpoint training, Flux is trained as a LoRA model type. As such, inference is taking place on a base model such as Flux1.dev and ",(0,r.kt)("inlineCode",{parentName:"li"},"prompt.text")," should specify the loaded lora such as ",(0,r.kt)("inlineCode",{parentName:"li"},"")," - will load lora with id=123456 and strength=1"),(0,r.kt)("li",{parentName:"ul"},"Flux1.Dev requires commercial license which Astria provides to its customers, and as such LoRA downloading is not available for API usage.")),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/lora"},"LoRA docs")," on lora syntax"),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"To avoid cloning inference details of different model types such as Flux LoRA vs SD1.5 checkpoint, please consider using the ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/pack/pack/"},"Packs API"),". Packs will help you abstract the inference logic so that you do not have to hard-code prompts and parameters such as ",(0,r.kt)("inlineCode",{parentName:"p"},"w,h, cfg_scale")," in your backend. Moreover this will allow the creative department to launch packs, make modifications and even track likes, without needing to touch the backend code."))),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-fine-tune-a-lora-model"},"Step 1: Fine-tune a lora model"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/1504944/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[preset]=flux-lora-portrait \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=1504944 \\\n -F tune[model_type]="lora" \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="Grumpy cat - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=cat \\\n -F tune[preset]=flux-lora-portrait \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=1504944 \\\n -F tune[model_type]="lora" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "Grumpy Cat - UUID - 1234-6789-1234-56789",\n "name": "cat",\n "base_tune_id": 1504944,\n "model_type": "lora",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/1504944/prompts\n \"base_tune_id\": 1504944,\n \"model_type\": \"lora\",\n \"name\": \"cat\",\n \"preet\": \"flux-lora-portrait\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ],\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch() and nested prompts\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n // Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/1504944/prompts\n formData.append('tune[base_tune_id]', 1504944);\n formData.append('tune[model_type]', 'lora');\n formData.append('tune[name]', 'man');\n formData.append('tune[preset]', 'flux-lora-portrait');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `prompts` and `tune.images` are already defined in your context\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[preset]": "flux-lora-portrait",\n "tune[base_tune_id]": 1504944,\n "tune[model_type]": "lora",\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h3",{id:"step-2-generate-images-using-the-fine-tuned-model"},"Step 2: Generate images using the fine-tuned model"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(i.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \\\n -F prompt[text]=" a painting of ohwx man in the style of Van Gogh" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(i.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/1504944/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' a painting of ohwx man in the style of Van Gogh');\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(i.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/1504944/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' a painting of ohwx man in the style of Van Gogh',\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a175974d.0a2711a1.js b/assets/js/a175974d.0a2711a1.js deleted file mode 100644 index c8d98568..00000000 --- a/assets/js/a175974d.0a2711a1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[4274],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=c(n),m=r,g=u["".concat(s,".").concat(m)]||u[m]||d[m]||i;return n?a.createElement(g,l(l({ref:t},p),{},{components:n})):a.createElement(g,l({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=n(7462),r=(n(7294),n(3905));const i={hide_table_of_contents:!0,tags:["virtual try-on","fashion","e-commerce","clothing","garment","backend-v0","VTON"]},l="Virtual Try-on for Flux",o={unversionedId:"use-cases/virtual-try-on",id:"use-cases/virtual-try-on",title:"Virtual Try-on for Flux",description:"BETA. Flux + Backend V0 only feature.",source:"@site/docs/use-cases/35-virtual-try-on.md",sourceDirName:"use-cases",slug:"/use-cases/virtual-try-on",permalink:"/docs/use-cases/virtual-try-on",draft:!1,tags:[{label:"virtual try-on",permalink:"/docs/tags/virtual-try-on"},{label:"fashion",permalink:"/docs/tags/fashion"},{label:"e-commerce",permalink:"/docs/tags/e-commerce"},{label:"clothing",permalink:"/docs/tags/clothing"},{label:"garment",permalink:"/docs/tags/garment"},{label:"backend-v0",permalink:"/docs/tags/backend-v-0"},{label:"VTON",permalink:"/docs/tags/vton"}],version:"current",sidebarPosition:35,frontMatter:{hide_table_of_contents:!0,tags:["virtual try-on","fashion","e-commerce","clothing","garment","backend-v0","VTON"]},sidebar:"tutorialSidebar",previous:{title:"Inpainting and masking",permalink:"/docs/use-cases/inpainting-and-masking"},next:{title:"Product placement",permalink:"/docs/use-cases/product-shots"}},s={},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Garment reference image",id:"garment-reference-image",level:2},{value:"Tips for inference",id:"tips-for-inference",level:2},{value:"Examples",id:"examples",level:2}],p={toc:c},u="wrapper";function d(e){let{components:t,...i}=e;return(0,r.kt)(u,(0,a.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"virtual-try-on-for-flux"},"Virtual Try-on for Flux"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA. Flux + Backend V0 only feature.")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Garment / Clothing - with a model - Recommended"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4781).Z,width:"2000",height:"2000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(647).Z,width:"1376",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Garment / Clothing - with a model - Recommended"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(8107).Z,width:"2000",height:"2000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4857).Z,width:"1376",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Sports virtual try-on"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4566).Z,width:"1969",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(323).Z,width:"1380",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,'Garment / Clothing - Flat lay - must indicate "flat lay" in title - not recommended'),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Garment / Clothing",src:n(8678).Z,width:"1314",height:"1681"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(6729).Z,width:"1376",height:"2304"})))),(0,r.kt)("p",null,"More examples in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Virtual try-on is the term for the process of generating images of a person wearing a specific garment or clothing item. This can be useful for e-commerce websites, fashion designers, or even for personal use."),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,"To use Astria's virtual try-on feature, you need to create:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"A ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/faceid"},"faceid")," fine-tune of the garment you want to try on. The faceid class name should be ",(0,r.kt)("inlineCode",{parentName:"li"},"clothing"),", ",(0,r.kt)("inlineCode",{parentName:"li"},"shirt")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"pants"),", ",(0,r.kt)("inlineCode",{parentName:"li"},"coat")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"swimming suit"),". Class name is used to identify the garment in the image and remove the original model in case a reference image with a fashion model is used."),(0,r.kt)("li",{parentName:"ol"},"Optional: A model of the person you want to dress up ideally through ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/flux-finetuning/"},"fine-tuning"))),(0,r.kt)("h2",{id:"garment-reference-image"},"Garment reference image"),(0,r.kt)("p",null,"When creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"faceid")," of the garment, two types of images are possible for use:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Reference image with a human model. This is recommended as it allows the virtual try-on AI model to infer relative position to the body and get a better understanding of the garment."),(0,r.kt)("li",{parentName:"ol"},"Flat lay image - a plain image of the garment. In this case, image title must include the wording ",(0,r.kt)("inlineCode",{parentName:"li"},"flat lay")," in the faceid tune description."))),(0,r.kt)("div",null,(0,r.kt)("img",{src:n(1080).Z,alt:"Virtual try on step 1 create reference",style:{maxWidth:500}}))),(0,r.kt)("h2",{id:"tips-for-inference"},"Tips for inference"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"For the virtual try-on to work, generated image or input image must show elbows or lower part body. Use ",(0,r.kt)("inlineCode",{parentName:"li"},"waist up")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"long shot")," in your prompt."),(0,r.kt)("li",{parentName:"ol"},"To reference the garment use the ",(0,r.kt)("inlineCode",{parentName:"li"},"")," syntax, where ",(0,r.kt)("inlineCode",{parentName:"li"},"xxxxxx")," is the faceid of the garment."),(0,r.kt)("li",{parentName:"ol"},"If a face of a specific model is desired, use a fine-tuned ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/flux-finetuning/"},"LoRA fine-tuned"),"."),(0,r.kt)("li",{parentName:"ol"},"Use a short prompt to describe the background, pose and composition. For example ",(0,r.kt)("inlineCode",{parentName:"li"},"woman wearing a black shirt and jeans, fashion editorial plain white background"),"."),(0,r.kt)("li",{parentName:"ol"},"In case a reference image to the garment includes a fashion model, a better alternative to this, could be to use the input image as a reference pose as well as img2img to bring some of the background features into the image. See above example for dress and respective prompt below."),(0,r.kt)("li",{parentName:"ol"},"Use 9:16 aspect-ratio i.e: ",(0,r.kt)("inlineCode",{parentName:"li"},"768x1280")," width x height for generating the image."),(0,r.kt)("li",{parentName:"ol"},"Use controlnet pose, preferably preprocessed stick figure. Set ",(0,r.kt)("inlineCode",{parentName:"li"},"controlnet conditioning scale")," to a low 0.3-0.5 and"),(0,r.kt)("li",{parentName:"ol"},"Turn on super resolution, super resolution details and inpaint faces for better results."),(0,r.kt)("li",{parentName:"ol"},"Avoid occlusions covering the garment in the generated image such as hands or a bag - The garment should be clearly visible.")),(0,r.kt)("h2",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Dress example prompt:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"}," front view of ohwx woman wearing dress, fashion editorial plain, white background --control_guidance_end 0.5\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=pose\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/lttvv8rz1olcf28cah48igiydwqi\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=0.5\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=0\nar=1:1\nscheduler=dpm++2m_karras\ncolor_grading=\nuse_lpw=true\nw=768\nh=1280\n")),(0,r.kt)("p",null,"Guns and roses flat lay t-shirt example prompt:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"}," closeup view of ohwx woman wearing Guns And Roses shirt, fashion editorial plain, white background --control_guidance_end 0.5\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=0.5\ncontrolnet_txt2img=true\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=0\nar=1:1\nscheduler=dpm++2m_karras\ncolor_grading=\nuse_lpw=true\nw=768\nh=1280\n")))}d.isMDXComponent=!0},1080:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-step-1-create-faceid-c58b84825c379657c3d7b1fb3869c507.jpeg"},4781:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-dress-input-01891a790108ec2fc5ab6e1ca4809dd4.webp"},647:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-dress-out-dcfc60e716f8bd64827d0a0d3dc553b7.jpg"},8678:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-input-381bcf5a6e209dc2095cec56d8173f85.webp"},4566:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-lakers-input-67a27371a263fbe3db870ed8dc4f2595.jpg"},323:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-lakers-out-1a4642818495a74bc7ea2376378e345b.jpg"},6729:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-out-d9d405f9d7042cb695036f5b130b8588.jpg"},8107:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-swimming-suit-input-dd1e6b021ca5a09f1cfb799f343b0573.jpg"},4857:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-swimming-suit-out-1a1ceacd85728ad510287e56b3facc10.jpg"}}]); \ No newline at end of file diff --git a/assets/js/a175974d.45e2a7ab.js b/assets/js/a175974d.45e2a7ab.js new file mode 100644 index 00000000..823d86c9 --- /dev/null +++ b/assets/js/a175974d.45e2a7ab.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[4274],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),c=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=c(e.components);return a.createElement(s.Provider,{value:t},e.children)},m="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),m=c(n),d=r,g=m["".concat(s,".").concat(d)]||m[d]||p[d]||i;return n?a.createElement(g,l(l({ref:t},u),{},{components:n})):a.createElement(g,l({ref:t},u))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:r,l[1]=o;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=n(7462),r=(n(7294),n(3905));const i={hide_table_of_contents:!0,tags:["virtual try-on","fashion","e-commerce","clothing","garment","backend-v0","VTON"],image:"./img/virtual-try-on-swimming-suit-out.jpg"},l="Virtual Try-on for Flux",o={unversionedId:"use-cases/virtual-try-on",id:"use-cases/virtual-try-on",title:"Virtual Try-on for Flux",description:"BETA. Flux + Backend V0 only feature.",source:"@site/docs/use-cases/35-virtual-try-on.md",sourceDirName:"use-cases",slug:"/use-cases/virtual-try-on",permalink:"/docs/use-cases/virtual-try-on",draft:!1,tags:[{label:"virtual try-on",permalink:"/docs/tags/virtual-try-on"},{label:"fashion",permalink:"/docs/tags/fashion"},{label:"e-commerce",permalink:"/docs/tags/e-commerce"},{label:"clothing",permalink:"/docs/tags/clothing"},{label:"garment",permalink:"/docs/tags/garment"},{label:"backend-v0",permalink:"/docs/tags/backend-v-0"},{label:"VTON",permalink:"/docs/tags/vton"}],version:"current",sidebarPosition:35,frontMatter:{hide_table_of_contents:!0,tags:["virtual try-on","fashion","e-commerce","clothing","garment","backend-v0","VTON"],image:"./img/virtual-try-on-swimming-suit-out.jpg"},sidebar:"tutorialSidebar",previous:{title:"Inpainting and masking",permalink:"/docs/use-cases/inpainting-and-masking"},next:{title:"Product placement",permalink:"/docs/use-cases/product-shots"}},s={image:n(4857).Z},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Garment reference image",id:"garment-reference-image",level:2},{value:"Tips for inference",id:"tips-for-inference",level:2},{value:"Examples",id:"examples",level:2}],u={toc:c},m="wrapper";function p(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,a.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"virtual-try-on-for-flux"},"Virtual Try-on for Flux"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA. Flux + Backend V0 only feature.")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Garment / Clothing - with a model - Recommended"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4781).Z,width:"2000",height:"2000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(647).Z,width:"1376",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Garment / Clothing - with a model - Recommended"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(8107).Z,width:"2000",height:"2000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4857).Z,width:"1376",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Sports virtual try-on"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(4566).Z,width:"1969",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(323).Z,width:"1380",height:"2304"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,'Garment / Clothing - Flat lay - must indicate "flat lay" in title - not recommended'),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Garment / Clothing",src:n(8678).Z,width:"1314",height:"1681"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Generated images"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"Person + Garment",src:n(6729).Z,width:"1376",height:"2304"})))),(0,r.kt)("p",null,"More examples in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Virtual try-on is the term for the process of generating images of a person wearing a specific garment or clothing item. This can be useful for e-commerce websites, fashion designers, or even for personal use."),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,"To use Astria's virtual try-on feature, you need to create:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"A ",(0,r.kt)("a",{parentName:"li",href:"/docs/features/faceid"},"faceid")," fine-tune of the garment you want to try on. The faceid class name should be ",(0,r.kt)("inlineCode",{parentName:"li"},"clothing"),", ",(0,r.kt)("inlineCode",{parentName:"li"},"shirt")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"pants"),", ",(0,r.kt)("inlineCode",{parentName:"li"},"coat")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"swimming suit"),". Class name is used to identify the garment in the image and remove the original model in case a reference image with a fashion model is used."),(0,r.kt)("li",{parentName:"ol"},"Optional: A model of the person you want to dress up ideally through ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/flux-finetuning/"},"fine-tuning"))),(0,r.kt)("h2",{id:"garment-reference-image"},"Garment reference image"),(0,r.kt)("p",null,"When creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"faceid")," of the garment, two types of images are possible for use:"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Reference image with a human model. This is recommended as it allows the virtual try-on AI model to infer relative position to the body and get a better understanding of the garment."),(0,r.kt)("li",{parentName:"ol"},"Flat lay image - a plain image of the garment. In this case, image title must include the wording ",(0,r.kt)("inlineCode",{parentName:"li"},"flat lay")," in the faceid tune description."))),(0,r.kt)("div",null,(0,r.kt)("img",{src:n(1080).Z,alt:"Virtual try on step 1 create reference",style:{maxWidth:500}}))),(0,r.kt)("h2",{id:"tips-for-inference"},"Tips for inference"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"For the virtual try-on to work, generated image or input image must show elbows or lower part body. Use ",(0,r.kt)("inlineCode",{parentName:"li"},"waist up")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"long shot")," in your prompt."),(0,r.kt)("li",{parentName:"ol"},"To reference the garment use the ",(0,r.kt)("inlineCode",{parentName:"li"},"")," syntax, where ",(0,r.kt)("inlineCode",{parentName:"li"},"xxxxxx")," is the faceid of the garment."),(0,r.kt)("li",{parentName:"ol"},"If a face of a specific model is desired, use a fine-tuned ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/flux-finetuning/"},"LoRA fine-tuned"),"."),(0,r.kt)("li",{parentName:"ol"},"Use a short prompt to describe the background, pose and composition. For example ",(0,r.kt)("inlineCode",{parentName:"li"},"woman wearing a black shirt and jeans, fashion editorial plain white background"),"."),(0,r.kt)("li",{parentName:"ol"},"In case a reference image to the garment includes a fashion model, a better alternative to this, could be to use the input image as a reference pose as well as img2img to bring some of the background features into the image. See above example for dress and respective prompt below."),(0,r.kt)("li",{parentName:"ol"},"Use 9:16 aspect-ratio i.e: ",(0,r.kt)("inlineCode",{parentName:"li"},"768x1280")," width x height for generating the image."),(0,r.kt)("li",{parentName:"ol"},"Use controlnet pose, preferably preprocessed stick figure. Set ",(0,r.kt)("inlineCode",{parentName:"li"},"controlnet conditioning scale")," to a low 0.3-0.5 and"),(0,r.kt)("li",{parentName:"ol"},"Turn on super resolution, super resolution details and inpaint faces for better results."),(0,r.kt)("li",{parentName:"ol"},"Avoid occlusions covering the garment in the generated image such as hands or a bag - The garment should be clearly visible.")),(0,r.kt)("h2",{id:"examples"},"Examples"),(0,r.kt)("p",null,"Dress example prompt:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"}," front view of ohwx woman wearing dress, fashion editorial plain, white background --control_guidance_end 0.5\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=pose\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/lttvv8rz1olcf28cah48igiydwqi\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=0.5\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=0\nar=1:1\nscheduler=dpm++2m_karras\ncolor_grading=\nuse_lpw=true\nw=768\nh=1280\n")),(0,r.kt)("p",null,"Guns and roses flat lay t-shirt example prompt:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"}," closeup view of ohwx woman wearing Guns And Roses shirt, fashion editorial plain, white background --control_guidance_end 0.5\nnum_images=1\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=0.5\ncontrolnet_txt2img=true\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=true\nbackend_version=0\nar=1:1\nscheduler=dpm++2m_karras\ncolor_grading=\nuse_lpw=true\nw=768\nh=1280\n")))}p.isMDXComponent=!0},1080:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-step-1-create-faceid-c58b84825c379657c3d7b1fb3869c507.jpeg"},4781:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-dress-input-01891a790108ec2fc5ab6e1ca4809dd4.webp"},647:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-dress-out-dcfc60e716f8bd64827d0a0d3dc553b7.jpg"},8678:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-input-381bcf5a6e209dc2095cec56d8173f85.webp"},4566:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-lakers-input-67a27371a263fbe3db870ed8dc4f2595.jpg"},323:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-lakers-out-1a4642818495a74bc7ea2376378e345b.jpg"},6729:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-flux-out-d9d405f9d7042cb695036f5b130b8588.jpg"},8107:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-swimming-suit-input-dd1e6b021ca5a09f1cfb799f343b0573.jpg"},4857:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/virtual-try-on-swimming-suit-out-1a1ceacd85728ad510287e56b3facc10.jpg"}}]); \ No newline at end of file diff --git a/assets/js/b4b29f2e.0dd1699d.js b/assets/js/b4b29f2e.0dd1699d.js deleted file mode 100644 index a6e747c1..00000000 --- a/assets/js/b4b29f2e.0dd1699d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[4653],{3905:(e,t,i)=>{i.d(t,{Zo:()=>u,kt:()=>d});var n=i(7294);function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}var l=n.createContext({}),p=function(e){var t=n.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):o(o({},t),e)),i},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},m="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var i=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),m=p(i),c=r,d=m["".concat(l,".").concat(c)]||m[c]||g[c]||a;return i?n.createElement(d,o(o({ref:t},u),{},{components:i})):n.createElement(d,o({ref:t},u))}));function d(e,t){var i=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=i.length,o=new Array(a);o[0]=c;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[m]="string"==typeof e?e:r,o[1]=s;for(var p=2;p{i.r(t),i.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>m});var n=i(7462),r=(i(7294),i(3905));const a=i.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg";var o=i(118);const s={tags:["flux","training","fine-tuning","lora"]},l="Flux training",p={unversionedId:"use-cases/flux-finetuning",id:"use-cases/flux-finetuning",title:"Flux training",description:"Overview",source:"@site/docs/use-cases/05-flux-finetuning.md",sourceDirName:"use-cases",slug:"/use-cases/flux-finetuning",permalink:"/docs/use-cases/flux-finetuning",draft:!1,tags:[{label:"flux",permalink:"/docs/tags/flux"},{label:"training",permalink:"/docs/tags/training"},{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"lora",permalink:"/docs/tags/lora"}],version:"current",sidebarPosition:5,frontMatter:{tags:["flux","training","fine-tuning","lora"]},sidebar:"tutorialSidebar",previous:{title:"Fine-tuning guide",permalink:"/docs/use-cases/finetuning-guide"},next:{title:"SDXL training",permalink:"/docs/use-cases/sdxl-training"}},u={},m=[{value:"Overview",id:"overview",level:2},{value:"Training presets",id:"training-presets",level:2},{value:"Training tips",id:"training-tips",level:2},{value:"Inference tips",id:"inference-tips",level:2},{value:"API usage",id:"api-usage",level:2}],g={toc:m},c="wrapper";function d(e){let{components:t,...i}=e;return(0,r.kt)(c,(0,n.Z)({},g,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"flux-training"},"Flux training"),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},"Flux")," is a family of generative image models created by ",(0,r.kt)("a",{parentName:"p",href:"https://blackforestlabs.ai/announcing-black-forest-labs/"},"Black Forest Labs")," making use of some of the latest AI advancement such as diffusion, transformer (MMDiT), Flow-matching and a large T5 text encoder. "),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The large text encoder allows the text2img model to better align the image with the given prompt and create complex images with a single prompt. ")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The model base resolution is 1024x1024 however unlike previous models, was trained on a variety of aspect ratios its neural-network architecture is able to better cope with different aspect ratios both in training and inference. ")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"Flux1.dev requires commercial licensing which is provided to Astria customers."))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,"Input training images",(0,r.kt)("img",{src:o.Z,alt:"generated.png"})),(0,r.kt)("div",null,"Output images",(0,r.kt)("img",{src:a,alt:"generated.png"}))),(0,r.kt)("h2",{id:"training-presets"},"Training presets"),(0,r.kt)("p",null,"Astria uses training presets to evolve its training strategies and provide better results while also providing a stable API for its customers."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Our current recommendation is to use the ",(0,r.kt)("inlineCode",{parentName:"p"},"portrait")," preset for training Flux models.")),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Portrait")," - API ",(0,r.kt)("inlineCode",{parentName:"li"},"flux-lora-portrait")," - This preset is generally recommended for any kind of training including non portraits, except for ",(0,r.kt)("inlineCode",{parentName:"li"},"style")," training. With the latest ",(0,r.kt)("inlineCode",{parentName:"li"},"portrait")," we now use more precise hyper-parameters for training, improved pre-processing, better handling of blurred/low-res images, face-cropping and focusing on learning face features, less overfitting to clothing and background. You will get more diverse images with better prompt alignment while better preserving identity and face. For this preset we default to 27 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements."),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Fast")," API ",(0,r.kt)("inlineCode",{parentName:"li"},"flux-lora-fast")," - Legacy preset. Provides an alternative for the high preset, with faster training and lower cost. Similarly to the ",(0,r.kt)("inlineCode",{parentName:"li"},"portrait")," preset, it uses 27 steps per image for training, with minimum steps of 300. "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"High")," API ",(0,r.kt)("inlineCode",{parentName:"li"},"null")," - High steps, low-learning rate. Should be used for ",(0,r.kt)("inlineCode",{parentName:"li"},"style")," training or training sets with 20+ images. With the high preset, we default to 100 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements.")),(0,r.kt)("h2",{id:"training-tips"},"Training tips"),(0,r.kt)("p",null,"Default token for SDXL should be ",(0,r.kt)("inlineCode",{parentName:"p"},"ohwx")," and will be set automatically if none is specified"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"As with other models, a good training set is critical to getting great results. See ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/ai-photoshoot/"},"AI photoshoot guide")),(0,r.kt)("li",{parentName:"ol"},"Astria currently defaults to 100 steps per image for training a Flux lora for the high preset, and 27 steps per image for the fast preset. Fast preset is recommended when training on people or headshots. "),(0,r.kt)("li",{parentName:"ol"},"You may opt to override the number of training steps in order to reduce costs and processing time. Reducing the steps can produce good results when the target inference images are similar to the input training images (like headshots). Example lower steps could be 600, 1000 or 1200 (roughly 50-70 * number of training images )")),(0,r.kt)("h2",{id:"inference-tips"},"Inference tips"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Dense prompts")," - Flux works best when the prompt is descriptive and detailed, but as in most models, be concise. Overdoing the description can create conflicts in the inference."),(0,r.kt)("li",{parentName:"ol"},"*",(0,r.kt)("em",{parentName:"li"},"No negatives")," - Flux doesn\u2019t work with negatives, instead we suggest using positive prompts. For example, instead of writing \u2018cartoon\u2019 in the negative, write \u2018realistic settings and characters\u2019 in the prompt. "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"No weighted prompts")," - using weights or parentheses () to emphasis certain parts of a prompt doesn\u2019t work with Flux. Instead, make sure the important parts at the beginning of the prompt."),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Adding text in the image")," - One of the advantages of Flux is the ability to add text to an image. There are a few ways to do that, like \u201cohwx man holding a sign with the words \u2018Hello\u2019\u201c."),(0,r.kt)("li",{parentName:"ol"},"Looking for prompt ideas? Try the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/themes"},"Themes")," feature. Themes uses Claude GPT to help write prompts for the specific model. You can add a theme and write any topic on your mind, and themes will produce 10 prompts on it.")),(0,r.kt)("h2",{id:"api-usage"},"API usage"),(0,r.kt)("p",null,"See here for ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/flux-api"},"API usage")))}d.isMDXComponent=!0},118:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"}}]); \ No newline at end of file diff --git a/assets/js/b4b29f2e.72c88383.js b/assets/js/b4b29f2e.72c88383.js new file mode 100644 index 00000000..9d8fccad --- /dev/null +++ b/assets/js/b4b29f2e.72c88383.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[4653],{3905:(e,t,i)=>{i.d(t,{Zo:()=>u,kt:()=>d});var n=i(7294);function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}var l=n.createContext({}),p=function(e){var t=n.useContext(l),i=t;return e&&(i="function"==typeof e?e(t):o(o({},t),e)),i},u=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var i=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),g=p(i),c=r,d=g["".concat(l,".").concat(c)]||g[c]||m[c]||a;return i?n.createElement(d,o(o({ref:t},u),{},{components:i})):n.createElement(d,o({ref:t},u))}));function d(e,t){var i=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=i.length,o=new Array(a);o[0]=c;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[g]="string"==typeof e?e:r,o[1]=s;for(var p=2;p{i.r(t),i.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>g});var n=i(7462),r=(i(7294),i(3905));const a=i.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg";var o=i(118);const s={tags:["flux","training","fine-tuning","lora"],image:"./img/ai-photoshoot-output.jpg"},l="Flux training",p={unversionedId:"use-cases/flux-finetuning",id:"use-cases/flux-finetuning",title:"Flux training",description:"Overview",source:"@site/docs/use-cases/05-flux-finetuning.md",sourceDirName:"use-cases",slug:"/use-cases/flux-finetuning",permalink:"/docs/use-cases/flux-finetuning",draft:!1,tags:[{label:"flux",permalink:"/docs/tags/flux"},{label:"training",permalink:"/docs/tags/training"},{label:"fine-tuning",permalink:"/docs/tags/fine-tuning"},{label:"lora",permalink:"/docs/tags/lora"}],version:"current",sidebarPosition:5,frontMatter:{tags:["flux","training","fine-tuning","lora"],image:"./img/ai-photoshoot-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"Fine-tuning guide",permalink:"/docs/use-cases/finetuning-guide"},next:{title:"SDXL training",permalink:"/docs/use-cases/sdxl-training"}},u={image:i(670).Z},g=[{value:"Overview",id:"overview",level:2},{value:"Training presets",id:"training-presets",level:2},{value:"Training tips",id:"training-tips",level:2},{value:"Inference tips",id:"inference-tips",level:2},{value:"API usage",id:"api-usage",level:2}],m={toc:g},c="wrapper";function d(e){let{components:t,...i}=e;return(0,r.kt)(c,(0,n.Z)({},m,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"flux-training"},"Flux training"),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,(0,r.kt)("em",{parentName:"p"},"Flux")," is a family of generative image models created by ",(0,r.kt)("a",{parentName:"p",href:"https://blackforestlabs.ai/announcing-black-forest-labs/"},"Black Forest Labs")," making use of some of the latest AI advancement such as diffusion, transformer (MMDiT), Flow-matching and a large T5 text encoder. "),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The large text encoder allows the text2img model to better align the image with the given prompt and create complex images with a single prompt. ")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The model base resolution is 1024x1024 however unlike previous models, was trained on a variety of aspect ratios its neural-network architecture is able to better cope with different aspect ratios both in training and inference. ")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"Flux1.dev requires commercial licensing which is provided to Astria customers."))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,"Input training images",(0,r.kt)("img",{src:o.Z,alt:"generated.png"})),(0,r.kt)("div",null,"Output images",(0,r.kt)("img",{src:a,alt:"generated.png"}))),(0,r.kt)("h2",{id:"training-presets"},"Training presets"),(0,r.kt)("p",null,"Astria uses training presets to evolve its training strategies and provide better results while also providing a stable API for its customers."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},"Our current recommendation is to use the ",(0,r.kt)("inlineCode",{parentName:"p"},"portrait")," preset for training Flux models.")),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Portrait")," - API ",(0,r.kt)("inlineCode",{parentName:"li"},"flux-lora-portrait")," - This preset is generally recommended for any kind of training including non portraits, except for ",(0,r.kt)("inlineCode",{parentName:"li"},"style")," training. With the latest ",(0,r.kt)("inlineCode",{parentName:"li"},"portrait")," we now use more precise hyper-parameters for training, improved pre-processing, better handling of blurred/low-res images, face-cropping and focusing on learning face features, less overfitting to clothing and background. You will get more diverse images with better prompt alignment while better preserving identity and face. For this preset we default to 27 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements."),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Fast")," API ",(0,r.kt)("inlineCode",{parentName:"li"},"flux-lora-fast")," - Legacy preset. Provides an alternative for the high preset, with faster training and lower cost. Similarly to the ",(0,r.kt)("inlineCode",{parentName:"li"},"portrait")," preset, it uses 27 steps per image for training, with minimum steps of 300. "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"High")," API ",(0,r.kt)("inlineCode",{parentName:"li"},"null")," - High steps, low-learning rate. Should be used for ",(0,r.kt)("inlineCode",{parentName:"li"},"style")," training or training sets with 20+ images. With the high preset, we default to 100 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements.")),(0,r.kt)("h2",{id:"training-tips"},"Training tips"),(0,r.kt)("p",null,"Default token for SDXL should be ",(0,r.kt)("inlineCode",{parentName:"p"},"ohwx")," and will be set automatically if none is specified"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"As with other models, a good training set is critical to getting great results. See ",(0,r.kt)("a",{parentName:"li",href:"/docs/use-cases/ai-photoshoot/"},"AI photoshoot guide")),(0,r.kt)("li",{parentName:"ol"},"Astria currently defaults to 100 steps per image for training a Flux lora for the high preset, and 27 steps per image for the fast preset. Fast preset is recommended when training on people or headshots. "),(0,r.kt)("li",{parentName:"ol"},"You may opt to override the number of training steps in order to reduce costs and processing time. Reducing the steps can produce good results when the target inference images are similar to the input training images (like headshots). Example lower steps could be 600, 1000 or 1200 (roughly 50-70 * number of training images )")),(0,r.kt)("h2",{id:"inference-tips"},"Inference tips"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Dense prompts")," - Flux works best when the prompt is descriptive and detailed, but as in most models, be concise. Overdoing the description can create conflicts in the inference."),(0,r.kt)("li",{parentName:"ol"},"*",(0,r.kt)("em",{parentName:"li"},"No negatives")," - Flux doesn\u2019t work with negatives, instead we suggest using positive prompts. For example, instead of writing \u2018cartoon\u2019 in the negative, write \u2018realistic settings and characters\u2019 in the prompt. "),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"No weighted prompts")," - using weights or parentheses () to emphasis certain parts of a prompt doesn\u2019t work with Flux. Instead, make sure the important parts at the beginning of the prompt."),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("strong",{parentName:"li"},"Adding text in the image")," - One of the advantages of Flux is the ability to add text to an image. There are a few ways to do that, like \u201cohwx man holding a sign with the words \u2018Hello\u2019\u201c."),(0,r.kt)("li",{parentName:"ol"},"Looking for prompt ideas? Try the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/themes"},"Themes")," feature. Themes uses Claude GPT to help write prompts for the specific model. You can add a theme and write any topic on your mind, and themes will produce 10 prompts on it.")),(0,r.kt)("h2",{id:"api-usage"},"API usage"),(0,r.kt)("p",null,"See here for ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/flux-api"},"API usage")))}d.isMDXComponent=!0},118:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"},670:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/ai-photoshoot-output-79da8a3cef6fc255171431261d38c892.jpg"}}]); \ No newline at end of file diff --git a/assets/js/b83527cb.58c1d2c7.js b/assets/js/b83527cb.58c1d2c7.js deleted file mode 100644 index 603167ef..00000000 --- a/assets/js/b83527cb.58c1d2c7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2062],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>g});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),m=i,g=u["".concat(l,".").concat(m)]||u[m]||d[m]||a;return n?r.createElement(g,o(o({ref:t},c),{},{components:n})):r.createElement(g,o({ref:t},c))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:i,o[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>s,metadata:()=>p,toc:()=>u});var r=n(7462),i=(n(7294),n(3905));const a=n.p+"assets/images/sdxl-output-e65457001cbfcde71dc935732d9b396c.jpg";var o=n(118);const s={},l="SDXL training",p={unversionedId:"use-cases/sdxl-training",id:"use-cases/sdxl-training",title:"SDXL training",description:"Overview",source:"@site/docs/use-cases/10-sdxl-training.md",sourceDirName:"use-cases",slug:"/use-cases/sdxl-training",permalink:"/docs/use-cases/sdxl-training",draft:!1,tags:[],version:"current",sidebarPosition:10,frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Flux training",permalink:"/docs/use-cases/flux-finetuning"},next:{title:"Controlnet",permalink:"/docs/use-cases/controlnet"}},c={},u=[{value:"Overview",id:"overview",level:2},{value:"Training tips",id:"training-tips",level:2},{value:"Inference tips",id:"inference-tips",level:2},{value:"Aspect ratios",id:"aspect-ratios",level:2},{value:"API usage",id:"api-usage",level:2}],d={toc:u},m="wrapper";function g(e){let{components:t,...n}=e;return(0,i.kt)(m,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"sdxl-training"},"SDXL training"),(0,i.kt)("h2",{id:"overview"},"Overview"),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Stable Diffusion XL")," or ",(0,i.kt)("strong",{parentName:"p"},"SDXL")," is the 2nd gen image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition. SDXL can generate realistic faces, legible text within the images, and better image composition, all while using shorter and simpler prompts."),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},(0,i.kt)("inlineCode",{parentName:"p"},"LoRA + Text-embedding")," is currently the only option for fine-tuning SDXL.")),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,i.kt)("div",null,"Input training images",(0,i.kt)("img",{src:o.Z,alt:"generated.png"})),(0,i.kt)("div",null,"Output images",(0,i.kt)("img",{src:a,alt:"generated.png"}))),(0,i.kt)("h2",{id:"training-tips"},"Training tips"),(0,i.kt)("p",null,"Default token for SDXL should be ",(0,i.kt)("inlineCode",{parentName:"p"},"ohwx")," and will be set automatically if none is specified"),(0,i.kt)("h2",{id:"inference-tips"},"Inference tips"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Do not copy and paste prompts from SD15"),(0,i.kt)("li",{parentName:"ol"},"Do not use textual-inversions such as ",(0,i.kt)("inlineCode",{parentName:"li"},"easynegative")," or ",(0,i.kt)("inlineCode",{parentName:"li"},"badhands")," from SD15"),(0,i.kt)("li",{parentName:"ol"},"Consider activating face-swap and face-inpainting (which in turn requires super-resolution) - this is the biggest boost you can get to increase similarity to subject"),(0,i.kt)("li",{parentName:"ol"},"Use clean small concise prompts - usually up to 15 words"),(0,i.kt)("li",{parentName:"ol"},"Avoid long negatives - this will decrease similarity to subject."),(0,i.kt)("li",{parentName:"ol"},"Start with baseline SDXL 1.0 inference before going to other base models. Most custom SDXL models are biased and may reduce similarity. Models which we noticed that work okay are ",(0,i.kt)("inlineCode",{parentName:"li"},"ZavyChromaXL")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"ClearChromaXL"))),(0,i.kt)("p",null,"All above tips will help increase similarity to the original subject."),(0,i.kt)("h2",{id:"aspect-ratios"},"Aspect ratios"),(0,i.kt)("p",null,"The below aspect ratios are recommended for SDXL inference since these were also used for the training."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-text"},"aspect: width, height\n0.5: 704, 1408\n0.52: 704, 1344\n0.57: 768, 1344\n0.6: 768, 1280\n0.68: 832, 1216\n0.72: 832, 1152\n0.78: 896, 1152\n0.82: 896, 1088\n0.88: 960, 1088\n0.94: 960, 1024\n1.0: 1024, 1024\n1.07: 1024, 960\n1.13: 1088, 960\n1.21: 1088, 896\n1.29: 1152, 896\n1.38: 1152, 832\n1.46: 1216, 832\n1.67: 1280, 768\n1.75: 1344, 768\n1.91: 1344, 704\n2.0: 1408, 704\n2.09: 1472, 704\n2.4: 1536, 640\n2.5: 1600, 640\n2.89: 1664, 576\n3.0: 1728, 576\n")),(0,i.kt)("h2",{id:"api-usage"},"API usage"),(0,i.kt)("p",null,"See here for ",(0,i.kt)("a",{parentName:"p",href:"/docs/api/sdxl-api"},"API usage")))}g.isMDXComponent=!0},118:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"}}]); \ No newline at end of file diff --git a/assets/js/b83527cb.75f6c9fe.js b/assets/js/b83527cb.75f6c9fe.js new file mode 100644 index 00000000..76820974 --- /dev/null +++ b/assets/js/b83527cb.75f6c9fe.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[2062],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>g});var i=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=i.createContext({}),p=function(e){var t=i.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=p(e.components);return i.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},m=i.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),m=r,g=u["".concat(l,".").concat(m)]||u[m]||d[m]||a;return n?i.createElement(g,o(o({ref:t},c),{},{components:n})):i.createElement(g,o({ref:t},c))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:r,o[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>s,metadata:()=>p,toc:()=>u});var i=n(7462),r=(n(7294),n(3905));const a=n.p+"assets/images/sdxl-output-e65457001cbfcde71dc935732d9b396c.jpg";var o=n(118);const s={image:"./img/sdxl-output.jpg"},l="SDXL training",p={unversionedId:"use-cases/sdxl-training",id:"use-cases/sdxl-training",title:"SDXL training",description:"Overview",source:"@site/docs/use-cases/10-sdxl-training.md",sourceDirName:"use-cases",slug:"/use-cases/sdxl-training",permalink:"/docs/use-cases/sdxl-training",draft:!1,tags:[],version:"current",sidebarPosition:10,frontMatter:{image:"./img/sdxl-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"Flux training",permalink:"/docs/use-cases/flux-finetuning"},next:{title:"Controlnet",permalink:"/docs/use-cases/controlnet"}},c={image:n(39).Z},u=[{value:"Overview",id:"overview",level:2},{value:"Training tips",id:"training-tips",level:2},{value:"Inference tips",id:"inference-tips",level:2},{value:"Aspect ratios",id:"aspect-ratios",level:2},{value:"API usage",id:"api-usage",level:2}],d={toc:u},m="wrapper";function g(e){let{components:t,...n}=e;return(0,r.kt)(m,(0,i.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"sdxl-training"},"SDXL training"),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Stable Diffusion XL")," or ",(0,r.kt)("strong",{parentName:"p"},"SDXL")," is the 2nd gen image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition. SDXL can generate realistic faces, legible text within the images, and better image composition, all while using shorter and simpler prompts."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("p",{parentName:"admonition"},(0,r.kt)("inlineCode",{parentName:"p"},"LoRA + Text-embedding")," is currently the only option for fine-tuning SDXL.")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,"Input training images",(0,r.kt)("img",{src:o.Z,alt:"generated.png"})),(0,r.kt)("div",null,"Output images",(0,r.kt)("img",{src:a,alt:"generated.png"}))),(0,r.kt)("h2",{id:"training-tips"},"Training tips"),(0,r.kt)("p",null,"Default token for SDXL should be ",(0,r.kt)("inlineCode",{parentName:"p"},"ohwx")," and will be set automatically if none is specified"),(0,r.kt)("h2",{id:"inference-tips"},"Inference tips"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Do not copy and paste prompts from SD15"),(0,r.kt)("li",{parentName:"ol"},"Do not use textual-inversions such as ",(0,r.kt)("inlineCode",{parentName:"li"},"easynegative")," or ",(0,r.kt)("inlineCode",{parentName:"li"},"badhands")," from SD15"),(0,r.kt)("li",{parentName:"ol"},"Consider activating face-swap and face-inpainting (which in turn requires super-resolution) - this is the biggest boost you can get to increase similarity to subject"),(0,r.kt)("li",{parentName:"ol"},"Use clean small concise prompts - usually up to 15 words"),(0,r.kt)("li",{parentName:"ol"},"Avoid long negatives - this will decrease similarity to subject."),(0,r.kt)("li",{parentName:"ol"},"Start with baseline SDXL 1.0 inference before going to other base models. Most custom SDXL models are biased and may reduce similarity. Models which we noticed that work okay are ",(0,r.kt)("inlineCode",{parentName:"li"},"ZavyChromaXL")," and ",(0,r.kt)("inlineCode",{parentName:"li"},"ClearChromaXL"))),(0,r.kt)("p",null,"All above tips will help increase similarity to the original subject."),(0,r.kt)("h2",{id:"aspect-ratios"},"Aspect ratios"),(0,r.kt)("p",null,"The below aspect ratios are recommended for SDXL inference since these were also used for the training."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"aspect: width, height\n0.5: 704, 1408\n0.52: 704, 1344\n0.57: 768, 1344\n0.6: 768, 1280\n0.68: 832, 1216\n0.72: 832, 1152\n0.78: 896, 1152\n0.82: 896, 1088\n0.88: 960, 1088\n0.94: 960, 1024\n1.0: 1024, 1024\n1.07: 1024, 960\n1.13: 1088, 960\n1.21: 1088, 896\n1.29: 1152, 896\n1.38: 1152, 832\n1.46: 1216, 832\n1.67: 1280, 768\n1.75: 1344, 768\n1.91: 1344, 704\n2.0: 1408, 704\n2.09: 1472, 704\n2.4: 1536, 640\n2.5: 1600, 640\n2.89: 1664, 576\n3.0: 1728, 576\n")),(0,r.kt)("h2",{id:"api-usage"},"API usage"),(0,r.kt)("p",null,"See here for ",(0,r.kt)("a",{parentName:"p",href:"/docs/api/sdxl-api"},"API usage")))}g.isMDXComponent=!0},118:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/ai-photoshoot-input-66e224267554a6902bfaa5e6103ae27f.jpg"},39:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/sdxl-output-e65457001cbfcde71dc935732d9b396c.jpg"}}]); \ No newline at end of file diff --git a/assets/js/c231ecf4.528b9ca7.js b/assets/js/c231ecf4.528b9ca7.js new file mode 100644 index 00000000..1da1997d --- /dev/null +++ b/assets/js/c231ecf4.528b9ca7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1599],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),u=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=u(e.components);return r.createElement(c.Provider,{value:t},e.children)},l="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),l=u(n),d=o,m=l["".concat(c,".").concat(d)]||l[d]||f[d]||i;return n?r.createElement(m,a(a({ref:t},p),{},{components:n})):r.createElement(m,a({ref:t},p))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[l]="string"==typeof e?e:o,a[1]=s;for(var u=2;u{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>f,frontMatter:()=>i,metadata:()=>s,toc:()=>u});var r=n(7462),o=(n(7294),n(3905));const i={image:"./img/toonify-output.png"},a="Toonify",s={unversionedId:"use-cases/toonify",id:"use-cases/toonify",title:"Toonify",description:"Input image",source:"@site/docs/use-cases/50-toonify.md",sourceDirName:"use-cases",slug:"/use-cases/toonify",permalink:"/docs/use-cases/toonify",draft:!1,tags:[],version:"current",sidebarPosition:50,frontMatter:{image:"./img/toonify-output.png"},sidebar:"tutorialSidebar",previous:{title:"Product placement",permalink:"/docs/use-cases/product-shots"},next:{title:"Video Generation",permalink:"/docs/use-cases/video-generation"}},c={image:n(1728).Z},u=[],p={toc:u},l="wrapper";function f(e){let{components:t,...i}=e;return(0,o.kt)(l,(0,r.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"toonify"},"Toonify"),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(1681).Z,width:"580",height:"773"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output Controlnet tile, model: Disney Pixar"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(1728).Z,width:"580",height:"761"})))))}f.isMDXComponent=!0},1681:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/toonify-input-66c7836358b6b2985ca6a595275d8448.png"},1728:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/toonify-output-d1468b1833dfd31e77a91d483951331f.png"}}]); \ No newline at end of file diff --git a/assets/js/c231ecf4.8a7e9576.js b/assets/js/c231ecf4.8a7e9576.js deleted file mode 100644 index f360f641..00000000 --- a/assets/js/c231ecf4.8a7e9576.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1599],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>y});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),l=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},u=function(e){var t=l(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),d=o,y=p["".concat(c,".").concat(d)]||p[d]||f[d]||i;return n?r.createElement(y,a(a({ref:t},u),{},{components:n})):r.createElement(y,a({ref:t},u))}));function y(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[p]="string"==typeof e?e:o,a[1]=s;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>f,frontMatter:()=>i,metadata:()=>s,toc:()=>l});var r=n(7462),o=(n(7294),n(3905));const i={},a="Toonify",s={unversionedId:"use-cases/toonify",id:"use-cases/toonify",title:"Toonify",description:"Input image",source:"@site/docs/use-cases/50-toonify.md",sourceDirName:"use-cases",slug:"/use-cases/toonify",permalink:"/docs/use-cases/toonify",draft:!1,tags:[],version:"current",sidebarPosition:50,frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Product placement",permalink:"/docs/use-cases/product-shots"},next:{title:"Video Generation",permalink:"/docs/use-cases/video-generation"}},c={},l=[],u={toc:l},p="wrapper";function f(e){let{components:t,...i}=e;return(0,o.kt)(p,(0,r.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"toonify"},"Toonify"),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(1681).Z,width:"580",height:"773"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output Controlnet tile, model: Disney Pixar"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(1728).Z,width:"580",height:"761"})))))}f.isMDXComponent=!0},1681:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/toonify-input-66c7836358b6b2985ca6a595275d8448.png"},1728:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/toonify-output-d1468b1833dfd31e77a91d483951331f.png"}}]); \ No newline at end of file diff --git a/assets/js/d3225ce8.63530e7e.js b/assets/js/d3225ce8.63530e7e.js new file mode 100644 index 00000000..b091bf51 --- /dev/null +++ b/assets/js/d3225ce8.63530e7e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1124],{3905:(t,e,a)=>{a.d(e,{Zo:()=>g,kt:()=>m});var n=a(7294);function r(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function i(t){for(var e=1;e=0||(r[a]=t[a]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}var p=n.createContext({}),o=function(t){var e=n.useContext(p),a=e;return t&&(a="function"==typeof t?t(e):i(i({},e),t)),a},g=function(t){var e=o(t.components);return n.createElement(p.Provider,{value:e},t.children)},c="mdxType",u={inlineCode:"code",wrapper:function(t){var e=t.children;return n.createElement(n.Fragment,{},e)}},d=n.forwardRef((function(t,e){var a=t.components,r=t.mdxType,s=t.originalType,p=t.parentName,g=l(t,["components","mdxType","originalType","parentName"]),c=o(a),d=r,m=c["".concat(p,".").concat(d)]||c[d]||u[d]||s;return a?n.createElement(m,i(i({ref:e},g),{},{components:a})):n.createElement(m,i({ref:e},g))}));function m(t,e){var a=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var s=a.length,i=new Array(s);i[0]=d;var l={};for(var p in e)hasOwnProperty.call(e,p)&&(l[p]=e[p]);l.originalType=t,l[c]="string"==typeof t?t:r,i[1]=l;for(var o=2;o{a.r(e),a.d(e,{assets:()=>p,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>o});var n=a(7462),r=(a(7294),a(3905));const s={image:"./img/masking-result-flat-2.jpeg"},i="Masked portraits",l={unversionedId:"use-cases/masked-portraits",id:"use-cases/masked-portraits",title:"Masked portraits",description:"Input image",source:"@site/docs/use-cases/masked-portraits.md",sourceDirName:"use-cases",slug:"/use-cases/masked-portraits",permalink:"/docs/use-cases/masked-portraits",draft:!1,tags:[],version:"current",frontMatter:{image:"./img/masking-result-flat-2.jpeg"},sidebar:"tutorialSidebar",previous:{title:"FAQ",permalink:"/docs/use-cases/faq"},next:{title:"AI Interior Design",permalink:"/docs/use-cases/room-redesign"}},p={image:a(5749).Z},o=[{value:"Overview",id:"overview",level:2},{value:"Example prompt",id:"example-prompt",level:2},{value:"API usage",id:"api-usage",level:3}],g={toc:o},c="wrapper";function u(t){let{components:e,...s}=t;return(0,r.kt)(c,(0,n.Z)({},g,s,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"masked-portraits"},"Masked portraits"),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(8534).Z,width:"3456",height:"4320"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(4881).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(6871).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1337).Z,width:"2048",height:"2560"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(942).Z,width:"2304",height:"2880"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1971).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(9877).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(5749).Z,width:"2048",height:"2560"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(7745).Z,width:"3024",height:"4032"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(9711).Z,width:"2048",height:"2688"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(7566).Z,width:"2048",height:"2688"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(4285).Z,width:"2048",height:"2688"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(6586).Z,width:"6000",height:"4000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(3349).Z,width:"3072",height:"2048"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1089).Z,width:"3072",height:"2048"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1514).Z,width:"3072",height:"2048"})))),(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=mask_prompt"},"gallery"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Use ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/prompt-masking"},"prompt masking")," feature to embed a person into a scene.\nThis essentially allows you to create AI photogarphy or avatars without fine-tuning."),(0,r.kt)("admonition",{type:"warning"},(0,r.kt)("p",{parentName:"admonition"},"SDXL inpainting results are poor. Use SD15 models instead.")),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("h2",{id:"example-prompt"},"Example prompt"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"realistic digital painting, astronaut in a garden on a spring day, by martine johanna and simon stalenhag and chie yoshii and casey weldon and wlop, ornate, dynamic, particulate, rich colors, intricate, elegant, highly detailed, harpers bazaar art, fashion magazine, smooth, sharp focus, 8 k, octane rende --mask_prompt foreground --mask_negative clothes --mask_invert --mask_dilate -20 --hires_denoising_strength 0.2\nnum_images=1\nnegative_prompt=clay, text, watermark, padding, cropped, typography\nseed=\nsteps=30\ncfg_scale=\ncontrolnet=pose\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/d6ff3soq5pok5tlbcanf599vkw06\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=true\nfilm_grain=false\nface_swap=false\nhires_fix=true\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")),(0,r.kt)("h3",{id:"api-usage"},"API usage"))}u.isMDXComponent=!0},8534:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-1-30b69f2c9a58c8a1f23456828c28c466.jpg"},942:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-2-7b8b5861fa50fc87b8e36b3153c879cd.jpg"},7745:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-3-0589d66f0f53258a32e5de0ef482f29e.jpg"},6586:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-4-b8bf227c6e5236b0d978f1ad0756d219.jpg"},4881:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-1-9db772635af3ec249fd3e8ebe9822ed8.jpeg"},1971:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-2-4a8bc5cca3803cf82043236295dfbf89.jpeg"},9711:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-3-380476a5d8fbabf4c8a20ed4d92e2db7.jpeg"},3349:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-4-f91c19288661030447e4b4e7ac1a211c.jpeg"},6871:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-1-56a489f7b7e42006cd95a2c561849da8.jpeg"},9877:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-2-887ab1b97bc8c2499f02a230e7125813.jpeg"},7566:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-3-bf4192f7ec3d086c3587d17d6d63e050.jpeg"},1089:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-4-b9dea5905f8c4e02ca9c77258b1c7058.jpeg"},1337:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-1-7139aa49335d33554f1576849e08ae59.jpeg"},5749:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-2-0f9ff603c09cf9b80380c61658572d21.jpeg"},4285:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-3-a546e7a92eb69b037149520ab9986a08.jpeg"},1514:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-4-36aa99d30a372ca38dbd7eea5bae29e7.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/d3225ce8.849d6a0f.js b/assets/js/d3225ce8.849d6a0f.js deleted file mode 100644 index 82e645d6..00000000 --- a/assets/js/d3225ce8.849d6a0f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1124],{3905:(t,e,a)=>{a.d(e,{Zo:()=>g,kt:()=>m});var n=a(7294);function r(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function i(t){for(var e=1;e=0||(r[a]=t[a]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}var p=n.createContext({}),o=function(t){var e=n.useContext(p),a=e;return t&&(a="function"==typeof t?t(e):i(i({},e),t)),a},g=function(t){var e=o(t.components);return n.createElement(p.Provider,{value:e},t.children)},c="mdxType",u={inlineCode:"code",wrapper:function(t){var e=t.children;return n.createElement(n.Fragment,{},e)}},d=n.forwardRef((function(t,e){var a=t.components,r=t.mdxType,s=t.originalType,p=t.parentName,g=l(t,["components","mdxType","originalType","parentName"]),c=o(a),d=r,m=c["".concat(p,".").concat(d)]||c[d]||u[d]||s;return a?n.createElement(m,i(i({ref:e},g),{},{components:a})):n.createElement(m,i({ref:e},g))}));function m(t,e){var a=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var s=a.length,i=new Array(s);i[0]=d;var l={};for(var p in e)hasOwnProperty.call(e,p)&&(l[p]=e[p]);l.originalType=t,l[c]="string"==typeof t?t:r,i[1]=l;for(var o=2;o{a.r(e),a.d(e,{assets:()=>p,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>o});var n=a(7462),r=(a(7294),a(3905));const s={},i="Masked portraits",l={unversionedId:"use-cases/masked-portraits",id:"use-cases/masked-portraits",title:"Masked portraits",description:"BETA",source:"@site/docs/use-cases/masked-portraits.md",sourceDirName:"use-cases",slug:"/use-cases/masked-portraits",permalink:"/docs/use-cases/masked-portraits",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"FAQ",permalink:"/docs/use-cases/faq"},next:{title:"AI Interior Design",permalink:"/docs/use-cases/room-redesign"}},p={},o=[{value:"Overview",id:"overview",level:2},{value:"Example prompt",id:"example-prompt",level:2},{value:"API usage",id:"api-usage",level:3}],g={toc:o},c="wrapper";function u(t){let{components:e,...s}=t;return(0,r.kt)(c,(0,n.Z)({},g,s,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"masked-portraits"},"Masked portraits"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(8534).Z,width:"3456",height:"4320"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(4881).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(6871).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1337).Z,width:"2048",height:"2560"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(942).Z,width:"2304",height:"2880"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1971).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(9877).Z,width:"2048",height:"2560"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(5749).Z,width:"2048",height:"2560"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(7745).Z,width:"3024",height:"4032"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(9711).Z,width:"2048",height:"2688"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(7566).Z,width:"2048",height:"2688"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(4285).Z,width:"2048",height:"2688"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Input image"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"source.png",src:a(6586).Z,width:"6000",height:"4000"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Result using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/690204/prompts"},"RV v5.1")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(3349).Z,width:"3072",height:"2048"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/636337/prompts"},"Cartoon")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1089).Z,width:"3072",height:"2048"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Using ",(0,r.kt)("a",{href:"https://www.astria.ai/gallery/tunes/623021/prompts"},"Flat")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"generated.png",src:a(1514).Z,width:"3072",height:"2048"})))),(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=mask_prompt"},"gallery"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Use ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/prompt-masking"},"prompt masking")," feature to embed a person into a scene.\nThis essentially allows you to create AI photogarphy or avatars without fine-tuning."),(0,r.kt)("admonition",{type:"warning"},(0,r.kt)("p",{parentName:"admonition"},"SDXL inpainting results are poor. Use SD15 models instead.")),(0,r.kt)("p",null,"See ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,r.kt)("h2",{id:"example-prompt"},"Example prompt"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"realistic digital painting, astronaut in a garden on a spring day, by martine johanna and simon stalenhag and chie yoshii and casey weldon and wlop, ornate, dynamic, particulate, rich colors, intricate, elegant, highly detailed, harpers bazaar art, fashion magazine, smooth, sharp focus, 8 k, octane rende --mask_prompt foreground --mask_negative clothes --mask_invert --mask_dilate -20 --hires_denoising_strength 0.2\nnum_images=1\nnegative_prompt=clay, text, watermark, padding, cropped, typography\nseed=\nsteps=30\ncfg_scale=\ncontrolnet=pose\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/d6ff3soq5pok5tlbcanf599vkw06\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=false\nface_correct=true\nfilm_grain=false\nface_swap=false\nhires_fix=true\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")),(0,r.kt)("h3",{id:"api-usage"},"API usage"))}u.isMDXComponent=!0},8534:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-1-30b69f2c9a58c8a1f23456828c28c466.jpg"},942:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-2-7b8b5861fa50fc87b8e36b3153c879cd.jpg"},7745:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-3-0589d66f0f53258a32e5de0ef482f29e.jpg"},6586:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-input-4-b8bf227c6e5236b0d978f1ad0756d219.jpg"},4881:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-1-9db772635af3ec249fd3e8ebe9822ed8.jpeg"},1971:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-2-4a8bc5cca3803cf82043236295dfbf89.jpeg"},9711:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-3-380476a5d8fbabf4c8a20ed4d92e2db7.jpeg"},3349:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-4-f91c19288661030447e4b4e7ac1a211c.jpeg"},6871:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-1-56a489f7b7e42006cd95a2c561849da8.jpeg"},9877:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-2-887ab1b97bc8c2499f02a230e7125813.jpeg"},7566:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-3-bf4192f7ec3d086c3587d17d6d63e050.jpeg"},1089:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-art-4-b9dea5905f8c4e02ca9c77258b1c7058.jpeg"},1337:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-1-7139aa49335d33554f1576849e08ae59.jpeg"},5749:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-2-0f9ff603c09cf9b80380c61658572d21.jpeg"},4285:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-3-a546e7a92eb69b037149520ab9986a08.jpeg"},1514:(t,e,a)=>{a.d(e,{Z:()=>n});const n=a.p+"assets/images/masking-result-flat-4-36aa99d30a372ca38dbd7eea5bae29e7.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/dae0e962.935ba3c6.js b/assets/js/dae0e962.935ba3c6.js deleted file mode 100644 index d75c078e..00000000 --- a/assets/js/dae0e962.935ba3c6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1213],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>g});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),p=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(o.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(a),m=r,g=u["".concat(o,".").concat(m)]||u[m]||d[m]||l;return a?n.createElement(g,i(i({ref:t},c),{},{components:a})):n.createElement(g,i({ref:t},c))}));function g(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=m;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[u]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>b,frontMatter:()=>p,metadata:()=>u,toc:()=>m});var n=a(7462),r=(a(7294),a(3905));a(4996);const l=a.p+"assets/images/upscale-input-179b70105f9adc67180b6789f7f56553.jpg",i=a.p+"assets/images/upscale-result-3a748db52d0105807252262fcdfc5d05.jpg",s=a.p+"assets/images/upscale-lenna-in-bbba5c1db5c20f8aa84f4f7ce7f37763.png",o=(a.p,a.p+"assets/images/upscale-lenna-out2-3c908eb514c4734ff3df76c0c72b777c.jpg"),p={hide_table_of_contents:!0},c="Upscale",u={unversionedId:"use-cases/upscale",id:"use-cases/upscale",title:"Upscale",description:"BETA",source:"@site/docs/use-cases/upscale.md",sourceDirName:"use-cases",slug:"/use-cases/upscale",permalink:"/docs/use-cases/upscale",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"AI Interior Design",permalink:"/docs/use-cases/room-redesign"},next:{title:"Features",permalink:"/docs/category/features"}},d={},m=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],g=e=>function(t){return console.warn("Component "+e+" was not imported, exported, or provided by MDXProvider as global scope"),(0,r.kt)("div",t)},f=g("Tabs"),h=g("TabItem"),y={toc:m},k="wrapper";function b(e){let{components:t,...p}=e;return(0,r.kt)(k,(0,n.Z)({},y,p,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"upscale"},"Upscale"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-input",src:a(744).Z,width:"1152",height:"768"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-result",src:a(718).Z,width:"2048",height:"1366"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("div",{style:{backgroundImage:"url("+l+")",backgroundPosition:"50% 20%",backgroundSize:3e3,width:"100%",height:300}})),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("div",{style:{backgroundImage:"url('"+i+"')",backgroundPosition:"50% 20%",backgroundSize:3e3,width:"100%",height:300}}))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-input",src:a(6733).Z,width:"512",height:"512"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-result",src:a(7575).Z,width:"1024",height:"1024"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("div",{style:{backgroundImage:"url("+s+")",backgroundPosition:"50% 20%",backgroundSize:1e3,width:"100%",height:300}})),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("div",{style:{backgroundImage:"url('"+o+"')",backgroundPosition:"50% 20%",backgroundSize:1e3,width:"100%",height:300}}))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=only_upscale"},"gallery"),". Also check out ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/upscale"},"free upscaling tool page"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Upscaling uses model and text guidance to add details to original image. Depending on the ",(0,r.kt)("inlineCode",{parentName:"p"},"denoising_strength")," the model can hallucinate more details shifting away from the original image. For applying tiled upscaling straight after image generation see ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/tiled-upscale"},"tiled upscaling"),". "),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"In the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/prompts"},"prompts")," generate page - Set an input image in the Controlnet/img2img section."),(0,r.kt)("li",{parentName:"ol"},"Add a text prompt ending with ",(0,r.kt)("inlineCode",{parentName:"li"},"--only_upscale")),(0,r.kt)("li",{parentName:"ol"},"Select a model from the dropdown that matches the style and content of the input image.")),(0,r.kt)("h2",{id:"example"},"Example"),(0,r.kt)("p",null,"Example prompt for the result above"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"masterpiece, best quality, highres, --only_upscale\nnum_images=1\nnegative_prompt=(worst quality, low quality, normal quality:2) JuggernautNegative-neg\nseed=\nsteps=16\ncfg_scale=6.0\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/cvrx6g5wx5tbiuz9ivoah1j19why\nmask_image_url=\ndenoising_strength=0.1\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=1\nprompt_expansion=undefined\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=\nh=\n"))),(0,r.kt)("div",null,(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(f,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(h,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=very detailed, masterpiece, intricate details, UHD, 8K --only_upscale " \\\n -F prompt[negative_prompt]="lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(h,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale ');\nform.append('prompt[negative_prompt]', 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts');\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(h,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale ',\n 'prompt[negative_prompt]': 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts',\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}b.isMDXComponent=!0},744:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-input-179b70105f9adc67180b6789f7f56553.jpg"},6733:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-lenna-in-bbba5c1db5c20f8aa84f4f7ce7f37763.png"},7575:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-lenna-out2-3c908eb514c4734ff3df76c0c72b777c.jpg"},718:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-result-3a748db52d0105807252262fcdfc5d05.jpg"}}]); \ No newline at end of file diff --git a/assets/js/dae0e962.b845e406.js b/assets/js/dae0e962.b845e406.js new file mode 100644 index 00000000..468a222b --- /dev/null +++ b/assets/js/dae0e962.b845e406.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1213],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>g});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),p=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(o.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(a),m=r,g=u["".concat(o,".").concat(m)]||u[m]||d[m]||l;return a?n.createElement(g,i(i({ref:t},c),{},{components:a})):n.createElement(g,i({ref:t},c))}));function g(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,i=new Array(l);i[0]=m;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[u]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>b,frontMatter:()=>p,metadata:()=>u,toc:()=>m});var n=a(7462),r=(a(7294),a(3905));a(4996);const l=a.p+"assets/images/upscale-input-179b70105f9adc67180b6789f7f56553.jpg",i=a.p+"assets/images/upscale-result-3a748db52d0105807252262fcdfc5d05.jpg",s=a.p+"assets/images/upscale-lenna-in-bbba5c1db5c20f8aa84f4f7ce7f37763.png",o=(a.p,a.p+"assets/images/upscale-lenna-out2-3c908eb514c4734ff3df76c0c72b777c.jpg"),p={hide_table_of_contents:!0,image:"./img/upscale/upscale-lenna-out2.jpg"},c="Upscale",u={unversionedId:"use-cases/upscale",id:"use-cases/upscale",title:"Upscale",description:"BETA",source:"@site/docs/use-cases/upscale.md",sourceDirName:"use-cases",slug:"/use-cases/upscale",permalink:"/docs/use-cases/upscale",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0,image:"./img/upscale/upscale-lenna-out2.jpg"},sidebar:"tutorialSidebar",previous:{title:"AI Interior Design",permalink:"/docs/use-cases/room-redesign"},next:{title:"Features",permalink:"/docs/category/features"}},d={image:a(7575).Z},m=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],g=e=>function(t){return console.warn("Component "+e+" was not imported, exported, or provided by MDXProvider as global scope"),(0,r.kt)("div",t)},f=g("Tabs"),h=g("TabItem"),y={toc:m},k="wrapper";function b(e){let{components:t,...p}=e;return(0,r.kt)(k,(0,n.Z)({},y,p,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"upscale"},"Upscale"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-input",src:a(744).Z,width:"1152",height:"768"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-result",src:a(718).Z,width:"2048",height:"1366"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("div",{style:{backgroundImage:"url("+l+")",backgroundPosition:"50% 20%",backgroundSize:3e3,width:"100%",height:300}})),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("div",{style:{backgroundImage:"url('"+i+"')",backgroundPosition:"50% 20%",backgroundSize:3e3,width:"100%",height:300}}))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-input",src:a(6733).Z,width:"512",height:"512"}))),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("p",null,(0,r.kt)("img",{alt:"upscale-result",src:a(7575).Z,width:"1024",height:"1024"})))),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,"Low-res input"),(0,r.kt)("div",{style:{backgroundImage:"url("+s+")",backgroundPosition:"50% 20%",backgroundSize:1e3,width:"100%",height:300}})),(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=only_upscale"},"Upscaled result")),(0,r.kt)("div",{style:{backgroundImage:"url('"+o+"')",backgroundPosition:"50% 20%",backgroundSize:1e3,width:"100%",height:300}}))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=only_upscale"},"gallery"),". Also check out ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/upscale"},"free upscaling tool page"),"."),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"Upscaling uses model and text guidance to add details to original image. Depending on the ",(0,r.kt)("inlineCode",{parentName:"p"},"denoising_strength")," the model can hallucinate more details shifting away from the original image. For applying tiled upscaling straight after image generation see ",(0,r.kt)("a",{parentName:"p",href:"/docs/features/tiled-upscale"},"tiled upscaling"),". "),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"In the ",(0,r.kt)("a",{parentName:"li",href:"https://www.astria.ai/prompts"},"prompts")," generate page - Set an input image in the Controlnet/img2img section."),(0,r.kt)("li",{parentName:"ol"},"Add a text prompt ending with ",(0,r.kt)("inlineCode",{parentName:"li"},"--only_upscale")),(0,r.kt)("li",{parentName:"ol"},"Select a model from the dropdown that matches the style and content of the input image.")),(0,r.kt)("h2",{id:"example"},"Example"),(0,r.kt)("p",null,"Example prompt for the result above"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-text"},"masterpiece, best quality, highres, --only_upscale\nnum_images=1\nnegative_prompt=(worst quality, low quality, normal quality:2) JuggernautNegative-neg\nseed=\nsteps=16\ncfg_scale=6.0\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/cvrx6g5wx5tbiuz9ivoah1j19why\nmask_image_url=\ndenoising_strength=0.1\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=1\nprompt_expansion=undefined\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=\nh=\n"))),(0,r.kt)("div",null,(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(f,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(h,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=very detailed, masterpiece, intricate details, UHD, 8K --only_upscale " \\\n -F prompt[negative_prompt]="lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts" \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(h,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale ');\nform.append('prompt[negative_prompt]', 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts');\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(h,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale ',\n 'prompt[negative_prompt]': 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts',\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}b.isMDXComponent=!0},744:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-input-179b70105f9adc67180b6789f7f56553.jpg"},6733:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-lenna-in-bbba5c1db5c20f8aa84f4f7ce7f37763.png"},7575:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-lenna-out2-3c908eb514c4734ff3df76c0c72b777c.jpg"},718:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/upscale-result-3a748db52d0105807252262fcdfc5d05.jpg"}}]); \ No newline at end of file diff --git a/assets/js/ddb99303.0263c37f.js b/assets/js/ddb99303.0263c37f.js deleted file mode 100644 index 818b0522..00000000 --- a/assets/js/ddb99303.0263c37f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[297],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),u=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(n),m=r,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,s(s({ref:t},p),{},{components:n})):a.createElement(h,s({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,s=new Array(o);s[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:r,s[1]=i;for(var u=2;u{n.d(t,{Z:()=>s});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function s(e){let{children:t,hidden:n,className:s}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,s),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7462),r=n(7294),o=n(6010),s=n(2466),i=n(6550),l=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[l,u]=h({queryString:n,groupId:a}),[c,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,p.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=l??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var g=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function k(e){let{className:t,block:n,selectedValue:i,selectValue:l,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.o5)(),d=e=>{const t=e.currentTarget,n=p.indexOf(t),a=u[n].value;a!==i&&(c(t),l(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:s}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},s,{className:(0,o.Z)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":i===t})}),n??t)})))}function _(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function w(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(k,(0,a.Z)({},e,t)),r.createElement(_,(0,a.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(w,(0,a.Z)({key:String(t)},e))}},7580:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),s=n(5162);const i={hide_table_of_contents:!0},l="FaceID for Flux",u={unversionedId:"features/faceid-flux",id:"features/faceid-flux",title:"FaceID for Flux",description:"BETA",source:"@site/docs/features/faceid-flux.md",sourceDirName:"features",slug:"/features/faceid-flux",permalink:"/docs/features/faceid-flux",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"Face Swap",permalink:"/docs/features/face-swap"},next:{title:"FaceID",permalink:"/docs/features/faceid"}},p={},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Notes",id:"notes",level:2},{value:"API",id:"api",level:2},{value:"Step 1: Create fine-tune",id:"step-1-create-fine-tune",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Response",id:"response",level:4},{value:"Step 2: Create prompts",id:"step-2-create-prompts",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"faceid-for-flux"},"FaceID for Flux"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"FaceID")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(2558).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(8912).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(5533).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(2889).Z,width:"896",height:"1152"})))))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready.\n",(0,r.kt)("img",{alt:"faceid-new-fine-tune.png",src:n(1158).Z,width:"740",height:"544"})),(0,r.kt)("li",{parentName:"ol"},"Generate the image using the FaceID adapter using a syntax similar to LoRA - ",(0,r.kt)("inlineCode",{parentName:"li"},"")," ")),(0,r.kt)("h2",{id:"notes"},"Notes"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"For realistic images, please consider enabling face-correct to improve facial features.")),(0,r.kt)("h2",{id:"api"},"API"),(0,r.kt)("p",null,"FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery.\nThe fine-tune's ",(0,r.kt)("inlineCode",{parentName:"p"},"trained_at")," is set upon creation and there is no training time. As such no callback is needed.")),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-create-fine-tune"},"Step 1: Create fine-tune"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(s.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/690204/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "John Doe - UUID - 1234-6789-1234-56789",\n "name": "man",\n "model_type": "faceid",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(s.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n \"base_tune_id\": 690204,\n \"name\": \"man\",\n \"model_type\": \"faceid\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ]\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch()\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n formData.append('tune[model_type]', 'faceid');\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n formData.append('tune[base_tune_id]', 690204);\n formData.append('tune[name]', 'man');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(s.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `tune.images` are already defined in your context\n# If not, you should define them before the below code\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[base_tune_id]": 690204,\n "tune[model_type]": "faceid",\n "tune[token]": "ohwx"\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h4",{id:"response"},"Response"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'\n[\n {\n "id": 1,\n "title": "John Doe",\n "name": "woman",\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": false,\n "ckpt_url": null,\n "ckpt_urls": [],\n "eta": "2023-10-02T14:32:40.363Z",\n "trained_at": "2023-10-02T14:32:40.363Z",\n "started_training_at": "2023-10-02T14:32:05.229Z",\n "expires_at": "2023-11-01T14:32:40.363Z",\n "created_at": "2023-10-02T14:32:05.067Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-10-02T14:32:40.363Z",\n "url": "https://www.astria.ai/tunes/788416.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n },\n {\n "id": 775459,\n "title": "Marry Jane",\n "name": null,\n "is_api": false,\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": null,\n "ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",\n "ckpt_urls": [\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ],\n "eta": "2023-09-23T16:07:49.137Z",\n "trained_at": "2023-09-23T16:07:49.137Z",\n "started_training_at": "2023-09-23T16:07:37.334Z",\n "expires_at": "2023-10-23T16:07:49.137Z",\n "created_at": "2023-09-23T16:07:36.606Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-09-23T16:07:49.138Z",\n "url": "https://www.astria.ai/tunes/775459.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n }\n ]\n')),(0,r.kt)("h3",{id:"step-2-create-prompts"},"Step 2: Create prompts"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(s.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 150494 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=" woman trekking in the alps" \\\n -F prompt[negative_prompt]="" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[face_swap]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(s.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' woman trekking in the alps');\nform.append('prompt[negative_prompt]', '');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[face_swap]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(s.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' woman trekking in the alps',\n 'prompt[negative_prompt]': '',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[face_swap]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0},2558:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-1-f3f12906fda7b314452f03151c5345ae.jpg"},8912:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-2-b65bcd975d60e06c8b4b03ce2ca5e468.jpg"},5533:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-3-ae5a9d8dfd3a7497e062184c3c43317d.jpg"},2889:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-4-980af874c9608220fdf738b6468a07e9.jpg"},1158:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-new-fine-tune-cc128107ac919832509e97a8ca45918b.png"}}]); \ No newline at end of file diff --git a/assets/js/ddb99303.0a07bd97.js b/assets/js/ddb99303.0a07bd97.js new file mode 100644 index 00000000..c28aca21 --- /dev/null +++ b/assets/js/ddb99303.0a07bd97.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[297],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),u=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(n),m=r,h=c["".concat(l,".").concat(m)]||c[m]||d[m]||o;return n?a.createElement(h,s(s({ref:t},p),{},{components:n})):a.createElement(h,s({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,s=new Array(o);s[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[c]="string"==typeof e?e:r,s[1]=i;for(var u=2;u{n.d(t,{Z:()=>s});var a=n(7294),r=n(6010);const o={tabItem:"tabItem_Ymn6"};function s(e){let{children:t,hidden:n,className:s}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,s),hidden:n},t)}},4866:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(7462),r=n(7294),o=n(6010),s=n(2466),i=n(6550),l=n(1980),u=n(7392),p=n(12);function c(e){return function(e){return r.Children.map(e,(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??c(n);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function m(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l._X)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=d(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[l,u]=h({queryString:n,groupId:a}),[c,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,p.Nk)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=l??c;return m({value:e,tabValues:o})?e:null})();(0,r.useLayoutEffect)((()=>{g&&i(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),f(e)}),[u,f,o]),tabValues:o}}var g=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function k(e){let{className:t,block:n,selectedValue:i,selectValue:l,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.o5)(),d=e=>{const t=e.currentTarget,n=p.indexOf(t),a=u[n].value;a!==i&&(c(t),l(a))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=p.indexOf(e.currentTarget)+1;t=p[n]??p[0];break}case"ArrowLeft":{const n=p.indexOf(e.currentTarget)-1;t=p[n]??p[p.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},u.map((e=>{let{value:t,label:n,attributes:s}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},s,{className:(0,o.Z)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":i===t})}),n??t)})))}function _(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function w(e){const t=f(e);return r.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},r.createElement(k,(0,a.Z)({},e,t)),r.createElement(_,(0,a.Z)({},e,t)))}function y(e){const t=(0,g.Z)();return r.createElement(w,(0,a.Z)({key:String(t)},e))}},7580:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var a=n(7462),r=(n(7294),n(3905)),o=n(4866),s=n(5162);const i={hide_table_of_contents:!0,image:"./img/faceid-flux/faceid-flux-1.jpg"},l="FaceID for Flux",u={unversionedId:"features/faceid-flux",id:"features/faceid-flux",title:"FaceID for Flux",description:"BETA",source:"@site/docs/features/faceid-flux.md",sourceDirName:"features",slug:"/features/faceid-flux",permalink:"/docs/features/faceid-flux",draft:!1,tags:[],version:"current",frontMatter:{hide_table_of_contents:!0,image:"./img/faceid-flux/faceid-flux-1.jpg"},sidebar:"tutorialSidebar",previous:{title:"Face Swap",permalink:"/docs/features/face-swap"},next:{title:"FaceID",permalink:"/docs/features/faceid"}},p={image:n(2558).Z},c=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Notes",id:"notes",level:2},{value:"API",id:"api",level:2},{value:"Step 1: Create fine-tune",id:"step-1-create-fine-tune",level:3},{value:"POST /tunes",id:"post-tunes",level:4},{value:"Response",id:"response",level:4},{value:"Step 2: Create prompts",id:"step-2-create-prompts",level:3},{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function h(e){let{components:t,...i}=e;return(0,r.kt)(m,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"faceid-for-flux"},"FaceID for Flux"),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"BETA")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("figcaption",null,(0,r.kt)("a",{href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"FaceID")),(0,r.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(2558).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(8912).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(5533).Z,width:"896",height:"1152"}))),(0,r.kt)("div",null,(0,r.kt)("p",null,(0,r.kt)("img",{alt:"faceid-output.png",src:n(2889).Z,width:"896",height:"1152"})))))),(0,r.kt)("div",{className:"api-method"},(0,r.kt)("div",null,(0,r.kt)("p",null,"See example prompts in the ",(0,r.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?text=faceid&branch=flux1"},"gallery")),(0,r.kt)("h2",{id:"overview"},"Overview"),(0,r.kt)("p",null,"FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects."),(0,r.kt)("h2",{id:"usage"},"Usage"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready.\n",(0,r.kt)("img",{alt:"faceid-new-fine-tune.png",src:n(1158).Z,width:"740",height:"544"})),(0,r.kt)("li",{parentName:"ol"},"Generate the image using the FaceID adapter using a syntax similar to LoRA - ",(0,r.kt)("inlineCode",{parentName:"li"},"")," ")),(0,r.kt)("h2",{id:"notes"},"Notes"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"For realistic images, please consider enabling face-correct to improve facial features.")),(0,r.kt)("h2",{id:"api"},"API"),(0,r.kt)("p",null,"FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery.\nThe fine-tune's ",(0,r.kt)("inlineCode",{parentName:"p"},"trained_at")," is set upon creation and there is no training time. As such no callback is needed.")),(0,r.kt)("div",null,(0,r.kt)("h3",{id:"step-1-create-fine-tune"},"Step 1: Create fine-tune"),(0,r.kt)("h4",{id:"post-tunes"},"POST /tunes"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(s.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# With images as multipart/form-data\n# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n# https://www.astria.ai/gallery/tunes/690204/prompts\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[images][]=@1.jpg" \\\n -F "tune[images][]=@2.jpg" \\\n -F "tune[images][]=@3.jpg" \\\n -F "tune[images][]=@4.jpg"\n\n# With image_urls as form-data\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \\\n -F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \\\n -F tune[name]=man \\\n -F tune[model_type]="faceid" \\\n -F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \\\n -F tune[base_tune_id]=690204 \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \\\n -F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"\n \n# As JSON\ncat > data.json <<- EOM\n{\n "tune": {\n "title": "John Doe - UUID - 1234-6789-1234-56789",\n "name": "man",\n "model_type": "faceid",\n "callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",\n "image_urls": [\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg",\n "https://i.imgur.com/HLHBnl9.jpeg"\n ]\n }\n}\nEOM\n\ncurl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes \n'))),(0,r.kt)(s.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"// NodeJS 16\n// With image_urls and fetch()\n// For NodeJS 18 - do NOT import the below as it is built-in\nimport fetch from \"node-fetch\";\n\nconst API_KEY = 'sd_XXXXXX';\nconst DOMAIN = 'https://api.astria.ai';\n\nfunction createTune() {\n let options = {\n method: 'POST',\n headers: { 'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n tune: {\n \"title\": 'John Doe - UUID - 1234-6789-1234-56789',\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n \"base_tune_id\": 690204,\n \"name\": \"man\",\n \"model_type\": \"faceid\",\n \"image_urls\": [\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\",\n \"https://i.imgur.com/HLHBnl9.jpeg\"\n ]\n }\n })\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r))\n}\n\ncreateTune()\n\n\n/// With form-data, fetch()\n// For NodeJS 18 - do NOT import the two below as they are built-in\nimport fetch from \"node-fetch\";\nimport FormData from 'form-data';\nimport fs from 'fs';\n\nconst API_KEY = 'sd_XXXX';\nconst DOMAIN = 'https://api.astria.ai';\nfunction createTune() {\n let formData = new FormData();\n formData.append('tune[title]', 'John Doe - UUID - 1234-6789-1234-56789');\n formData.append('tune[model_type]', 'faceid');\n // Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes \n // https://www.astria.ai/gallery/tunes/690204/prompts\n formData.append('tune[base_tune_id]', 690204);\n formData.append('tune[name]', 'man');\n // Load all JPGs from ./samples directory and append to FormData\n let files = fs.readdirSync('./samples');\n files.forEach(file => {\n if(file.endsWith('.jpg')) {\n formData.append('tune[images][]', fs.createReadStream(`./samples/${file}`), file);\n }\n });\n formData.append('tune[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1');\n\n let options = {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + API_KEY\n },\n body: formData\n };\n return fetch(DOMAIN + '/tunes', options)\n .then(r => r.json())\n .then(r => console.log(r));\n}\n\ncreateTune();\n\n"))),(0,r.kt)(s.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'import requests\nheaders = {\'Authorization\': f\'Bearer {API_KEY}\'}\n\ndef load_image(file_path):\n with open(file_path, "rb") as f:\n return f.read()\n\n# Assuming `tune.images` are already defined in your context\n# If not, you should define them before the below code\n\nimage_data = load_image("assets/image.jpeg")\n\ndata = {\n "tune[title]": "John Doe - UUID - 1234-6789-1234-56789",\n "tune[name]": "man",\n "tune[base_tune_id]": 690204,\n "tune[model_type]": "faceid",\n "tune[token]": "ohwx"\n}\nfiles = []\n\nfor image in tune.images:\n image_data = load_image(image) # Assuming image is a file path\n files.append(("tune[images][]", image_data))\n\nAPI_URL = \'https://api.astria.ai/tunes\'\nresponse = requests.post(API_URL, data=data, files=files, headers=headers)\nresponse.raise_for_status()\n\n')))),(0,r.kt)("h4",{id:"response"},"Response"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-json"},'\n[\n {\n "id": 1,\n "title": "John Doe",\n "name": "woman",\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": false,\n "ckpt_url": null,\n "ckpt_urls": [],\n "eta": "2023-10-02T14:32:40.363Z",\n "trained_at": "2023-10-02T14:32:40.363Z",\n "started_training_at": "2023-10-02T14:32:05.229Z",\n "expires_at": "2023-11-01T14:32:40.363Z",\n "created_at": "2023-10-02T14:32:05.067Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-10-02T14:32:40.363Z",\n "url": "https://www.astria.ai/tunes/788416.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n },\n {\n "id": 775459,\n "title": "Marry Jane",\n "name": null,\n "is_api": false,\n "token": "ohwx",\n "base_tune_id": null,\n "args": null,\n "steps": null,\n "face_crop": null,\n "training_face_correct": null,\n "ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",\n "ckpt_urls": [\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ],\n "eta": "2023-09-23T16:07:49.137Z",\n "trained_at": "2023-09-23T16:07:49.137Z",\n "started_training_at": "2023-09-23T16:07:37.334Z",\n "expires_at": "2023-10-23T16:07:49.137Z",\n "created_at": "2023-09-23T16:07:36.606Z",\n "branch": "sd15",\n "model_type": "faceid",\n "updated_at": "2023-09-23T16:07:49.138Z",\n "url": "https://www.astria.ai/tunes/775459.json",\n "orig_images": [\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock",\n "https://sdbooth2-production.s3.amazonaws.com/mock"\n ]\n }\n ]\n')),(0,r.kt)("h3",{id:"step-2-create-prompts"},"Step 2: Create prompts"),(0,r.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,r.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,r.kt)(s.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 150494 which is the tune_id of Realistic Vision v5.1 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \\\n -F prompt[text]=" woman trekking in the alps" \\\n -F prompt[negative_prompt]="" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[face_swap]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,r.kt)(s.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/690204/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' woman trekking in the alps');\nform.append('prompt[negative_prompt]', '');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[face_swap]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,r.kt)(s.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/690204/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' woman trekking in the alps',\n 'prompt[negative_prompt]': '',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[face_swap]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}h.isMDXComponent=!0},2558:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-1-f3f12906fda7b314452f03151c5345ae.jpg"},8912:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-2-b65bcd975d60e06c8b4b03ce2ca5e468.jpg"},5533:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-3-ae5a9d8dfd3a7497e062184c3c43317d.jpg"},2889:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-flux-4-980af874c9608220fdf738b6468a07e9.jpg"},1158:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/faceid-new-fine-tune-cc128107ac919832509e97a8ca45918b.png"}}]); \ No newline at end of file diff --git a/assets/js/e2fc4889.7a57e9f7.js b/assets/js/e2fc4889.7a57e9f7.js deleted file mode 100644 index 17b005a9..00000000 --- a/assets/js/e2fc4889.7a57e9f7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6995],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(n),d=a,g=c["".concat(s,".").concat(d)]||c[d]||m[d]||i;return n?r.createElement(g,o(o({ref:t},u),{},{components:n})):r.createElement(g,o({ref:t},u))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={title:"Multi-Person"},o="Multi-Person inference",l={unversionedId:"features/multiperson",id:"features/multiperson",title:"Multi-Person",description:"BETA",source:"@site/docs/features/multiperson.md",sourceDirName:"features",slug:"/features/multiperson",permalink:"/docs/features/multiperson",draft:!1,tags:[],version:"current",frontMatter:{title:"Multi-Person"},sidebar:"tutorialSidebar",previous:{title:"LoRA",permalink:"/docs/features/lora"},next:{title:"Flux Outpainting",permalink:"/docs/features/outpainting"}},s={},p=[{value:"Overview",id:"overview",level:2},{value:"Step 1: Training",id:"step-1-training",level:3},{value:"Step 2 - Inference",id:"step-2---inference",level:3},{value:"Examples",id:"examples",level:2},{value:"1. Without an input image",id:"1-without-an-input-image",level:3},{value:"3. Prompt with input image as a background",id:"3-prompt-with-input-image-as-a-background",level:3}],u={toc:p},c="wrapper";function m(e){let{components:t,...i}=e;return(0,a.kt)(c,(0,r.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"multi-person-inference"},"Multi-Person inference"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"BETA")),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:n(6917).Z,width:"1360",height:"768"})))),(0,a.kt)("p",null,"See example prompts in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?is_multiperson=true&branch=flux1"},"gallery")),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"Multi-person inference is a feature that allows you to generate images with multiple people in them.\nSee example prompts in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?is_multiperson=true&branch=flux1"},"gallery")," or in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/community?is_multiperson=true&branch=flux1"},"community feed"),"."),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,a.kt)("h3",{id:"step-1-training"},"Step 1: Training"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/tunes/new"},"Create a fine-tune")," for each person. Model can be either lora or a checkpoint."),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"img.png",src:n(368).Z,width:"751",height:"563"})),(0,a.kt)("h3",{id:"step-2---inference"},"Step 2 - Inference"),(0,a.kt)("p",null,"Provide an ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"controlnet=pose")," so that the generation has a solid image composition to start with.\nIf no ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," is given, a constant pose input image (with arms crossed) will be used for each person."),(0,a.kt)("p",null,"The prompt is divided by the ",(0,a.kt)("inlineCode",{parentName:"p"},"BREAK")," keyword such as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"1st ",(0,a.kt)("strong",{parentName:"li"},"base prompt")," used to generate the background and scene."),(0,a.kt)("li",{parentName:"ul"},"2nd ",(0,a.kt)("strong",{parentName:"li"},"common prompt")," that's concatenated to each person prompt and the base prompt to avoid repetition."),(0,a.kt)("li",{parentName:"ul"},"3+ each person and its LoRA syntax reference (even for checkpoint)")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("h3",{id:"1-without-an-input-image"},"1. Without an input image"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"0.5fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:n(6917).Z,width:"1360",height:"768"})))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"Dramatic 1940s film noir scene. Couple standing together aiming guns, wooden paneled background.\nBREAK\nBREAK ohwx woman with determined expression, retro updo hairstyle, bright red lipstick, black and yellow color-blocked dress, aiming revolver with right hand\nBREAK ohwx man with serious face, grey fedora hat, brown suit with patterned tie, white shirt, aiming pistol with left hand\nnum_images=4\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=1\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=576\n")),(0,a.kt)("h3",{id:"3-prompt-with-input-image-as-a-background"},"3. Prompt with input image as a background"),(0,a.kt)("p",null,"In some cases it might be desired to keep the exact same background as the input image, and only change the people in the image. To do this, add an ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," and keep the base prompt empty, i.e: start the prompt with ",(0,a.kt)("inlineCode",{parentName:"p"},"BREAK BREAK")," to keep both the base and common prompts empty."),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"0.5fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Pose input image"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"multiperson-txt2img-pose.jpg",src:n(840).Z,width:"863",height:"863"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"multiperson-txt2img-pose.jpg",src:n(1193).Z,width:"948",height:"947"})))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"BREAK \nBREAK ohwx woman, red blouse jeans, and belt, holding a rifle \nBREAK ohwx man, dark vest \nnum_images=4\nnegative_prompt=\nseed=43\nsteps=30\ncfg_scale=\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/4j0pej570oosmbj22xx6igf3gfi2\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=true\nhires_fix=true\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")))}m.isMDXComponent=!0},368:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-training-4568726f76653fd3e79915b003dbb259.png"},6917:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-29433c8b0c0b9d8b7265517605a54c1d.jpg"},1193:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-no-base-prompt-aec03b14af49a52e88ae822b1afe5905.jpg"},840:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-pose-back-to-back-45b9a68c860ba481eeaf646f27e82bc8.webp"}}]); \ No newline at end of file diff --git a/assets/js/e2fc4889.98855dae.js b/assets/js/e2fc4889.98855dae.js new file mode 100644 index 00000000..4ff17c38 --- /dev/null +++ b/assets/js/e2fc4889.98855dae.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6995],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>d});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),c=p(n),g=a,d=c["".concat(s,".").concat(g)]||c[g]||m[g]||i;return n?r.createElement(d,o(o({ref:t},u),{},{components:n})):r.createElement(d,o({ref:t},u))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=g;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var r=n(7462),a=(n(7294),n(3905));const i={title:"Multi-Person",image:"./img/multiperson.jpg"},o="Multi-Person inference",l={unversionedId:"features/multiperson",id:"features/multiperson",title:"Multi-Person",description:"BETA",source:"@site/docs/features/multiperson.md",sourceDirName:"features",slug:"/features/multiperson",permalink:"/docs/features/multiperson",draft:!1,tags:[],version:"current",frontMatter:{title:"Multi-Person",image:"./img/multiperson.jpg"},sidebar:"tutorialSidebar",previous:{title:"LoRA",permalink:"/docs/features/lora"},next:{title:"Flux Outpainting",permalink:"/docs/features/outpainting"}},s={image:n(6917).Z},p=[{value:"Overview",id:"overview",level:2},{value:"Step 1: Training",id:"step-1-training",level:3},{value:"Step 2 - Inference",id:"step-2---inference",level:3},{value:"Examples",id:"examples",level:2},{value:"1. Without an input image",id:"1-without-an-input-image",level:3},{value:"3. Prompt with input image as a background",id:"3-prompt-with-input-image-as-a-background",level:3}],u={toc:p},c="wrapper";function m(e){let{components:t,...i}=e;return(0,a.kt)(c,(0,r.Z)({},u,i,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"multi-person-inference"},"Multi-Person inference"),(0,a.kt)("p",null,(0,a.kt)("strong",{parentName:"p"},"BETA")),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:n(6917).Z,width:"1360",height:"768"})))),(0,a.kt)("p",null,"See example prompts in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?is_multiperson=true&branch=flux1"},"gallery")),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"Multi-person inference is a feature that allows you to generate images with multiple people in them.\nSee example prompts in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?is_multiperson=true&branch=flux1"},"gallery")," or in the ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/community?is_multiperson=true&branch=flux1"},"community feed"),"."),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/pricing"},"pricing")," for the cost of this feature."),(0,a.kt)("h3",{id:"step-1-training"},"Step 1: Training"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/tunes/new"},"Create a fine-tune")," for each person. Model can be either lora or a checkpoint."),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"img.png",src:n(368).Z,width:"751",height:"563"})),(0,a.kt)("h3",{id:"step-2---inference"},"Step 2 - Inference"),(0,a.kt)("p",null,"Provide an ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"controlnet=pose")," so that the generation has a solid image composition to start with.\nIf no ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," is given, a constant pose input image (with arms crossed) will be used for each person."),(0,a.kt)("p",null,"The prompt is divided by the ",(0,a.kt)("inlineCode",{parentName:"p"},"BREAK")," keyword such as:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"1st ",(0,a.kt)("strong",{parentName:"li"},"base prompt")," used to generate the background and scene."),(0,a.kt)("li",{parentName:"ul"},"2nd ",(0,a.kt)("strong",{parentName:"li"},"common prompt")," that's concatenated to each person prompt and the base prompt to avoid repetition."),(0,a.kt)("li",{parentName:"ul"},"3+ each person and its LoRA syntax reference (even for checkpoint)")),(0,a.kt)("h2",{id:"examples"},"Examples"),(0,a.kt)("h3",{id:"1-without-an-input-image"},"1. Without an input image"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"0.5fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:n(6917).Z,width:"1360",height:"768"})))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"Dramatic 1940s film noir scene. Couple standing together aiming guns, wooden paneled background.\nBREAK\nBREAK ohwx woman with determined expression, retro updo hairstyle, bright red lipstick, black and yellow color-blocked dress, aiming revolver with right hand\nBREAK ohwx man with serious face, grey fedora hat, brown suit with patterned tie, white shirt, aiming pistol with left hand\nnum_images=4\nnegative_prompt=\nseed=\nsteps=\ncfg_scale=\ncontrolnet=\ninput_image_url=\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=false\ninpaint_faces=false\nface_correct=false\nfilm_grain=false\nface_swap=false\nhires_fix=false\nbackend_version=1\nar=1:1\nscheduler=euler_a\ncolor_grading=\nuse_lpw=false\nw=1024\nh=576\n")),(0,a.kt)("h3",{id:"3-prompt-with-input-image-as-a-background"},"3. Prompt with input image as a background"),(0,a.kt)("p",null,"In some cases it might be desired to keep the exact same background as the input image, and only change the people in the image. To do this, add an ",(0,a.kt)("inlineCode",{parentName:"p"},"input_image")," and keep the base prompt empty, i.e: start the prompt with ",(0,a.kt)("inlineCode",{parentName:"p"},"BREAK BREAK")," to keep both the base and common prompts empty."),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"0.5fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Pose input image"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"multiperson-txt2img-pose.jpg",src:n(840).Z,width:"863",height:"863"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Multiperson result"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"multiperson-txt2img-pose.jpg",src:n(1193).Z,width:"948",height:"947"})))),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-text"},"BREAK \nBREAK ohwx woman, red blouse jeans, and belt, holding a rifle \nBREAK ohwx man, dark vest \nnum_images=4\nnegative_prompt=\nseed=43\nsteps=30\ncfg_scale=\ncontrolnet=\ninput_image_url=https://sdbooth2-production.s3.amazonaws.com/4j0pej570oosmbj22xx6igf3gfi2\nmask_image_url=\ndenoising_strength=\ncontrolnet_conditioning_scale=\ncontrolnet_txt2img=false\nsuper_resolution=true\ninpaint_faces=true\nface_correct=false\nfilm_grain=false\nface_swap=true\nhires_fix=true\nar=1:1\nscheduler=dpm++sde_karras\ncolor_grading=\nuse_lpw=true\nw=\nh=\n")))}m.isMDXComponent=!0},368:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-training-4568726f76653fd3e79915b003dbb259.png"},6917:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-29433c8b0c0b9d8b7265517605a54c1d.jpg"},1193:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-no-base-prompt-aec03b14af49a52e88ae822b1afe5905.jpg"},840:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/multiperson-pose-back-to-back-45b9a68c860ba481eeaf646f27e82bc8.webp"}}]); \ No newline at end of file diff --git a/assets/js/e4fcfa79.5a7070ba.js b/assets/js/e4fcfa79.5a7070ba.js new file mode 100644 index 00000000..03774037 --- /dev/null +++ b/assets/js/e4fcfa79.5a7070ba.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[8772],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>g});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),p=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},s=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,s=i(e,["components","mdxType","originalType","parentName"]),u=p(r),m=o,g=u["".concat(l,".").concat(m)]||u[m]||d[m]||a;return r?n.createElement(g,c(c({ref:t},s),{},{components:r})):n.createElement(g,c({ref:t},s))}));function g(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,c=new Array(a);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[u]="string"==typeof e?e:o,c[1]=i;for(var p=2;p{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>p});var n=r(7462),o=(r(7294),r(3905));const a={title:"Product placement",tags:["ecommerce","background replacement","products","Shopify","photo optimization","product photo"],hide_table_of_contents:!0,image:"./img/product-placement-background-replacement-shoe-out1.jpeg"},c="Product placement for Ecommerce",i={unversionedId:"use-cases/product-shots",id:"use-cases/product-shots",title:"Product placement",description:"Background replacement",source:"@site/docs/use-cases/40-product-shots.md",sourceDirName:"use-cases",slug:"/use-cases/product-shots",permalink:"/docs/use-cases/product-shots",draft:!1,tags:[{label:"ecommerce",permalink:"/docs/tags/ecommerce"},{label:"background replacement",permalink:"/docs/tags/background-replacement"},{label:"products",permalink:"/docs/tags/products"},{label:"Shopify",permalink:"/docs/tags/shopify"},{label:"photo optimization",permalink:"/docs/tags/photo-optimization"},{label:"product photo",permalink:"/docs/tags/product-photo"}],version:"current",sidebarPosition:40,frontMatter:{title:"Product placement",tags:["ecommerce","background replacement","products","Shopify","photo optimization","product photo"],hide_table_of_contents:!0,image:"./img/product-placement-background-replacement-shoe-out1.jpeg"},sidebar:"tutorialSidebar",previous:{title:"Virtual Try-on for Flux",permalink:"/docs/use-cases/virtual-try-on"},next:{title:"Toonify",permalink:"/docs/use-cases/toonify"}},l={image:r(3373).Z},p=[{value:"Background replacement",id:"background-replacement",level:2},{value:"Overview",id:"overview",level:2}],s={toc:p},u="wrapper";function d(e){let{components:t,...a}=e;return(0,o.kt)(u,(0,n.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"product-placement-for-ecommerce"},"Product placement for Ecommerce"),(0,o.kt)("h2",{id:"background-replacement"},"Background replacement"),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"Background replacement can be used for e-commerce product short, marketing campaigns and achieving compelling visuals. In this process the existing background is removed and a new background is generated using the prompt text. Using ",(0,o.kt)("inlineCode",{parentName:"p"},"relight")," controlnet we can blend the product with the new background to achieve realistic results."),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Input image of bottle of whiskey",src:r(6595).Z,width:"580",height:"580"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with controlnet relight"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bottle of whiskey background replacement",src:r(2609).Z,width:"512",height:"512"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with controlnet relight"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bottle of whiskey background replacement",src:r(7886).Z,width:"768",height:"768"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Input image of a shoe",src:r(2265).Z,width:"580",height:"580"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Shoe with background replacement of a forest",src:r(3373).Z,width:"768",height:"768"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Shoe with background replacement of snow",src:r(7023).Z,width:"768",height:"768"})))),(0,o.kt)("p",null,"See example prompts in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?controlnet=relight"},"gallery"),"."))}d.isMDXComponent=!0},6595:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-input1-ade7c2a702cccd5e3b429fb746ad37f5.png"},2265:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-input2-2ae76b239f75d4ca95e8575c1b720fcb.png"},3373:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-shoe-out1-15a16a6f6fbe8311f810fb41e9817f8e.jpeg"},7023:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-shoe-out2-9db7f3cb72d61b6226f4790b38c3f798.jpeg"},2609:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-whiskey-out1-3af1e7835749d82838657b97cbc907ff.jpeg"},7886:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-whiskey-out2-5e923f067c8c7cd59ec1c81f49e9aebe.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/e4fcfa79.933a749b.js b/assets/js/e4fcfa79.933a749b.js deleted file mode 100644 index 68826e3e..00000000 --- a/assets/js/e4fcfa79.933a749b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[8772],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>g});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),p=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},s=function(e){var t=p(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,s=i(e,["components","mdxType","originalType","parentName"]),u=p(r),m=o,g=u["".concat(l,".").concat(m)]||u[m]||d[m]||a;return r?n.createElement(g,c(c({ref:t},s),{},{components:r})):n.createElement(g,c({ref:t},s))}));function g(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,c=new Array(a);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[u]="string"==typeof e?e:o,c[1]=i;for(var p=2;p{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>p});var n=r(7462),o=(r(7294),r(3905));const a={title:"Product placement",tags:["ecommerce","background replacement","products","Shopify","photo optimization","product photo"],hide_table_of_contents:!0},c="Product placement for Ecommerce",i={unversionedId:"use-cases/product-shots",id:"use-cases/product-shots",title:"Product placement",description:"Background replacement",source:"@site/docs/use-cases/40-product-shots.md",sourceDirName:"use-cases",slug:"/use-cases/product-shots",permalink:"/docs/use-cases/product-shots",draft:!1,tags:[{label:"ecommerce",permalink:"/docs/tags/ecommerce"},{label:"background replacement",permalink:"/docs/tags/background-replacement"},{label:"products",permalink:"/docs/tags/products"},{label:"Shopify",permalink:"/docs/tags/shopify"},{label:"photo optimization",permalink:"/docs/tags/photo-optimization"},{label:"product photo",permalink:"/docs/tags/product-photo"}],version:"current",sidebarPosition:40,frontMatter:{title:"Product placement",tags:["ecommerce","background replacement","products","Shopify","photo optimization","product photo"],hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"Virtual Try-on for Flux",permalink:"/docs/use-cases/virtual-try-on"},next:{title:"Toonify",permalink:"/docs/use-cases/toonify"}},l={},p=[{value:"Background replacement",id:"background-replacement",level:2},{value:"Overview",id:"overview",level:2}],s={toc:p},u="wrapper";function d(e){let{components:t,...a}=e;return(0,o.kt)(u,(0,n.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"product-placement-for-ecommerce"},"Product placement for Ecommerce"),(0,o.kt)("h2",{id:"background-replacement"},"Background replacement"),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)("p",null,"Background replacement can be used for e-commerce product short, marketing campaigns and achieving compelling visuals. In this process the existing background is removed and a new background is generated using the prompt text. Using ",(0,o.kt)("inlineCode",{parentName:"p"},"relight")," controlnet we can blend the product with the new background to achieve realistic results."),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Input image of bottle of whiskey",src:r(6595).Z,width:"580",height:"580"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with controlnet relight"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bottle of whiskey background replacement",src:r(2609).Z,width:"512",height:"512"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with controlnet relight"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Bottle of whiskey background replacement",src:r(7886).Z,width:"768",height:"768"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Input image of a shoe",src:r(2265).Z,width:"580",height:"580"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Shoe with background replacement of a forest",src:r(3373).Z,width:"768",height:"768"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Shoe with background replacement of snow",src:r(7023).Z,width:"768",height:"768"})))),(0,o.kt)("p",null,"See example prompts in the ",(0,o.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?controlnet=relight"},"gallery"),"."))}d.isMDXComponent=!0},6595:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-input1-ade7c2a702cccd5e3b429fb746ad37f5.png"},2265:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-input2-2ae76b239f75d4ca95e8575c1b720fcb.png"},3373:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-shoe-out1-15a16a6f6fbe8311f810fb41e9817f8e.jpeg"},7023:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-shoe-out2-9db7f3cb72d61b6226f4790b38c3f798.jpeg"},2609:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-whiskey-out1-3af1e7835749d82838657b97cbc907ff.jpeg"},7886:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/product-placement-background-replacement-whiskey-out2-5e923f067c8c7cd59ec1c81f49e9aebe.jpeg"}}]); \ No newline at end of file diff --git a/assets/js/eb3f1c80.82eb8c4d.js b/assets/js/eb3f1c80.82eb8c4d.js new file mode 100644 index 00000000..db1a834a --- /dev/null +++ b/assets/js/eb3f1c80.82eb8c4d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[7757],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>d});var a=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function l(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=a.createContext({}),p=function(e){var n=a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},c=function(e){var n=p(e.components);return a.createElement(s.Provider,{value:n},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},g=a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=p(t),g=i,d=u["".concat(s,".").concat(g)]||u[g]||f[g]||r;return t?a.createElement(d,l(l({ref:n},c),{},{components:t})):a.createElement(d,l({ref:n},c))}));function d(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var r=t.length,l=new Array(r);l[0]=g;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o[u]="string"==typeof e?e:i,l[1]=o;for(var p=2;p{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>f,frontMatter:()=>r,metadata:()=>o,toc:()=>p});var a=t(7462),i=(t(7294),t(3905));const r={image:"./img/face_inpainting_w_flux.png"},l="Face Inpainting",o={unversionedId:"features/face-inpainting",id:"features/face-inpainting",title:"Face Inpainting",description:"Overview",source:"@site/docs/features/face-inpainting.md",sourceDirName:"features",slug:"/features/face-inpainting",permalink:"/docs/features/face-inpainting",draft:!1,tags:[],version:"current",frontMatter:{image:"./img/face_inpainting_w_flux.png"},sidebar:"tutorialSidebar",previous:{title:"Backend V1",permalink:"/docs/features/backend-v1"},next:{title:"Face Swap",permalink:"/docs/features/face-swap"}},s={image:t(2775).Z},p=[{value:"Overview",id:"overview",level:2},{value:"Enabling Face Inpainting",id:"enabling-face-inpainting",level:2},{value:"Playground",id:"playground",level:3},{value:"API",id:"api",level:3},{value:"Example Request",id:"example-request",level:4},{value:"Notes",id:"notes",level:2}],c={toc:p},u="wrapper";function f(e){let{components:n,...r}=e;return(0,i.kt)(u,(0,a.Z)({},c,r,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"face-inpainting"},"Face Inpainting"),(0,i.kt)("h2",{id:"overview"},"Overview"),(0,i.kt)("p",null,"Face inpainting is a feature that maintains facial similarity mainly in long-shot and full-body generations by performing additional facial enhancement. When enabled, it automatically improves facial consistency regardless of the shot distance."),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Face Inpainting with Flux"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:t(2775).Z,width:"1600",height:"900"})))),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Zoom on face - Before"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:t(6956).Z,width:"800",height:"1248"}))),(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Zoom on face - After"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:t(8285).Z,width:"800",height:"1248"})))),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Full body longshot - before face inpainting"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:t(938).Z,width:"1792",height:"2304"}))),(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Full body longshot - after face inpainting"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:t(6656).Z,width:"1792",height:"2304"})))),(0,i.kt)("p",null,"See examples in our ",(0,i.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?inpaint_faces=true"},"gallery")),(0,i.kt)("h2",{id:"enabling-face-inpainting"},"Enabling Face Inpainting"),(0,i.kt)("h3",{id:"playground"},"Playground"),(0,i.kt)("p",null," To enable face inpainting, open the \u2018Advanced\u2019 settings when generating an image, and click the Inpaint faces toggle. Notice that this will turn on the super resolution toggle as well, which is necessary for this feature."),(0,i.kt)("h3",{id:"api"},"API"),(0,i.kt)("p",null,"Use ",(0,i.kt)("inlineCode",{parentName:"p"},"inpaint_faces")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"super_resolution")," in your prompt request."),(0,i.kt)("h4",{id:"example-request"},"Example Request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'POST https://api.astria.ai/generate\n\n{\n "prompt": " Surrounded by the natural beauty of a serene, wooded environment, the ohwx woman exudes a sense of tranquility and connection with her surroundings. She wears a flowing, organic-inspired dress in earthy tones, her face framed by loose, windblown hair. The lighting is soft and diffused, creating a soothing, meditative atmosphere that invites the viewer to pause and connect with the moment.",\n "num_images": 1,\n "super_resolution": true,\n "inpaint_faces": true,\n "w": 896,\n "h": 1152,\n "scheduler": "euler_a",\n "ar": "1:1"\n}\n')),(0,i.kt)("h2",{id:"notes"},"Notes"),(0,i.kt)("p",null,"When face inpainting is enabled the following occurs:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"An additional inference cycle"),(0,i.kt)("li",{parentName:"ul"},"This affects the total cost per generation - see our ",(0,i.kt)("a",{parentName:"li",href:"https://www.astria.ai/pricing"},"pricing page")," for details"),(0,i.kt)("li",{parentName:"ul"},"Generation time will be a bit longer")),(0,i.kt)("p",null,"Face inpainting Works with all Flux-based models, as well as SDXL and SD15"))}f.isMDXComponent=!0},2775:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/face_inpainting_w_flux-e687f3cc9742f3097b00c99497f8fe41.png"},6656:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/flux-face-inpainting-after-2e1ded443aa5056439ec23b130553389.jpg"},938:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/flux-face-inpainting-before-f7f98f5297d4ab8597fe2f16e2de2e8f.jpg"},8285:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/flux-face-inpainting-cropped-after-fe29b78ca5cbbb5400f999a4d9b8d136.jpg"},6956:(e,n,t)=>{t.d(n,{Z:()=>a});const a=t.p+"assets/images/flux-face-inpainting-cropped-before-77a3f6b092bda64b02b1102c8e151621.jpg"}}]); \ No newline at end of file diff --git a/assets/js/eb3f1c80.9b1be7ff.js b/assets/js/eb3f1c80.9b1be7ff.js deleted file mode 100644 index 87b1abd8..00000000 --- a/assets/js/eb3f1c80.9b1be7ff.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[7757],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>g});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),u=p(n),d=i,g=u["".concat(s,".").concat(d)]||u[d]||f[d]||r;return n?a.createElement(g,l(l({ref:t},c),{},{components:n})):a.createElement(g,l({ref:t},c))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,l=new Array(r);l[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:i,l[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>f,frontMatter:()=>r,metadata:()=>o,toc:()=>p});var a=n(7462),i=(n(7294),n(3905));const r={},l="Face Inpainting",o={unversionedId:"features/face-inpainting",id:"features/face-inpainting",title:"Face Inpainting",description:"Overview",source:"@site/docs/features/face-inpainting.md",sourceDirName:"features",slug:"/features/face-inpainting",permalink:"/docs/features/face-inpainting",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Backend V1",permalink:"/docs/features/backend-v1"},next:{title:"Face Swap",permalink:"/docs/features/face-swap"}},s={},p=[{value:"Overview",id:"overview",level:2},{value:"Enabling Face Inpainting",id:"enabling-face-inpainting",level:2},{value:"Playground",id:"playground",level:3},{value:"API",id:"api",level:3},{value:"Example Request",id:"example-request",level:4},{value:"Notes",id:"notes",level:2}],c={toc:p},u="wrapper";function f(e){let{components:t,...r}=e;return(0,i.kt)(u,(0,a.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"face-inpainting"},"Face Inpainting"),(0,i.kt)("h2",{id:"overview"},"Overview"),(0,i.kt)("p",null,"Face inpainting is a feature that maintains facial similarity mainly in long-shot and full-body generations by performing additional facial enhancement. When enabled, it automatically improves facial consistency regardless of the shot distance."),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Face Inpainting with Flux"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:n(2775).Z,width:"1600",height:"900"})))),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Zoom on face - Before"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:n(6956).Z,width:"800",height:"1248"}))),(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Zoom on face - After"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:n(8285).Z,width:"800",height:"1248"})))),(0,i.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Full body longshot - before face inpainting"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:n(938).Z,width:"1792",height:"2304"}))),(0,i.kt)("div",null,(0,i.kt)("figcaption",null,"Full body longshot - after face inpainting"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"source.png",src:n(6656).Z,width:"1792",height:"2304"})))),(0,i.kt)("p",null,"See examples in our ",(0,i.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery?inpaint_faces=true"},"gallery")),(0,i.kt)("h2",{id:"enabling-face-inpainting"},"Enabling Face Inpainting"),(0,i.kt)("h3",{id:"playground"},"Playground"),(0,i.kt)("p",null," To enable face inpainting, open the \u2018Advanced\u2019 settings when generating an image, and click the Inpaint faces toggle. Notice that this will turn on the super resolution toggle as well, which is necessary for this feature."),(0,i.kt)("h3",{id:"api"},"API"),(0,i.kt)("p",null,"Use ",(0,i.kt)("inlineCode",{parentName:"p"},"inpaint_faces")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"super_resolution")," in your prompt request."),(0,i.kt)("h4",{id:"example-request"},"Example Request"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},'POST https://api.astria.ai/generate\n\n{\n "prompt": " Surrounded by the natural beauty of a serene, wooded environment, the ohwx woman exudes a sense of tranquility and connection with her surroundings. She wears a flowing, organic-inspired dress in earthy tones, her face framed by loose, windblown hair. The lighting is soft and diffused, creating a soothing, meditative atmosphere that invites the viewer to pause and connect with the moment.",\n "num_images": 1,\n "super_resolution": true,\n "inpaint_faces": true,\n "w": 896,\n "h": 1152,\n "scheduler": "euler_a",\n "ar": "1:1"\n}\n')),(0,i.kt)("h2",{id:"notes"},"Notes"),(0,i.kt)("p",null,"When face inpainting is enabled the following occurs:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"An additional inference cycle"),(0,i.kt)("li",{parentName:"ul"},"This affects the total cost per generation - see our ",(0,i.kt)("a",{parentName:"li",href:"https://www.astria.ai/pricing"},"pricing page")," for details"),(0,i.kt)("li",{parentName:"ul"},"Generation time will be a bit longer")),(0,i.kt)("p",null,"Face inpainting Works with all Flux-based models, as well as SDXL and SD15"))}f.isMDXComponent=!0},2775:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/face_inpainting_w_flux-e687f3cc9742f3097b00c99497f8fe41.png"},6656:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/flux-face-inpainting-after-2e1ded443aa5056439ec23b130553389.jpg"},938:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/flux-face-inpainting-before-f7f98f5297d4ab8597fe2f16e2de2e8f.jpg"},8285:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/flux-face-inpainting-cropped-after-fe29b78ca5cbbb5400f999a4d9b8d136.jpg"},6956:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/flux-face-inpainting-cropped-before-77a3f6b092bda64b02b1102c8e151621.jpg"}}]); \ No newline at end of file diff --git a/assets/js/eeb7a3e9.4d9f9475.js b/assets/js/eeb7a3e9.4d9f9475.js deleted file mode 100644 index 84203b75..00000000 --- a/assets/js/eeb7a3e9.4d9f9475.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6468],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},l=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,c=e.originalType,s=e.parentName,l=i(e,["components","mdxType","originalType","parentName"]),u=p(r),d=a,m=u["".concat(s,".").concat(d)]||u[d]||f[d]||c;return r?n.createElement(m,o(o({ref:t},l),{},{components:r})):n.createElement(m,o({ref:t},l))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=r.length,o=new Array(c);o[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[u]="string"==typeof e?e:a,o[1]=i;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>f,frontMatter:()=>c,metadata:()=>i,toc:()=>p});var n=r(7462),a=(r(7294),r(3905));const c={},o="Face Swap",i={unversionedId:"features/face-swap",id:"features/face-swap",title:"Face Swap",description:"Without face-swap",source:"@site/docs/features/face-swap.md",sourceDirName:"features",slug:"/features/face-swap",permalink:"/docs/features/face-swap",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Face Inpainting",permalink:"/docs/features/face-inpainting"},next:{title:"FaceID for Flux",permalink:"/docs/features/faceid-flux"}},s={},p=[],l={toc:p},u="wrapper";function f(e){let{components:t,...c}=e;return(0,a.kt)(u,(0,n.Z)({},l,c,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"face-swap"},"Face Swap"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Without face-swap"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"source.png",src:r(5369).Z,width:"512",height:"640"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"With face-swap"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:r(117).Z,width:"512",height:"640"})))),(0,a.kt)("p",null,"Face-swap uses training images to further enhance resemblance to the subject. It is recommended to use face-swap in conjunction with face-inpainting and super-resolution."))}f.isMDXComponent=!0},117:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/face-swap-after-d63dc108cb39d66fd732681de221198d.png"},5369:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/face-swap-before-bfce7608266c9946d32d7d3306a3b1b4.png"}}]); \ No newline at end of file diff --git a/assets/js/eeb7a3e9.8575224d.js b/assets/js/eeb7a3e9.8575224d.js new file mode 100644 index 00000000..95183374 --- /dev/null +++ b/assets/js/eeb7a3e9.8575224d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[6468],{3905:(e,t,r)=>{r.d(t,{Zo:()=>f,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),p=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},f=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},l="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,c=e.originalType,s=e.parentName,f=o(e,["components","mdxType","originalType","parentName"]),l=p(r),d=a,m=l["".concat(s,".").concat(d)]||l[d]||u[d]||c;return r?n.createElement(m,i(i({ref:t},f),{},{components:r})):n.createElement(m,i({ref:t},f))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=r.length,i=new Array(c);i[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[l]="string"==typeof e?e:a,i[1]=o;for(var p=2;p{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>c,metadata:()=>o,toc:()=>p});var n=r(7462),a=(r(7294),r(3905));const c={image:"./img/face-swap-after.png"},i="Face Swap",o={unversionedId:"features/face-swap",id:"features/face-swap",title:"Face Swap",description:"Without face-swap",source:"@site/docs/features/face-swap.md",sourceDirName:"features",slug:"/features/face-swap",permalink:"/docs/features/face-swap",draft:!1,tags:[],version:"current",frontMatter:{image:"./img/face-swap-after.png"},sidebar:"tutorialSidebar",previous:{title:"Face Inpainting",permalink:"/docs/features/face-inpainting"},next:{title:"FaceID for Flux",permalink:"/docs/features/faceid-flux"}},s={image:r(117).Z},p=[],f={toc:p},l="wrapper";function u(e){let{components:t,...c}=e;return(0,a.kt)(l,(0,n.Z)({},f,c,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"face-swap"},"Face Swap"),(0,a.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"Without face-swap"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"source.png",src:r(5369).Z,width:"512",height:"640"}))),(0,a.kt)("div",null,(0,a.kt)("figcaption",null,"With face-swap"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"generated.png",src:r(117).Z,width:"512",height:"640"})))),(0,a.kt)("p",null,"Face-swap uses training images to further enhance resemblance to the subject. It is recommended to use face-swap in conjunction with face-inpainting and super-resolution."))}u.isMDXComponent=!0},117:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/face-swap-after-d63dc108cb39d66fd732681de221198d.png"},5369:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/face-swap-before-bfce7608266c9946d32d7d3306a3b1b4.png"}}]); \ No newline at end of file diff --git a/assets/js/f2bb83c3.15e57691.js b/assets/js/f2bb83c3.15e57691.js deleted file mode 100644 index 45f5f7ef..00000000 --- a/assets/js/f2bb83c3.15e57691.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1716],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=l(n),g=o,m=u["".concat(s,".").concat(g)]||u[g]||d[g]||i;return n?r.createElement(m,a(a({ref:t},p),{},{components:n})):r.createElement(m,a({ref:t},p))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=g;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[u]="string"==typeof e?e:o,a[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var r=n(7462),o=(n(7294),n(3905));const i={title:"Controlnet"},a="ControlNet",c={unversionedId:"use-cases/controlnet",id:"use-cases/controlnet",title:"Controlnet",description:"Preserve composition",source:"@site/docs/use-cases/20-controlnet.md",sourceDirName:"use-cases",slug:"/use-cases/controlnet",permalink:"/docs/use-cases/controlnet",draft:!1,tags:[],version:"current",sidebarPosition:20,frontMatter:{title:"Controlnet"},sidebar:"tutorialSidebar",previous:{title:"SDXL training",permalink:"/docs/use-cases/sdxl-training"},next:{title:"Inpainting and masking",permalink:"/docs/use-cases/inpainting-and-masking"}},s={},l=[{value:"Preserve composition",id:"preserve-composition",level:2}],p={toc:l},u="wrapper";function d(e){let{components:t,...i}=e;return(0,o.kt)(u,(0,r.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"controlnet"},"ControlNet"),(0,o.kt)("h2",{id:"preserve-composition"},"Preserve composition"),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(7950).Z,width:"1000",height:"1500"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with Controlnet img2img tile"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(3883).Z,width:"1024",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(9299).Z,width:"1000",height:"1500"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with Controlnet img2img pose"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(671).Z,width:"480",height:"720"})))))}d.isMDXComponent=!0},7950:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-input-47a0e7bd790726c6290ff60c3102257f.jpeg"},9299:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-input2-7026826b3c01ab8a035e9d247ae31097.jpeg"},3883:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-output-8792495c9018de2ceb447bcce0a99495.jpg"},671:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-output2-ca89564f598070101fb713b4a79ebe22.png"}}]); \ No newline at end of file diff --git a/assets/js/f2bb83c3.35045360.js b/assets/js/f2bb83c3.35045360.js new file mode 100644 index 00000000..5da761e8 --- /dev/null +++ b/assets/js/f2bb83c3.35045360.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[1716],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=l(n),m=o,d=u["".concat(s,".").concat(m)]||u[m]||g[m]||i;return n?r.createElement(d,a(a({ref:t},p),{},{components:n})):r.createElement(d,a({ref:t},p))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=m;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[u]="string"==typeof e?e:o,a[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>g,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var r=n(7462),o=(n(7294),n(3905));const i={title:"Controlnet",image:"./img/controlnet-output.jpg"},a="ControlNet",c={unversionedId:"use-cases/controlnet",id:"use-cases/controlnet",title:"Controlnet",description:"Preserve composition",source:"@site/docs/use-cases/20-controlnet.md",sourceDirName:"use-cases",slug:"/use-cases/controlnet",permalink:"/docs/use-cases/controlnet",draft:!1,tags:[],version:"current",sidebarPosition:20,frontMatter:{title:"Controlnet",image:"./img/controlnet-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"SDXL training",permalink:"/docs/use-cases/sdxl-training"},next:{title:"Inpainting and masking",permalink:"/docs/use-cases/inpainting-and-masking"}},s={image:n(3883).Z},l=[{value:"Preserve composition",id:"preserve-composition",level:2}],p={toc:l},u="wrapper";function g(e){let{components:t,...i}=e;return(0,o.kt)(u,(0,r.Z)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"controlnet"},"ControlNet"),(0,o.kt)("h2",{id:"preserve-composition"},"Preserve composition"),(0,o.kt)("div",{style:{display:"grid","grid-template-columns":"1fr 1fr",gap:"1.5rem"}},(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(7950).Z,width:"1000",height:"1500"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with Controlnet img2img tile"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(3883).Z,width:"1024",height:"1536"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Input image"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"source.png",src:n(9299).Z,width:"1000",height:"1500"}))),(0,o.kt)("div",null,(0,o.kt)("figcaption",null,"Output with Controlnet img2img pose"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"generated.png",src:n(671).Z,width:"480",height:"720"})))))}g.isMDXComponent=!0},7950:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-input-47a0e7bd790726c6290ff60c3102257f.jpeg"},9299:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-input2-7026826b3c01ab8a035e9d247ae31097.jpeg"},3883:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-output-8792495c9018de2ceb447bcce0a99495.jpg"},671:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/controlnet-output2-ca89564f598070101fb713b4a79ebe22.png"}}]); \ No newline at end of file diff --git a/assets/js/fb723fd6.c5a1da34.js b/assets/js/fb723fd6.494808a1.js similarity index 57% rename from assets/js/fb723fd6.c5a1da34.js rename to assets/js/fb723fd6.494808a1.js index 9baadcfd..c2294dd8 100644 --- a/assets/js/fb723fd6.c5a1da34.js +++ b/assets/js/fb723fd6.494808a1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[8946],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),u=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(r),m=a,f=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return r?n.createElement(f,l(l({ref:t},p),{},{components:r})):n.createElement(f,l({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{r.d(t,{Z:()=>l});var n=r(7294),a=r(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:t,hidden:r,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:r},t)}},4866:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(7462),a=r(7294),o=r(6010),l=r(2466),i=r(6550),s=r(1980),u=r(7392),p=r(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}function d(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function m(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:r}=e;const n=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})}),[o,n])]}function h(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,o=d(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[s,u]=f({queryString:r,groupId:n}),[c,h]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,o]=(0,p.Nk)(r);return[n,(0,a.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:n}),b=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=r(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:r,selectedValue:i,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),d=e=>{const t=e.currentTarget,r=p.indexOf(t),n=u[r].value;n!==i&&(c(t),s(n))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===t})}),r??t)})))}function v(e){let{lazy:t,children:r,selectedValue:n}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function k(e){const t=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(y,(0,n.Z)({},e,t)),a.createElement(v,(0,n.Z)({},e,t)))}function w(e){const t=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(t)},e))}},6440:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var n=r(7462),a=(r(7294),r(3905)),o=r(4866),l=r(5162);const i={hide_table_of_contents:!0},s="SDXL API usage",u={unversionedId:"api/sdxl-api",id:"api/sdxl-api",title:"SDXL API usage",description:"For general tips on SDXL training and inference, see SDXL training",source:"@site/docs/api/20-sdxl-api.md",sourceDirName:"api",slug:"/api/sdxl-api",permalink:"/docs/api/sdxl-api",draft:!1,tags:[],version:"current",sidebarPosition:20,frontMatter:{hide_table_of_contents:!0},sidebar:"tutorialSidebar",previous:{title:"Create a theme",permalink:"/docs/api/themes/create"}},p={},c=[{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(m,(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sdxl-api-usage"},"SDXL API usage"),(0,a.kt)("p",null,"For general tips on SDXL training and inference, see ",(0,a.kt)("a",{parentName:"p",href:"/docs/use-cases/sdxl-training"},"SDXL training")),(0,a.kt)("div",{className:"api-method"},(0,a.kt)("div",null,(0,a.kt)("p",null,"Unlike SD15 checkpoint training, SDXL on Astria is trained as a LoRA+text-embedding. As such, inference is taking place a on a base line model such as SDXL 1.0 and ",(0,a.kt)("inlineCode",{parentName:"p"},"prompt.text")," should specify the loaded lora such as ",(0,a.kt)("inlineCode",{parentName:"p"},"")," - will load lora with id=123456 and strength=0.83"),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"/docs/features/lora"},"LoRA docs")," on lora syntax"),(0,a.kt)("p",null,"With SDXL you cannot combine multiple LoRAs."),(0,a.kt)("p",null,"Use any SDXL model from ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery/tunes?branch=sdxl1"},"the gallery")," to do inference."),(0,a.kt)("admonition",{type:"warning"},(0,a.kt)("p",{parentName:"admonition"},"If you are receiving ",(0,a.kt)("inlineCode",{parentName:"p"},"422")," error ",(0,a.kt)("inlineCode",{parentName:"p"},"model_type=pti is not supported. Use a checkpoint instead")," - Change the request URL to ",(0,a.kt)("a",{parentName:"p",href:"https://api.astria.ai/tunes/666678/prompts"},"https://api.astria.ai/tunes/666678/prompts")," with ",(0,a.kt)("inlineCode",{parentName:"p"},"666678")," as a hard-coded tune_id of SDXL 1.0 from the gallery. See explanation above."))),(0,a.kt)("div",null,(0,a.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,a.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/666678/prompts \\\n -F prompt[text]=" a painting of ohwx man in the style of Van Gogh" \\\n -F prompt[negative_prompt]="old, blemish, wrin" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,a.kt)(l.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/666678/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' a painting of ohwx man in the style of Van Gogh');\nform.append('prompt[negative_prompt]', 'old, blemish, wrin');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,a.kt)(l.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/666678/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' a painting of ohwx man in the style of Van Gogh',\n 'prompt[negative_prompt]': 'old, blemish, wrin',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkastria_docs_2=self.webpackChunkastria_docs_2||[]).push([[8946],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),u=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(r),m=a,f=c["".concat(s,".").concat(m)]||c[m]||d[m]||o;return r?n.createElement(f,l(l({ref:t},p),{},{components:r})):n.createElement(f,l({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,l=new Array(o);l[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:a,l[1]=i;for(var u=2;u{r.d(t,{Z:()=>l});var n=r(7294),a=r(6010);const o={tabItem:"tabItem_Ymn6"};function l(e){let{children:t,hidden:r,className:l}=e;return n.createElement("div",{role:"tabpanel",className:(0,a.Z)(o.tabItem,l),hidden:r},t)}},4866:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(7462),a=r(7294),o=r(6010),l=r(2466),i=r(6550),s=r(1980),u=r(7392),p=r(12);function c(e){return function(e){return a.Children.map(e,(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}function d(e){const{values:t,children:r}=e;return(0,a.useMemo)((()=>{const e=t??c(r);return function(e){const t=(0,u.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function m(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:r}=e;const n=(0,i.k6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,s._X)(o),(0,a.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})}),[o,n])]}function h(e){const{defaultValue:t,queryString:r=!1,groupId:n}=e,o=d(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[s,u]=f({queryString:r,groupId:n}),[c,h]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,o]=(0,p.Nk)(r);return[n,(0,a.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:n}),b=(()=>{const e=s??c;return m({value:e,tabValues:o})?e:null})();(0,a.useLayoutEffect)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),h(e)}),[u,h,o]),tabValues:o}}var b=r(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:r,selectedValue:i,selectValue:s,tabValues:u}=e;const p=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),d=e=>{const t=e.currentTarget,r=p.indexOf(t),n=u[r].value;n!==i&&(c(t),s(n))},m=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=p.indexOf(e.currentTarget)+1;t=p[r]??p[0];break}case"ArrowLeft":{const r=p.indexOf(e.currentTarget)-1;t=p[r]??p[p.length-1];break}}t?.focus()};return a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":r},t)},u.map((e=>{let{value:t,label:r,attributes:l}=e;return a.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>p.push(e),onKeyDown:m,onClick:d},l,{className:(0,o.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":i===t})}),r??t)})))}function v(e){let{lazy:t,children:r,selectedValue:n}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===n));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return a.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))))}function k(e){const t=h(e);return a.createElement("div",{className:(0,o.Z)("tabs-container",g.tabList)},a.createElement(y,(0,n.Z)({},e,t)),a.createElement(v,(0,n.Z)({},e,t)))}function w(e){const t=(0,b.Z)();return a.createElement(k,(0,n.Z)({key:String(t)},e))}},6440:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>f,frontMatter:()=>i,metadata:()=>u,toc:()=>c});var n=r(7462),a=(r(7294),r(3905)),o=r(4866),l=r(5162);const i={hide_table_of_contents:!0,image:"../use-cases/img/sdxl-output.jpg"},s="SDXL API usage",u={unversionedId:"api/sdxl-api",id:"api/sdxl-api",title:"SDXL API usage",description:"For general tips on SDXL training and inference, see SDXL training",source:"@site/docs/api/20-sdxl-api.md",sourceDirName:"api",slug:"/api/sdxl-api",permalink:"/docs/api/sdxl-api",draft:!1,tags:[],version:"current",sidebarPosition:20,frontMatter:{hide_table_of_contents:!0,image:"../use-cases/img/sdxl-output.jpg"},sidebar:"tutorialSidebar",previous:{title:"Create a theme",permalink:"/docs/api/themes/create"}},p={},c=[{value:"POST /tunes/:id/prompts",id:"post-tunesidprompts",level:4}],d={toc:c},m="wrapper";function f(e){let{components:t,...r}=e;return(0,a.kt)(m,(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sdxl-api-usage"},"SDXL API usage"),(0,a.kt)("p",null,"For general tips on SDXL training and inference, see ",(0,a.kt)("a",{parentName:"p",href:"/docs/use-cases/sdxl-training"},"SDXL training")),(0,a.kt)("div",{className:"api-method"},(0,a.kt)("div",null,(0,a.kt)("p",null,"Unlike SD15 checkpoint training, SDXL on Astria is trained as a LoRA+text-embedding. As such, inference is taking place a on a base line model such as SDXL 1.0 and ",(0,a.kt)("inlineCode",{parentName:"p"},"prompt.text")," should specify the loaded lora such as ",(0,a.kt)("inlineCode",{parentName:"p"},"")," - will load lora with id=123456 and strength=0.83"),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"/docs/features/lora"},"LoRA docs")," on lora syntax"),(0,a.kt)("p",null,"With SDXL you cannot combine multiple LoRAs."),(0,a.kt)("p",null,"Use any SDXL model from ",(0,a.kt)("a",{parentName:"p",href:"https://www.astria.ai/gallery/tunes?branch=sdxl1"},"the gallery")," to do inference."),(0,a.kt)("admonition",{type:"warning"},(0,a.kt)("p",{parentName:"admonition"},"If you are receiving ",(0,a.kt)("inlineCode",{parentName:"p"},"422")," error ",(0,a.kt)("inlineCode",{parentName:"p"},"model_type=pti is not supported. Use a checkpoint instead")," - Change the request URL to ",(0,a.kt)("a",{parentName:"p",href:"https://api.astria.ai/tunes/666678/prompts"},"https://api.astria.ai/tunes/666678/prompts")," with ",(0,a.kt)("inlineCode",{parentName:"p"},"666678")," as a hard-coded tune_id of SDXL 1.0 from the gallery. See explanation above."))),(0,a.kt)("div",null,(0,a.kt)("h4",{id:"post-tunesidprompts"},"POST /tunes/:id/prompts"),(0,a.kt)(o.Z,{groupId:"lang",mdxType:"Tabs"},(0,a.kt)(l.Z,{value:"curl",label:"cURL",default:!0,mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash",metastring:"showLineNumbers",showLineNumbers:!0},'# Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\ncurl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/666678/prompts \\\n -F prompt[text]=" a painting of ohwx man in the style of Van Gogh" \\\n -F prompt[negative_prompt]="old, blemish, wrin" \\\n -F prompt[super_resolution]=true \\\n -F prompt[face_correct]=true \\\n -F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1" \n'))),(0,a.kt)(l.Z,{value:"javascript",label:"Node.js",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-javascript"},"const fetch = require('node-fetch');\nconst FormData = require('form-data');\n\n// Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\nconst API_URL = 'https://api.astria.ai/tunes/666678/prompts';\nconst API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key\nconst headers = { Authorization: `Bearer ${API_KEY}` }\n\nconst form = new FormData();\nform.append('prompt[text]', ' a painting of ohwx man in the style of Van Gogh');\nform.append('prompt[negative_prompt]', 'old, blemish, wrin');\nform.append('prompt[super_resolution]', true);\nform.append('prompt[face_correct]', true);\nform.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');\n\nfetch(API_URL, {\n method: 'POST',\n headers: headers,\n body: form\n}).then(response => response.json())\n\n\n"))),(0,a.kt)(l.Z,{value:"python",label:"Python",mdxType:"TabItem"},(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-python"},"import requests\n\n# Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery\nAPI_URL = 'https://api.astria.ai/tunes/666678/prompts'\nAPI_KEY = 'YOUR_API_KEY' # Replace with your actual API key\n\nheaders = {\n 'Authorization': f'Bearer {API_KEY}'\n}\n\ndata = {\n 'prompt[text]': ' a painting of ohwx man in the style of Van Gogh',\n 'prompt[negative_prompt]': 'old, blemish, wrin',\n 'prompt[super_resolution]': True,\n 'prompt[face_correct]': True,\n 'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'\n}\nfiles = []\nfiles.append((f\"tune[prompts_attributes][{i}][input_image]\", load_image(prompt['input_image'])))\n\nresponse = requests.post(API_URL, headers=headers, data=data)\n")))))))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.633caae4.js b/assets/js/runtime~main.96c40214.js similarity index 87% rename from assets/js/runtime~main.633caae4.js rename to assets/js/runtime~main.96c40214.js index 9c3c9eb7..e9547d7c 100644 --- a/assets/js/runtime~main.633caae4.js +++ b/assets/js/runtime~main.96c40214.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,c,a,b,d={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=d,r.c=t,e=[],r.O=(f,c,a,b)=>{if(!c){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,a,b]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};f=f||[null,c({}),c([]),c(c)];for(var t=2&a&&e;"object"==typeof t&&!~f.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,r.d(b,d),b},r.d=(e,f)=>{for(var c in f)r.o(f,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,c)=>(r.f[c](e,f),f)),[])),r.u=e=>"assets/js/"+({53:"85848f58",111:"85356aeb",180:"203b99fb",254:"9a7541ec",293:"0770fcbe",297:"ddb99303",317:"4700e527",492:"61744cd4",674:"6ff77412",738:"35a689f5",772:"17ccf213",1073:"2052cc0c",1124:"d3225ce8",1213:"dae0e962",1293:"d1f3e2f8",1433:"76161ddb",1462:"c2261996",1599:"c231ecf4",1716:"f2bb83c3",1777:"233522bf",1807:"d46b3c8b",1929:"397ab8ba",1960:"5e544de0",2062:"b83527cb",2197:"935f2afb",2247:"3ee62890",2255:"82dff655",2276:"7c7bf7c7",2366:"d537b4da",2499:"72ea4575",2532:"41484b8f",2656:"7f726b58",2747:"b2a96a7b",2831:"7b50a5fa",2912:"318e8f3b",2923:"351982cc",2956:"228c0e9a",3085:"1f391b9e",3186:"3a5c991a",3198:"05fe89fc",3237:"1df93b7f",3282:"325af9de",3358:"874195bf",3443:"38faaa9d",3469:"1dc92360",3543:"9955188a",3597:"b5bb8785",3731:"6e98b2b4",3751:"3720c009",3911:"57d2d9a8",4046:"2c5729fd",4071:"2880056d",4121:"55960ee5",4158:"a06d9ba5",4274:"a175974d",4353:"2ad457a3",4653:"b4b29f2e",4694:"20b43957",4762:"96713d40",4786:"55d868c3",4820:"944a3ab9",4868:"9fda4f55",4930:"501cbb42",5139:"97179b4d",5156:"64f51cdd",5653:"c2e19196",6095:"bb6383b9",6158:"73eac7f9",6194:"9ec5805d",6346:"d2543681",6450:"e8766d5f",6468:"eeb7a3e9",6471:"7e146cad",6547:"be959570",6567:"9cceef76",6577:"85dffb37",6599:"c6576fc4",6614:"f994835d",6667:"18678e9e",6688:"0036dbab",6708:"c97295c9",6861:"e0403869",6868:"989eb559",6896:"4f2e3443",6995:"e2fc4889",7018:"14200528",7076:"c438833c",7414:"393be207",7721:"084d163f",7723:"87a50603",7757:"eb3f1c80",7918:"17896441",8154:"fac6c085",8500:"cfcbef4e",8683:"80640e7c",8772:"e4fcfa79",8824:"91b5ff9c",8830:"103e863f",8946:"fb723fd6",8999:"d0ae32ce",9075:"6540dd0c",9211:"38b454c5",9410:"3b57aab9",9418:"96b27e6a",9473:"9c06740a",9493:"988781e2",9514:"1be78505",9558:"6f719c7f",9586:"cee787f4",9611:"dc0d6ca4",9694:"d361fb24",9706:"b8f8227f",9735:"5bc49099",9743:"67a124c0",9748:"d351f0f4",9817:"14eb3368",9924:"df203c0f"}[e]||e)+"."+{53:"ec2da5c3",111:"51c30b7d",180:"c4b2ef4c",254:"6b0c3522",293:"b43ff5b6",297:"0263c37f",317:"0daafded",492:"7ddb38d4",674:"233cd3d3",738:"e4b07cd0",772:"7e1734d8",1073:"8a330d1c",1124:"849d6a0f",1213:"935ba3c6",1293:"cc1b7a62",1433:"1f6c53ce",1462:"15159c23",1599:"8a7e9576",1716:"15e57691",1777:"7d062dc5",1807:"77feefcd",1929:"cd7434f1",1960:"9af138a9",2062:"58c1d2c7",2197:"ec10fb9a",2247:"4e7b9698",2255:"765a28c8",2276:"3a3a5707",2366:"eca3fa6f",2499:"c4ef8e6a",2532:"6875d757",2656:"ab515e84",2747:"f6f8be79",2831:"4d9a039c",2912:"4ada5e94",2923:"6f796142",2956:"653fe918",3085:"d85d8b14",3186:"64bf0be6",3198:"b2813528",3237:"2bff9ad8",3282:"f8980179",3358:"9dd1e81d",3443:"036b1be3",3469:"c9031861",3543:"d4d27520",3597:"93acbe94",3731:"27e4146d",3751:"d43ced20",3911:"6a3ee030",4046:"73df3a45",4071:"00fa48c0",4121:"030e62bb",4158:"e9982c5d",4274:"0a2711a1",4353:"26298e33",4653:"0dd1699d",4694:"2cf26acd",4762:"f24a11ec",4786:"1da66400",4820:"a16051f8",4868:"0a43a0eb",4930:"f65a5a26",4972:"de96bb75",5139:"2aef21c2",5156:"967e661b",5653:"6a89cc2d",6095:"b6785253",6158:"16f527f8",6194:"a57b3e4c",6346:"e1e2dddc",6450:"72cc9077",6468:"4d9f9475",6471:"adcd9d3b",6547:"9d81b693",6567:"f520c83a",6577:"c986542b",6599:"b16e7a94",6614:"33f6ac24",6667:"43f7305f",6688:"c9d75e43",6708:"11a99e6a",6861:"7d2a6e00",6868:"98a16893",6896:"a34b9b94",6995:"7a57e9f7",7018:"a72e2b73",7076:"7d337511",7414:"01e16d5a",7721:"baddb63f",7723:"feb52d97",7757:"9b1be7ff",7918:"c126ddaf",8154:"9585ed13",8500:"7a699e38",8683:"9f3af741",8772:"933a749b",8824:"0465ed5f",8830:"2cedeb77",8946:"c5a1da34",8999:"c59dddaa",9075:"3b4fc190",9211:"db576d9c",9410:"09053492",9418:"e587a187",9455:"f28b2ed9",9473:"f8983360",9493:"965a9b5a",9514:"cd0faa7e",9558:"58aeaaf5",9586:"1b613dd7",9611:"733f0dd6",9694:"23fe34df",9706:"f6e37d1b",9735:"ad9cee45",9743:"1a71604e",9748:"9c157cc5",9817:"fc6d9e20",9924:"02a737be"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),a={},b="astria-docs-2:",r.l=(e,f,c,d)=>{if(a[e])a[e].push(f);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={14200528:"7018",17896441:"7918","85848f58":"53","85356aeb":"111","203b99fb":"180","9a7541ec":"254","0770fcbe":"293",ddb99303:"297","4700e527":"317","61744cd4":"492","6ff77412":"674","35a689f5":"738","17ccf213":"772","2052cc0c":"1073",d3225ce8:"1124",dae0e962:"1213",d1f3e2f8:"1293","76161ddb":"1433",c2261996:"1462",c231ecf4:"1599",f2bb83c3:"1716","233522bf":"1777",d46b3c8b:"1807","397ab8ba":"1929","5e544de0":"1960",b83527cb:"2062","935f2afb":"2197","3ee62890":"2247","82dff655":"2255","7c7bf7c7":"2276",d537b4da:"2366","72ea4575":"2499","41484b8f":"2532","7f726b58":"2656",b2a96a7b:"2747","7b50a5fa":"2831","318e8f3b":"2912","351982cc":"2923","228c0e9a":"2956","1f391b9e":"3085","3a5c991a":"3186","05fe89fc":"3198","1df93b7f":"3237","325af9de":"3282","874195bf":"3358","38faaa9d":"3443","1dc92360":"3469","9955188a":"3543",b5bb8785:"3597","6e98b2b4":"3731","3720c009":"3751","57d2d9a8":"3911","2c5729fd":"4046","2880056d":"4071","55960ee5":"4121",a06d9ba5:"4158",a175974d:"4274","2ad457a3":"4353",b4b29f2e:"4653","20b43957":"4694","96713d40":"4762","55d868c3":"4786","944a3ab9":"4820","9fda4f55":"4868","501cbb42":"4930","97179b4d":"5139","64f51cdd":"5156",c2e19196:"5653",bb6383b9:"6095","73eac7f9":"6158","9ec5805d":"6194",d2543681:"6346",e8766d5f:"6450",eeb7a3e9:"6468","7e146cad":"6471",be959570:"6547","9cceef76":"6567","85dffb37":"6577",c6576fc4:"6599",f994835d:"6614","18678e9e":"6667","0036dbab":"6688",c97295c9:"6708",e0403869:"6861","989eb559":"6868","4f2e3443":"6896",e2fc4889:"6995",c438833c:"7076","393be207":"7414","084d163f":"7721","87a50603":"7723",eb3f1c80:"7757",fac6c085:"8154",cfcbef4e:"8500","80640e7c":"8683",e4fcfa79:"8772","91b5ff9c":"8824","103e863f":"8830",fb723fd6:"8946",d0ae32ce:"8999","6540dd0c":"9075","38b454c5":"9211","3b57aab9":"9410","96b27e6a":"9418","9c06740a":"9473","988781e2":"9493","1be78505":"9514","6f719c7f":"9558",cee787f4:"9586",dc0d6ca4:"9611",d361fb24:"9694",b8f8227f:"9706","5bc49099":"9735","67a124c0":"9743",d351f0f4:"9748","14eb3368":"9817",df203c0f:"9924"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(f,c)=>{var a=r.o(e,f)?e[f]:void 0;if(0!==a)if(a)c.push(a[2]);else if(/^(1303|532)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>a=e[f]=[c,b]));c.push(a[2]=b);var d=r.p+r.u(f),t=new Error;r.l(d,(c=>{if(r.o(e,f)&&(0!==(a=e[f])&&(e[f]=void 0),a)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,a[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,c)=>{var a,b,d=c[0],t=c[1],o=c[2],n=0;if(d.some((f=>0!==e[f]))){for(a in t)r.o(t,a)&&(r.m[a]=t[a]);if(o)var i=o(r)}for(f&&f(c);n{"use strict";var e,f,c,a,b,d={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return d[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=d,r.c=t,e=[],r.O=(f,c,a,b)=>{if(!c){var d=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,a,b]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var d={};f=f||[null,c({}),c([]),c(c)];for(var t=2&a&&e;"object"==typeof t&&!~f.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,r.d(b,d),b},r.d=(e,f)=>{for(var c in f)r.o(f,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,c)=>(r.f[c](e,f),f)),[])),r.u=e=>"assets/js/"+({53:"85848f58",111:"85356aeb",180:"203b99fb",254:"9a7541ec",293:"0770fcbe",297:"ddb99303",317:"4700e527",492:"61744cd4",674:"6ff77412",738:"35a689f5",772:"17ccf213",1073:"2052cc0c",1124:"d3225ce8",1213:"dae0e962",1293:"d1f3e2f8",1433:"76161ddb",1462:"c2261996",1599:"c231ecf4",1716:"f2bb83c3",1777:"233522bf",1807:"d46b3c8b",1929:"397ab8ba",1960:"5e544de0",2062:"b83527cb",2197:"935f2afb",2247:"3ee62890",2255:"82dff655",2276:"7c7bf7c7",2366:"d537b4da",2499:"72ea4575",2532:"41484b8f",2656:"7f726b58",2747:"b2a96a7b",2831:"7b50a5fa",2912:"318e8f3b",2923:"351982cc",2956:"228c0e9a",3085:"1f391b9e",3186:"3a5c991a",3198:"05fe89fc",3237:"1df93b7f",3282:"325af9de",3358:"874195bf",3443:"38faaa9d",3469:"1dc92360",3543:"9955188a",3597:"b5bb8785",3731:"6e98b2b4",3751:"3720c009",3911:"57d2d9a8",4046:"2c5729fd",4071:"2880056d",4121:"55960ee5",4158:"a06d9ba5",4274:"a175974d",4353:"2ad457a3",4653:"b4b29f2e",4694:"20b43957",4762:"96713d40",4786:"55d868c3",4820:"944a3ab9",4868:"9fda4f55",4930:"501cbb42",5139:"97179b4d",5156:"64f51cdd",5653:"c2e19196",6095:"bb6383b9",6158:"73eac7f9",6194:"9ec5805d",6346:"d2543681",6450:"e8766d5f",6468:"eeb7a3e9",6471:"7e146cad",6547:"be959570",6567:"9cceef76",6577:"85dffb37",6599:"c6576fc4",6614:"f994835d",6667:"18678e9e",6688:"0036dbab",6708:"c97295c9",6861:"e0403869",6868:"989eb559",6896:"4f2e3443",6995:"e2fc4889",7018:"14200528",7076:"c438833c",7414:"393be207",7721:"084d163f",7723:"87a50603",7757:"eb3f1c80",7918:"17896441",8154:"fac6c085",8500:"cfcbef4e",8683:"80640e7c",8772:"e4fcfa79",8824:"91b5ff9c",8830:"103e863f",8946:"fb723fd6",8999:"d0ae32ce",9075:"6540dd0c",9211:"38b454c5",9410:"3b57aab9",9418:"96b27e6a",9473:"9c06740a",9493:"988781e2",9514:"1be78505",9558:"6f719c7f",9586:"cee787f4",9611:"dc0d6ca4",9694:"d361fb24",9706:"b8f8227f",9735:"5bc49099",9743:"67a124c0",9748:"d351f0f4",9817:"14eb3368",9924:"df203c0f"}[e]||e)+"."+{53:"ec2da5c3",111:"51c30b7d",180:"c4b2ef4c",254:"6b0c3522",293:"b43ff5b6",297:"0a07bd97",317:"0daafded",492:"7ddb38d4",674:"233cd3d3",738:"e4b07cd0",772:"7e1734d8",1073:"8a330d1c",1124:"63530e7e",1213:"b845e406",1293:"cc1b7a62",1433:"ce3d09d4",1462:"15159c23",1599:"528b9ca7",1716:"35045360",1777:"7d062dc5",1807:"77feefcd",1929:"cd7434f1",1960:"9af138a9",2062:"75f6c9fe",2197:"8b7a9b1a",2247:"a0581c26",2255:"765a28c8",2276:"3a3a5707",2366:"eca3fa6f",2499:"c4ef8e6a",2532:"6875d757",2656:"ab515e84",2747:"f6f8be79",2831:"4d9a039c",2912:"4ada5e94",2923:"6f796142",2956:"653fe918",3085:"d85d8b14",3186:"64bf0be6",3198:"4dfba2bf",3237:"2bff9ad8",3282:"f8980179",3358:"9dd1e81d",3443:"036b1be3",3469:"c9031861",3543:"d4d27520",3597:"93acbe94",3731:"27e4146d",3751:"d43ced20",3911:"6a3ee030",4046:"73df3a45",4071:"00fa48c0",4121:"030e62bb",4158:"e9982c5d",4274:"45e2a7ab",4353:"26298e33",4653:"72c88383",4694:"2cf26acd",4762:"f24a11ec",4786:"1da66400",4820:"a16051f8",4868:"0a43a0eb",4930:"f65a5a26",4972:"de96bb75",5139:"5a9d1edc",5156:"cdf57b69",5653:"6a89cc2d",6095:"b6785253",6158:"16f527f8",6194:"a57b3e4c",6346:"e1e2dddc",6450:"72cc9077",6468:"8575224d",6471:"adcd9d3b",6547:"9d81b693",6567:"f520c83a",6577:"c986542b",6599:"b16e7a94",6614:"33f6ac24",6667:"8e294735",6688:"6cd65390",6708:"11a99e6a",6861:"7d2a6e00",6868:"98a16893",6896:"a34b9b94",6995:"98855dae",7018:"a72e2b73",7076:"7d337511",7414:"01e16d5a",7721:"2158c64b",7723:"feb52d97",7757:"82eb8c4d",7918:"c126ddaf",8154:"9585ed13",8500:"7a699e38",8683:"9f3af741",8772:"5a7070ba",8824:"0465ed5f",8830:"2cedeb77",8946:"494808a1",8999:"c59dddaa",9075:"e5735a36",9211:"db576d9c",9410:"09053492",9418:"e587a187",9455:"f28b2ed9",9473:"f8983360",9493:"965a9b5a",9514:"cd0faa7e",9558:"58aeaaf5",9586:"1b613dd7",9611:"733f0dd6",9694:"23fe34df",9706:"f6e37d1b",9735:"ad9cee45",9743:"1a71604e",9748:"9c157cc5",9817:"fc6d9e20",9924:"02a737be"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),a={},b="astria-docs-2:",r.l=(e,f,c,d)=>{if(a[e])a[e].push(f);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={14200528:"7018",17896441:"7918","85848f58":"53","85356aeb":"111","203b99fb":"180","9a7541ec":"254","0770fcbe":"293",ddb99303:"297","4700e527":"317","61744cd4":"492","6ff77412":"674","35a689f5":"738","17ccf213":"772","2052cc0c":"1073",d3225ce8:"1124",dae0e962:"1213",d1f3e2f8:"1293","76161ddb":"1433",c2261996:"1462",c231ecf4:"1599",f2bb83c3:"1716","233522bf":"1777",d46b3c8b:"1807","397ab8ba":"1929","5e544de0":"1960",b83527cb:"2062","935f2afb":"2197","3ee62890":"2247","82dff655":"2255","7c7bf7c7":"2276",d537b4da:"2366","72ea4575":"2499","41484b8f":"2532","7f726b58":"2656",b2a96a7b:"2747","7b50a5fa":"2831","318e8f3b":"2912","351982cc":"2923","228c0e9a":"2956","1f391b9e":"3085","3a5c991a":"3186","05fe89fc":"3198","1df93b7f":"3237","325af9de":"3282","874195bf":"3358","38faaa9d":"3443","1dc92360":"3469","9955188a":"3543",b5bb8785:"3597","6e98b2b4":"3731","3720c009":"3751","57d2d9a8":"3911","2c5729fd":"4046","2880056d":"4071","55960ee5":"4121",a06d9ba5:"4158",a175974d:"4274","2ad457a3":"4353",b4b29f2e:"4653","20b43957":"4694","96713d40":"4762","55d868c3":"4786","944a3ab9":"4820","9fda4f55":"4868","501cbb42":"4930","97179b4d":"5139","64f51cdd":"5156",c2e19196:"5653",bb6383b9:"6095","73eac7f9":"6158","9ec5805d":"6194",d2543681:"6346",e8766d5f:"6450",eeb7a3e9:"6468","7e146cad":"6471",be959570:"6547","9cceef76":"6567","85dffb37":"6577",c6576fc4:"6599",f994835d:"6614","18678e9e":"6667","0036dbab":"6688",c97295c9:"6708",e0403869:"6861","989eb559":"6868","4f2e3443":"6896",e2fc4889:"6995",c438833c:"7076","393be207":"7414","084d163f":"7721","87a50603":"7723",eb3f1c80:"7757",fac6c085:"8154",cfcbef4e:"8500","80640e7c":"8683",e4fcfa79:"8772","91b5ff9c":"8824","103e863f":"8830",fb723fd6:"8946",d0ae32ce:"8999","6540dd0c":"9075","38b454c5":"9211","3b57aab9":"9410","96b27e6a":"9418","9c06740a":"9473","988781e2":"9493","1be78505":"9514","6f719c7f":"9558",cee787f4:"9586",dc0d6ca4:"9611",d361fb24:"9694",b8f8227f:"9706","5bc49099":"9735","67a124c0":"9743",d351f0f4:"9748","14eb3368":"9817",df203c0f:"9924"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(f,c)=>{var a=r.o(e,f)?e[f]:void 0;if(0!==a)if(a)c.push(a[2]);else if(/^(1303|532)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>a=e[f]=[c,b]));c.push(a[2]=b);var d=r.p+r.u(f),t=new Error;r.l(d,(c=>{if(r.o(e,f)&&(0!==(a=e[f])&&(e[f]=void 0),a)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",t.name="ChunkLoadError",t.type=b,t.request=d,a[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,c)=>{var a,b,d=c[0],t=c[1],o=c[2],n=0;if(d.some((f=>0!==e[f]))){for(a in t)r.o(t,a)&&(r.m[a]=t[a]);if(o)var i=o(r)}for(f&&f(c);n -Flux API usage | Astria documentation +Flux API usage | Astria documentation - +

Flux API usage

For an overview of Flux fine-tuning, see Flux fine-tuning

  • Unlike SD15 checkpoint training, Flux is trained as a LoRA model type. As such, inference is taking place on a base model such as Flux1.dev and prompt.text should specify the loaded lora such as <lora:123456:1> - will load lora with id=123456 and strength=1
  • Flux1.Dev requires commercial license which Astria provides to its customers, and as such LoRA downloading is not available for API usage.

See LoRA docs on lora syntax

info

To avoid cloning inference details of different model types such as Flux LoRA vs SD1.5 checkpoint, please consider using the Packs API. Packs will help you abstract the inference logic so that you do not have to hard-code prompts and parameters such as w,h, cfg_scale in your backend. Moreover this will allow the creative department to launch packs, make modifications and even track likes, without needing to touch the backend code.

Step 1: Fine-tune a lora model

POST /tunes

# With images as multipart/form-data
# Hard coded tune id of Flux1.dev from the gallery - https://www.astria.ai/gallery/tunes
# https://www.astria.ai/gallery/tunes/1504944/prompts
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[preset]=flux-lora-portrait \
-F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \
-F tune[base_tune_id]=1504944 \
-F tune[model_type]="lora" \
-F "tune[images][]=@1.jpg" \
-F "tune[images][]=@2.jpg" \
-F "tune[images][]=@3.jpg" \
-F "tune[images][]=@4.jpg"

# With image_urls as form-data
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="Grumpy cat - UUID - 1234-6789-1234-56789" \
-F tune[name]=cat \
-F tune[preset]=flux-lora-portrait \
-F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \
-F tune[base_tune_id]=1504944 \
-F tune[model_type]="lora" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"

# As JSON
cat > data.json <<- EOM
{
"tune": {
"title": "Grumpy Cat - UUID - 1234-6789-1234-56789",
"name": "cat",
"base_tune_id": 1504944,
"model_type": "lora",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",
"image_urls": [
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg"
]
}
}
EOM

curl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes

Step 2: Generate images using the fine-tuned model

POST /tunes/:id/prompts

# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \
-F prompt[text]="<lora:tune_id:strength> a painting of ohwx man in the style of Van Gogh" \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
- + \ No newline at end of file diff --git a/docs/api/images/inspect/index.html b/docs/api/images/inspect/index.html index 5a988809..de8c7d2c 100644 --- a/docs/api/images/inspect/index.html +++ b/docs/api/images/inspect/index.html @@ -7,13 +7,13 @@ - +

Inspect image

Inspects an image to extract attributes both for filtering/warning about bad training set images and as characteristics to be added to the fine tune.

Parameters

name (required)

Class name of the object to be inspected in the image. Currently only man, woman are supported.

file (required)

The image to inspect.

file_url (optional)

The image url to inspect if file is not provided.

Returns

The below JSON schema is returned. It is possible that some attributes will not be returned.

{
"type": "object",
"properties": {
# Templating
"name": {
"type": "string",
"enum": ["man", "woman", "boy", "girl", "baby", "cat", "dog", "NONE"],
},
"ethnicity": {
"type": "string",
"enum": ["caucasian", "black", "hispanic", "korean", "japanese", "chinese", "philippine"]
},
"age": {
"type": "string",
"enum": ["20 yo", "30 yo", "40 yo", "50 yo", "60 yo", "70 yo"]
},
"glasses": {
"type": "string",
"enum": ["glasses", "NONE"]
},
"eye_color": {
"type": "string",
"enum": ["blue eyes", "brown eyes", "green eyes", "gray eyes", "black eyes", "NONE"],
},
"hair_color": {
"type": "string",
"enum": ["blonde", "brunette", "red hair", "black hair", "NONE"]
},
"hair_length": {
"type": "string",
"enum": ["short hair", "medium hair", "long hair", "NONE"]
},
"hair_style": {
"type": "string",
"enum": ["dreadlocks", "bald", "cornrows", "straight hair", "curly hair", "wavy hair", "NONE"]
},
"facial_hair": {
"type": "string",
"enum": ["mustache", "beard", "goatee", "NONE"]
},
"is_bald": {
"type": "string",
"enum": ["bald", "NONE"]
},
# Filtering helpers
"funny_face": {
"type": "boolean",
},
"wearing_sunglasses": {
"type": "boolean",
},
"wearing_hat": {
"type": "boolean",
},
"blurry": {
"type": "boolean",
},
"includes_multiple_people": {
"type": "boolean",
},
"full_body_image_or_longshot": {
"type": "boolean",
},
"selfie": {
"type": "boolean",
},
}
}

POST /images/inspect


curl -X POST "https://api.astria.ai/images/inspect" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "name=man" \
-F "file=@/path/to/your/image.jpg"

Response

{
"age": "20 yo",
"blurry": false,
"ethnicity": "caucasian",
"eye_color": "brown eyes",
"facial_hair": "",
"full_body_image_or_longshot": false,
"funny_face": false,
"glasses": "",
"hair_color": "brunette",
"hair_length": "medium hair",
"hair_style": "wavy hair",
"includes_multiple_people": false,
"is_bald": "",
"name": "woman",
"selfie": true,
"wearing_hat": false,
"wearing_sunglasses": false
}

Example implementation

The images inspect API is meant to be used by the client-side of your app. The /images/inspect needs to be proxied by your server to avoid exposing your API key to the client.

The example below implements two behaviors

  1. createWarning notifies the user about an attribute is true such as funny_face or wearing_sunglasses. The function expects a form input element containing the class name selected by the user.
  2. aggregateCharacteristics aggregates the most common values for each key in the characteristics object and sets the characteristicsInputTarget value to the aggregated characteristics.
  async inspect(previewEl, file) {
const form = document.getElementById('new_tune');
const formValues = Object.fromEntries(new FormData(form));
const name = formValues['tune[name]'];
const csrfToken = document.querySelector("[name='csrf-token']").content;
const formData = new FormData();
formData.append('authenticity_token', csrfToken);
formData.append('name', name);

// Check if file is an image and readable
if (file.type.startsWith('image/')) {
try {
const resizedFile = await this.resizeImage(file);
formData.append('file', resizedFile || file);
} catch (error) {
console.warn('Image resizing failed, uploading original file:', error);
formData.append('file', file);
}
} else {
formData.append('file', file);
}

const response = await fetch('/images/inspect', {
method: 'POST',
body: formData,
});
const data = await response.json();
if (!data['name']) {
this.createWarning(previewEl, `Could not detect image`);
}

// Iterate over hash and add warning messages for each true value
Object.keys(data).forEach((key) => {
if (key === 'name') {
if (data[key] === '') {
this.createWarning(previewEl, `Could not detect ${name} in the image`);
} else if (data[key] && data[key] !== name) {
this.createWarning(previewEl, `Could not detect ${name} in the image (2)`);
}
} else if (data[key] === true) {
const warning = capitalizeFirstLetter(key.replace(/_/g, " "));
this.createWarning(previewEl, warning);
}
});

this.characteristics.push(data);
this.aggregateCharacteristics();
previewEl.querySelector('.loading').classList.add('d-none');
previewEl.querySelector('.remove-btn').classList.remove('d-none');
}

// Helper function to resize the image
async resizeImage(file) {
return new Promise((resolve, reject) => {
const img = new Image();
const reader = new FileReader();

reader.onload = (e) => {
img.onload = () => {
const canvas = document.createElement('canvas');
const maxDimension = 512; // Set max dimension for resizing
let width = img.width;
let height = img.height;

if (width <= maxDimension && height <= maxDimension) {
console.log(`Image is already smaller than ${maxDimension}x${maxDimension}`)
resolve(file);
return;
}
// Calculate new dimensions while maintaining aspect ratio
if (width > height) {
if (width > maxDimension) {
height = Math.round(height * maxDimension / width);
width = maxDimension;
}
} else {
if (height > maxDimension) {
width = Math.round(width * maxDimension / height);
height = maxDimension;
}
}
console.log(`Resizing image to ${width}x${height} from ${img.width}x${img.height}`)

canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, width, height);

canvas.toBlob((blob) => {
resolve(blob ? new File([blob], file.name, { type: file.type }) : null);
}, file.type, 0.9); // Adjust quality if needed
};

img.onerror = reject;
img.src = e.target.result;
};

reader.onerror = reject;
reader.readAsDataURL(file);
});
}


aggregateCharacteristics() {
const aggregated = {};
// Iterate over this.characteristics and select value which is more common into this.aggregatedCharacteristics
// use only the characeteristics that are string
this.characteristics.forEach((characteristic) => {
Object.keys(characteristic).forEach((key) => {
if (typeof characteristic[key] === 'string') {
if (aggregated[key]) {
aggregated[key].push(characteristic[key]);
} else {
aggregated[key] = [characteristic[key]];
}
}
});
});
console.log('aggregated', aggregated);

const commonValues = {};
// find most common value for each key and set aggregatedCharacteristics to that value
Object.keys(aggregated).forEach((key) => {
const values = aggregated[key];
const mostCommonValue = values.sort((a, b) =>
values.filter(v => v === a).length - values.filter(v => v === b).length
).pop();
commonValues[key] = mostCommonValue;
});
console.log('commonValues', commonValues);
this.characteristicsInputTarget.value = JSON.stringify(commonValues);
}

- + \ No newline at end of file diff --git a/docs/api/like/create/index.html b/docs/api/like/create/index.html index 914a4368..c6dfc22c 100644 --- a/docs/api/like/create/index.html +++ b/docs/api/like/create/index.html @@ -7,14 +7,14 @@ - +

Create a like

Adds a like to a prompt. If the prompt was created using a pack (i.e: orig_prompt_id is set) - a like will be added to the original prompt as well.

Parameters

Returns

Returns status code 201 if successful and no content.

POST /prompts/:prompt_id/likes

curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/prompts/:prompt_id/like 

Response

Status code: 201 Created

- + \ No newline at end of file diff --git a/docs/api/like/delete/index.html b/docs/api/like/delete/index.html index 0e656d5d..f57bdbf1 100644 --- a/docs/api/like/delete/index.html +++ b/docs/api/like/delete/index.html @@ -7,13 +7,13 @@ - +

Delete a like

Delete a like from a prompt.

Parameters

Returns

Returns status code 201 if successful and no content.

POST /prompts/:prompt_id/likes

curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/prompts/:prompt_id/like 

Response

Status code: 201 Created

- + \ No newline at end of file diff --git a/docs/api/overview/index.html b/docs/api/overview/index.html index 7122142a..ff418385 100644 --- a/docs/api/overview/index.html +++ b/docs/api/overview/index.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@

Astria Fine-tuning API - Overview

Billing

The API uses account balance just like the web interface. See the pricing page for more details.

Mock testing

The API allows creating a mock Tune object with attribute branch=fast. See Create a tune documentation. API call for creating fast tune is free, and subsequent prompt calls will return mock images without incurring any charges. This is useful for testing your integration with the API. Once you're ready for production, you can purchase credits and adjust the quantity on the checkout page to how much you need.

Beta features

Astria maintains backward compatability and avoid making changes that could alter the behavior of the API. However, features marked as BETA are subject to change as we try to improve the product.

Auto top off

To allow your account to work without disruption, top-off feature can be enabled to refill account each time account balance reaches zero. Auto top-off can be enabled in the billing page. It is recommended to set the top-off amount to at least a week worth of API calls to avoid hitting the rate limit on top-off - Frequent top-offs can cause credit card charges to fail or bank declines.

Storage

Generated images, training pictures and models, will be automatically deleted 30 days after the training has ended. You may delete the fine-tune object including the trained model, training images, and generated images at any time before using the delete API calls. You may opt-in to automatically extend model storage

Authorization

The API uses bearer Authorization headers scheme. API calls should include the header:

Authorization: Bearer sd_XXXXXX

Find your API key on the API settings under your account settings.

REST API

Astria API is built as a REST API. Main resources are tune and prompt and each one has all the CRUD operations. Prompts are usually used as a nested resource on top of tunes (i.e: /tunes/:id/prompts).

Error Codes

tip

Pay attention to 504 error below and turn on idempotency for your account to avoid duplicate objects.

422 - Validation error - Log these errors, specifically the response body, and use an exception tracking system such as Rollbar or Sentry to get notified. Do not retry these requests.

500 - Internal server error - Such requests should be retried with exponential backoff and wait start time of 30 seconds.

504 - Gateway timeout - This error indicates that the request processing took more than the 30 seconds which is set as the max request timeout. In most cases the request would probably have been processed and you should avoid retrying it. In order to get the response see Idempotency section

Idempotency

Idempotency is a principle in programming which means that the same operation (a request in our case) can be made multiple times without changing the result. This can be useful when a request is interrupted and you want to make sure it is processed only once, and avoid duplicate objects.

Idempotency can be enabled for the account in the API settings.

For tunes request with the same title, idempotency will return the existing tune object and will not create a new one. This is useful for cases where you want to make sure you don't create duplicate tunes. In this case set the tune title to a unique value such as a UUID which identifies the transaction.

For prompts request with the same attributes, idempotency will return the existing prompt object and will not create a new one. Prompt attributes considered for the idempotency are text, tune_id, cfg_scale, steps, seed, callback, negative_prompt, super_resolution, face_correct, ar, num_images, controlnet, denoising_strength, use_lpw, controlnet_conditioning_scale, w, h, hires_fix, scheduler, controlnet_txt2img, inpaint_faces

When retrying a 504 error, and idempotency is enabled, make sure to wait 60 seconds before retrying the request to allow the previous request to finish processing.

Callbacks

Callbacks for prompts and tunes are POST requests containing the entity object in the request body. Callbacks work in test mode with branch=fast. Callbacks are currently not retried if they fail. To test your callbacks, we recommend a local tunnel tool like ngrok. If you need your backend server to receive some context arguments/metadata for the callback, like internal user-id or transaction id, we recommend adding those to the callback query string.

- + \ No newline at end of file diff --git a/docs/api/pack/list/index.html b/docs/api/pack/list/index.html index 335070f9..3d11615c 100644 --- a/docs/api/pack/list/index.html +++ b/docs/api/pack/list/index.html @@ -7,13 +7,13 @@ - +

List all packs

Parameters

Returns

An array of packs owned by the authenticated user or gallery packs for GET /gallery/packs

GET /packs or GET /gallery/packs

curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/packs
# or
curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/gallery/packs

Response


[
{
"id": 5,
"base_tune_id": 1,
"user_id": 1,
"slug": "test-rv5-1-pack",
"title": "test rv5.1 pack",
"token": "ohwx",
"created_at": "2024-01-17T12:35:13.379Z",
"updated_at": "2024-04-04T12:14:52.094Z",
"multiplier": 10,
"model_type": null,
"public_at": null,
"cost_mc_hash": {
"man": 200000, // cost in milli-cents - $20 USD
"woman": 100000 // cost in milli-cents - $10 USD
}
}
]

- + \ No newline at end of file diff --git a/docs/api/pack/pack/index.html b/docs/api/pack/pack/index.html index 8535f976..6dfc4439 100644 --- a/docs/api/pack/pack/index.html +++ b/docs/api/pack/pack/index.html @@ -7,13 +7,13 @@ - +

The pack object

A pack represents a list of grouped prompts, as well as the fine-tune to be created from the training images.

info

The headshot-starter open-source project now supports packs.

Advantages

  1. Test new prompts, ideas and themes on a bulk of models quickly to assure consistent high-quality results.
  2. Move fast from the creative process of creating prompts to the deployment of new themes in production.
  3. Avoid mismatch between hard-coded JSONs and the actual prompts.
  4. Decouple the creative process from your code and avoid mirroring inference API details in your codebase.
  5. Run user tests in production for new prompts and quickly iterate.
  6. Aggregate likes for prompts to improve the quality of the generated images and tighten the feedback loop.
  7. Sort packs by aggregated likes to present the best packs to the user.

Example user flow

  1. GET /packs Display a list of packs to the user. See docs
  2. User selects a pack, a class name (man/woman) and training images
  3. Call POST /p/:id/tunes with title, (training) images, and class name - to create a new fine-tune model using a pack. See docs
  4. GET /tunes/:id/prompts to get a list of prompts and their status
  5. POST /prompts/:id/likes to send feedback to the API. See docs
  6. Sort prompts by likes
  7. Present packs sorted by aggregated likes

Getting started

  1. Create your first pack from the GUI packs page.
  2. Assign prompts to the pack from the prompts tab.
- + \ No newline at end of file diff --git a/docs/api/pack/tunes/create/index.html b/docs/api/pack/tunes/create/index.html index 24cd9e04..cdf424fd 100644 --- a/docs/api/pack/tunes/create/index.html +++ b/docs/api/pack/tunes/create/index.html @@ -7,13 +7,13 @@ - +

Create a tune from a pack

Creates a new fine-tune model from training images according to the pack base tune id, model type and adds prompts to generate images.

Parameters

name (required)

A class name the describes the fine-tune. e.g: man, woman, cat, dog, boy, girl, style. Class name must be supported by pack.

title (required)

Describes the fine-tune. Ideally a UUID related to the transaction. See idempotency for more information.

images (required)

An array of images to train the fine-tune with. The images can be uploaded as multipart/form-data or as image_urls.

image_urls (required)

An array of images to train the fine-tune with. The images can be uploaded as multipart/form-data or as image_urls.

callback (optional)

A webhook URL to be called when the tune is finished training. The webhook will receive a POST request with the tune object. See more on callbacks.

characteristics (optional)

A free-form object that can be used to templatize the prompts text. e.g: {"eye_color": "blue eyes"} would than be used in the prompt text as ohwx woman, {{eye_color}}, holding flowers.

prompt_attributes.callback (optional)

A webhook URL to be called when each prompt is finished inference. The webhook will receive a POST request with the prompt object. See more on callbacks.

prompts_callback (optional)

A webhook URL to be called when all the prompts are finished training. The webhook will receive a POST request with an array of prompts objects.

tune_ids (optional)

Array of tune ids. If provided, will be used instead of the above attributes to create pack prompts only.

Returns

Returns a tune object if successful which will start training immediately and call callback once training is complete.

POST /p/:pack_id/tunes

# With images as multipart/form-data
# Hard coded pack id 260 for corporate headshots from the gallery - https://www.astria.ai/gallery/packs.json
# https://www.astria.ai/gallery/tunes/690204/prompts
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/p/260/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1" \
-F tune[characteristics][eye_color]="blue eyes" \
-F tune[prompt_attributes][callback]="https://optional-callback-url.com/webhooks/astria_prompts?user_id=1" \
-F "tune[images][]=@1.jpg" \
-F "tune[images][]=@2.jpg" \
-F "tune[images][]=@3.jpg" \
-F "tune[images][]=@4.jpg"

# With image_urls as form-data
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/p/260/tunes \
-F tune[title]="Grumpy cat - UUID - 1234-6789-1234-56789" \
-F tune[name]=cat \
-F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1" \
-F tune[prompt_attributes][callback]="https://optional-callback-url.com/webhooks/astria_prompts?user_id=1" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"

# As JSON
cat > data.json <<- EOM
{
"tune": {
"title": "Grumpy Cat - UUID - 1234-6789-1234-56789",
"name": "cat",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1",
"characteristics": {"eye_color": "blue eyes"},
"prompt_attributes": {
"callback": "https://optional-callback-url.com/webhooks/astria_prompts?user_id=1"
},
"image_urls": [
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg"
]
}
}
EOM

# Hard coded pack id 260 for corporate headshots from the gallery - https://www.astria.ai/gallery/packs.json
curl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/p/260/tunes

Response


{
"id": 1,
"title": "John Doe",
"name": "woman",
"eta": "2023-10-02T14:32:40.363Z",
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
- + \ No newline at end of file diff --git a/docs/api/prompt/create/index.html b/docs/api/prompt/create/index.html index 391bd213..affa8e34 100644 --- a/docs/api/prompt/create/index.html +++ b/docs/api/prompt/create/index.html @@ -7,13 +7,13 @@ - +

Create a prompt

Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.

Parameters

text (required)

Description of the image.

negative_prompt (optional)

A comma separated list of words that should not appear in the image.

callback (optional)

a URL that will be called when the prompt is done processing. The callback is a POST request where the body contains the prompt object. See more.

num_images (optional)

Number of images to generate. Range: 1-8.

seed (optional)

Random number to create consistent results. Range: 0 to 2^32.

super_resolution (optional)

Boolean. X4 super-resolution.

inpaint_faces (optional)

Boolean. Requires super-resolution on. Inpaints faces.

hires_fix (optional)

Boolean. Super resolution details. Available only when super_resolution is true. Adds details.

face_correct (optional)

Boolean. Runs another AI model on top to correct the face in the image.

face_swap (optional)

Boolean. Uses training images to swap face and enhance resemblance.

cfg_scale (optional)

Float. How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt). Range 0-15

steps (optional)

Integer. Number of diffusion steps to run . Range 0-50

use_lpw (optional)

Boolean. Use weighted prompts.

w (optional)

width - In multiples of 8.

h (optional)

height - In multiples of 8.

scheduler (optional)

enum: euler, euler_a, dpm++2m_karras, dpm++sde_karras, dpm++2m, dpm++sde, lcm, tcd. If not specified the default account scheduler will be used.

backend_version (optional)

enum: null, 1, If not specified will default to the account version will be used.

style (optional)

enum: null, Cinematic, Animated, Digital Art, Photographic, Fantasy art, Neonpunk, Enhance, Comic book, Lowpoly, Line art. See more.

color_grading (optional)

enum: Film Velvia, Film Portra, Ektar.

film_grain (optional)

boolean - Adds noise to the image to make it look more realistic.

Img2Img / ControlNet

controlnet (optional)

Requires input_image. Possible values: composition, reference, segroom, ipadapter, lineart, canny, depth, mlsd, hed, pose, tile, qr.

denoising_strength (optional)

For img2img. 1.0 - Take prompt. 0.0 - Take image. Range: 0.0-1.0. Default: 0.8

controlnet_conditioning_scale (optional)

Strength of controlnet conditioning. 0.0-1.0

controlnet_txt2img (optional)

Boolean toggle. True for text to image controlnet. False for image to image controlnet.

input_image (optional)

Binary multi-part request with the image. Used in conjunction with controlnet parameter.

input_image_url (optional)

URL to an image. Used in conjunction with controlnet parameter.

mask_image (optional)

Binary multi-part request with one channel mask image. Used in conjunction with input_image parameter for inpainting

mask_image_url (optional)

URL to a one channel mask image. Used in conjunction with input_image_url parameter for inpainting.

lora_scale (optional)

Available only when used as prompts_attributes in POST /tunes request to override the default scale of the LoRA model.

Returns

Returns a prompt object if successful which will start processing if tune is processed.

POST /tunes/:id/prompts

curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1/prompts \
-F prompt[text]="a painting of ohwx man in the style of Van Gogh" \
-F prompt[negative_prompt]="old, blemish, wrin" \
-F prompt[super_resolution]=true \
-F prompt[face_correct]=true \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"

Response

{
"id": 1,
"callback": "https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1",
"text": "a painting of ohwx man in the style of Van Gogh",
"negative_prompt": "old, blemish, wrinkles, mole",
"cfg_scale": null,
"steps": null,
"seed": null,
"trained_at": null,
"started_training_at": null,
"created_at": "2022-10-06T16:12:54.505Z",
"updated_at": "2022-10-06T16:12:54.505Z",
"tune_id": 1,
"url": "http://api.astria.ai/tunes/1/prompts/1.json"
}
- + \ No newline at end of file diff --git a/docs/api/prompt/delete/index.html b/docs/api/prompt/delete/index.html index c3f218a5..f5f2c301 100644 --- a/docs/api/prompt/delete/index.html +++ b/docs/api/prompt/delete/index.html @@ -7,13 +7,13 @@ - +

Delete a prompt

Deletes a specific prompt associated with a tune.

Parameters

id (required)

The ID of the prompt to be deleted.

Returns

Returns 200 OK if the prompt was successfully deleted.

DELETE /tunes/:tune_id/prompts/:id

curl -X DELETE -H "Authorization: Bearer $API_KEY" https://api.astria.ai/prompts/1

Response

{
"message": "Prompt successfully deleted"
}
- + \ No newline at end of file diff --git a/docs/api/prompt/list/index.html b/docs/api/prompt/list/index.html index 50e53bf9..8e668d13 100644 --- a/docs/api/prompt/list/index.html +++ b/docs/api/prompt/list/index.html @@ -7,13 +7,13 @@ - +

List all prompts

Parameters

offset (optional)

Starting offset for the list of prompts. Default: 0. Current page size is 20.

Returns

An array of prompts owned by the authenticated user. If used as a nested resource (in the url), will return prompts owned by the tune.

GET /tunes/:id/prompts

curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1/prompts

Response


[
{
"id": 1,
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=your_internal_user_id&transaction_id=internal_transaction_id",
"text": "a painting of ohwx man in the style of Van Gogh",
"negative_prompt": "old, blemish, wrinkles, mole",
"cfg_scale": null,
"steps": null,
"seed": null,
"trained_at": null,
"started_training_at": null,
"created_at": "2022-10-06T16:12:54.505Z",
"updated_at": "2022-10-06T16:12:54.505Z",
"tune_id": 1,
"url": "http://api.astria.ai/tunes/1/prompts/1.json"
}
]
- + \ No newline at end of file diff --git a/docs/api/prompt/prompt/index.html b/docs/api/prompt/prompt/index.html index cfb4a01e..7d2ca562 100644 --- a/docs/api/prompt/prompt/index.html +++ b/docs/api/prompt/prompt/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/api/prompt/retrieve/index.html b/docs/api/prompt/retrieve/index.html index 4e5f5057..751e4ce9 100644 --- a/docs/api/prompt/retrieve/index.html +++ b/docs/api/prompt/retrieve/index.html @@ -7,13 +7,13 @@ - +

Retrieve a prompt

Parameters

No parameters

Returns

Returns the prompt object.

GET /tunes/:tune_id/prompts/:id

curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1/prompts/1

Response

{
"id": 1,
"callback": "https://optional-callback-url.com/to-your-service-when-ready",
"text": "a painting of ohwx man in the style of Van Gogh",
"negative_prompt": "old, blemish, wrinkles, mole",
"cfg_scale": null,
"steps": null,
"seed": null,
"trained_at": null,
"started_training_at": null,
"created_at": "2022-10-06T16:12:54.505Z",
"updated_at": "2022-10-06T16:12:54.505Z",
"tune_id": 1,
"url": "http://api.astria.ai/tunes/1/prompts/1.json"
}
- + \ No newline at end of file diff --git a/docs/api/sdxl-api/index.html b/docs/api/sdxl-api/index.html index cb323a0b..54d64e75 100644 --- a/docs/api/sdxl-api/index.html +++ b/docs/api/sdxl-api/index.html @@ -3,17 +3,17 @@ -SDXL API usage | Astria documentation +SDXL API usage | Astria documentation - +

SDXL API usage

For general tips on SDXL training and inference, see SDXL training

Unlike SD15 checkpoint training, SDXL on Astria is trained as a LoRA+text-embedding. As such, inference is taking place a on a base line model such as SDXL 1.0 and prompt.text should specify the loaded lora such as <lora:123456:0.83> - will load lora with id=123456 and strength=0.83

See LoRA docs on lora syntax

With SDXL you cannot combine multiple LoRAs.

Use any SDXL model from the gallery to do inference.

danger

If you are receiving 422 error model_type=pti is not supported. Use a checkpoint instead - Change the request URL to https://api.astria.ai/tunes/666678/prompts with 666678 as a hard-coded tune_id of SDXL 1.0 from the gallery. See explanation above.

POST /tunes/:id/prompts

# Note the hard-coded 666678 which is the tune_id of SDXL 1.0 from the gallery
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/666678/prompts \
-F prompt[text]="<lora:tune_id:strength> a painting of ohwx man in the style of Van Gogh" \
-F prompt[negative_prompt]="old, blemish, wrin" \
-F prompt[super_resolution]=true \
-F prompt[face_correct]=true \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
- + \ No newline at end of file diff --git a/docs/api/themes/create/index.html b/docs/api/themes/create/index.html index 77f42cc2..90f974e0 100644 --- a/docs/api/themes/create/index.html +++ b/docs/api/themes/create/index.html @@ -7,13 +7,13 @@ - +

Create a theme

Themes API leverages a LLM (Large Language Models) to generate a variety of prompts based on a theme. The theme can be a short description of a concept, a mood, or a style. The API call will create 10 prompts which will start processing and generating images.

Parameters

theme (required)

Class name of the object to be inspected in the image. Currently only man, woman are supported.

tuen_ids (requires)

A list of tune ids to be used for the theme. For each tune, 10 prompts will be generated.

prompt_attributes (optional)

num_images, w, h can be overridden

Returns

Returns empty response with status code 201. The themes are created in the background and can be pulled using GET /tunes/:id/prompts.

POST /themes


curl -X POST "https://api.astria.ai/themes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "theme[theme]=Corporate headshots" \
-F "theme[tune_ids][]=123" \
-F "theme[prompt_attributes][num_images]=123"

Response

200 OK - empty body response

- + \ No newline at end of file diff --git a/docs/api/tune/create/index.html b/docs/api/tune/create/index.html index c40e770d..7c588fdb 100644 --- a/docs/api/tune/create/index.html +++ b/docs/api/tune/create/index.html @@ -7,14 +7,14 @@ - +

Create a tune

Creates a new fine-tune model from training images which in turn will be used to create prompts and generate images.

Parameters

name (required)

A class name the describes the fine-tune. e.g: man, woman, cat, dog, boy, girl, style

title (required)

Describes the fine-tune. Ideally a UUID related to the transaction. See idempotency for more information.

images (required)

An array of images to train the fine-tune with. The images can be uploaded as multipart/form-data or as image_urls.

image_urls (required)

An array of images to train the fine-tune with. The images can be uploaded as multipart/form-data or as image_urls.

callback (optional)

A webhook URL to be called when the tune is finished training. The webhook will receive a POST request with the tune object. See more on callbacks.

branch (optional)

Enum: sd15, sdxl1, fast. Will default to the base_tune branch if not specified, or to sd15 if base_tune is not specified.

info

Use branch=fast for mock testing

steps (optional)

Training steps. Recommended leaving blank in order to allow better defaults set by the system.

token (optional)

Unique short text to which the features will be embedded into. Default ohwx for SDXL and sks for SD15.

face_crop (optional)

Detects faces in training images and augments training set with cropped faces. Defaults to account setting

training_face_correct (optional)

Enhance training images using GFPGAN. Consider enabling if input image are low quality or low resolution. May result in over-smoothing.

base_tune_id (optional)

Training on top of former fine-tune or a different baseline model from the gallery (id in the URL). e.g: 690204 - Realistic Vision v5.1

model_type (optional)

Enum: lora, pti, faceid, null for checkpoint. For SDXL1 - API will default to pti and will ignore model_type parameter.

preset (optional)

Enum: flux-lora-portrait, flux-lora-fast see details in the GUI, null. See Flux lora training for more information.

characteristics (optional)

A free-form object that can be used to templatize the prompts text. e.g: {"eye_color": "blue eyes"} would than be used in the prompt text as ohwx woman, {{eye_color}}, holding flowers.

prompts_attributes (optional)

Array of prompts entities with all attributes. See create prompt for more information.

Returns

Returns a tune object if successful which will start training immediately and call callback once training is complete.

POST /tunes

# With images as multipart/form-data
# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes
# https://www.astria.ai/gallery/tunes/690204/prompts
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[branch]="fast" \
-F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F tune[token]=ohwx \
-F "tune[prompts_attributes][0][text]=ohwx man on space circa 1979 on cover of time magazine" \
-F tune[prompts_attributes][0][callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&prompt_id=1&tune_id=1" \
-F "tune[images][]=@1.jpg" \
-F "tune[images][]=@2.jpg" \
-F "tune[images][]=@3.jpg" \
-F "tune[images][]=@4.jpg"

# With image_urls as form-data
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="Grumpy cat - UUID - 1234-6789-1234-56789" \
-F tune[name]=cat \
-F tune[branch]="fast" \
-F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F tune[token]=ohwx \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"

# As JSON
cat > data.json <<- EOM
{
"tune": {
"title": "Grumpy Cat - UUID - 1234-6789-1234-56789",
"name": "cat",
"branch": "fast",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",
"image_urls": [
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg"
],
"prompts_attributes": [
{
"text": "ohwx cat in space circa 1979 French illustration",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1&prompt_id=1"
},
{
"text": "ohwx cat getting into trouble viral meme",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1&prompt_id=1"
}
]
}
}
EOM

curl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes

Response


{
"id": 1,
"title": "John Doe - UUID - 1234-6789-1234-56789",
"name": "woman",
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"training_face_correct": false,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"eta": "2023-10-02T14:32:40.363Z",
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"branch": "sdxl1",
"model_type": "lora",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
- + \ No newline at end of file diff --git a/docs/api/tune/delete/index.html b/docs/api/tune/delete/index.html index df43a9c6..a3aabf23 100644 --- a/docs/api/tune/delete/index.html +++ b/docs/api/tune/delete/index.html @@ -7,13 +7,13 @@ - +

Delete a tune

Deletes a specific tune by its ID, and associated prompts in case of a checkpoint.

Parameters

id (required)

The ID of the tune to be deleted.

Returns

Returns 200 OK if the prompt was successfully deleted.

DELETE /tunes/:id

curl -X DELETE -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1

Response

200 OK

- + \ No newline at end of file diff --git a/docs/api/tune/index.html b/docs/api/tune/index.html index b570fbe1..aafec8ee 100644 --- a/docs/api/tune/index.html +++ b/docs/api/tune/index.html @@ -7,14 +7,14 @@ - + - + \ No newline at end of file diff --git a/docs/api/tune/list/index.html b/docs/api/tune/list/index.html index 36bbe1b1..8bf561c2 100644 --- a/docs/api/tune/list/index.html +++ b/docs/api/tune/list/index.html @@ -7,13 +7,13 @@ - +

List all tunes

Parameters

offset (optional)

Starting offset for the list of prompts. Default: 0. Current page size is 20.

Returns

An array of all fine-tunes owned by the authenticated user

GET /tunes

curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes

Response


[
{
"id": 1,
"title": "John Doe",
"name": "woman",
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"branch": "sdxl1",
"model_type": "lora",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
},
{
"id": 775459,
"title": "Marry Jane",
"name": null,
"is_api": false,
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"trained_at": "2023-09-23T16:07:49.137Z",
"started_training_at": "2023-09-23T16:07:37.334Z",
"expires_at": "2023-10-23T16:07:49.137Z",
"created_at": "2023-09-23T16:07:36.606Z",
"branch": "sdxl1",
"model_type": "lora",
"updated_at": "2023-09-23T16:07:49.138Z",
"url": "https://www.astria.ai/tunes/775459.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
]
- + \ No newline at end of file diff --git a/docs/api/tune/retrieve/index.html b/docs/api/tune/retrieve/index.html index 17c4b920..f20d1093 100644 --- a/docs/api/tune/retrieve/index.html +++ b/docs/api/tune/retrieve/index.html @@ -7,13 +7,13 @@ - +

Retrieve a tune

Parameters

No parameters

Returns

Returns the Tune object.

GET /tunes/:id

curl -X GET -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1

Response

{
"id": 1,
"title": "John Doe",
"name": "woman",
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"branch": "sdxl1",
"model_type": "lora",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
- + \ No newline at end of file diff --git a/docs/category/api/index.html b/docs/category/api/index.html index 33e1a77a..18052885 100644 --- a/docs/category/api/index.html +++ b/docs/category/api/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/features/index.html b/docs/category/features/index.html index a6dcf770..f9c7804c 100644 --- a/docs/category/features/index.html +++ b/docs/category/features/index.html @@ -7,13 +7,13 @@ - +
- + \ No newline at end of file diff --git a/docs/category/images/index.html b/docs/category/images/index.html index 3ae86577..74257c55 100644 --- a/docs/category/images/index.html +++ b/docs/category/images/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/likes/index.html b/docs/category/likes/index.html index cdb68f04..5beaf1d3 100644 --- a/docs/category/likes/index.html +++ b/docs/category/likes/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/pack-tunes/index.html b/docs/category/pack-tunes/index.html index 70cd6c48..74bc5c28 100644 --- a/docs/category/pack-tunes/index.html +++ b/docs/category/pack-tunes/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/packs/index.html b/docs/category/packs/index.html index 831360de..d84424ad 100644 --- a/docs/category/packs/index.html +++ b/docs/category/packs/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/prompts/index.html b/docs/category/prompts/index.html index 5bbe28a1..6f85b558 100644 --- a/docs/category/prompts/index.html +++ b/docs/category/prompts/index.html @@ -7,13 +7,13 @@ - +
- + \ No newline at end of file diff --git a/docs/category/themes/index.html b/docs/category/themes/index.html index 1abfa133..33e27834 100644 --- a/docs/category/themes/index.html +++ b/docs/category/themes/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/category/tunes/index.html b/docs/category/tunes/index.html index de97d25d..e8b7ea46 100644 --- a/docs/category/tunes/index.html +++ b/docs/category/tunes/index.html @@ -7,13 +7,13 @@ - +
- + \ No newline at end of file diff --git a/docs/category/use-cases/index.html b/docs/category/use-cases/index.html index 8d231984..fd22cc9e 100644 --- a/docs/category/use-cases/index.html +++ b/docs/category/use-cases/index.html @@ -7,13 +7,13 @@ - +
-
- +
+ \ No newline at end of file diff --git a/docs/changes/index.html b/docs/changes/index.html index 2d17cf05..2ae9c6a8 100644 --- a/docs/changes/index.html +++ b/docs/changes/index.html @@ -7,13 +7,13 @@ - +

Changes

  • 2024-12-20 Outpainting syntax for extending image, creating more cinematic images or longer portraits with high quality faces.
  • 2024-12-15 portrait flux training preset is available for fine-tuning for better portrait results.
  • 2024-11-27 FaceID for Flux is now available.
  • 2024-11-27 Flux fine-tuning allows uploading .TXT file captions for multi concept fine-tuning.
  • 2024-11-24 Added film grain and color grading support for Flux Backend V0.
  • 2024-11-20 Virtual try-on with Flux is now in BETA.
  • 2024-11-15 Face inpainting with Flux and improved super-resolution
  • 2024-10-27 Added Theme API to allow users to easily create variation and write their own ideas while augmenting them and adding variation.
  • 2024-10-12 Added Image inspect API to 1) filter/warn about bad training images 2) detect characteristics of the training images for templating with characteristics.
  • 2024-10-09 Flux controlnet pose is available with Backend V0 but is still not recommended for production use.
  • 2024-09-26 Added prompts_callback for creating a tune with a pack
  • 2024-09-03 Flux fine-tuning docs and Flux API usage
  • 2024-07-29 Added Styles option for prompt
  • 2024-06-26 Tiled upscale V2 preserves identity and similarity while adding details and skin tones.
  • 2024-06-26 Added controlnet relight for SD15 with Backend V1 to allow better composition and blending for background replacement.
  • 2024-05-26 Added --improve_similarity 0.5 flag for Checkpoint/LoRA models which dramatically improves similarity/identity.
  • 2024-05-22 Improved SDXL FaceID
  • 2024-05-22 Added Controlnet Style for SDXL1
  • 2024-05-10 Added Controlnet Lineart for SDXL1
  • 2024-05-06 Interior design - improved "Segment Room" (segroom) controlnet to handle empty rooms.
  • 2024-05-05 Packs + Likes API - Control prompts from within Astria and experiment faster.
  • 2024-04-20 Interior design - Added "Segment Room" controlnet for Backend V1, and MLSD for SDXL to be used.
  • 2024-04-04 Added support for face-inpainting, hires-fix and tiled upscale for faceid on Backend V1.
  • 2024-04-04 Lightning schedulers for Backend V1 to support lightning models such as RealVis XL Lightning
  • 2024-04-04 V1: Lightning schedulers to support lightning models such as RealVis XL Lightning
  • 2024-03-27 Upgraded Themes to use Claude Opus and adjust for both SDXL and SD15 prompting.
  • 2024-03-20 Free Upscale tool
  • 2024-03-17 Controlnet composition support for Backend V1. Examples in the gallery
  • 2024-03-10 New Backend version v1 for inference - Higher quality, better samplers, faster inference, and more features.
  • 2024-03-05 TCD sampler gets better results than LCM in 4-8 steps for SDXL models and is available on the samplers dropdown in the Advanced settings of the prompt.
  • 2024-02-16 FaceID Portrait has better color balance and similarity and is well suited for portraits.
  • 2024-02-08 Deprecate prompt aspect-ratio. Use width and height instead for better results (backward compatability available).
  • 2024-02-08 Added --fix_bindi to remove dot on the forehead.
  • 2024-01-30 Deprecated prompt expansion.
  • 2024-01-25 Upscale only Allows you to upscale an existing image.
  • 2024-01-17 FaceID Preserve identity without fine-tuning.
  • 2024-01-03 Tiled upscale improved upscaling.
  • 2023-12-14 Prompt masking feature added - to support product shots and Masked Portraits
  • 2023-11-27 LCM (Latent Consistency Models) scheduler allows inference in 6 steps
  • 2023-10-29 Face-Swap feature added - uses training images to improve inference time similarity
  • 2023-10-22 Themes - Have ChatGPT create 10 prompts for you from a short 2-4 word theme description.
- + \ No newline at end of file diff --git a/docs/features/backend-v1/index.html b/docs/features/backend-v1/index.html index 571a02ec..aa2a5104 100644 --- a/docs/features/backend-v1/index.html +++ b/docs/features/backend-v1/index.html @@ -7,13 +7,13 @@ - +

Backend V1

BETA

Backend V1 is a complete rewrite of the original image inference and processing pipeline. Here are some of the improvements:

  1. Hi-Res (aka Super-Resolution Details) for SDXL is available.
  2. Faster.
  3. Better handling of loading multiple LoRAs.
  4. DPM++/Karras and DPM++SDE/Karras better results, especially with SDXL.
  5. Civit results should be easy to reproduce.

Features still pending implementation for Backend V1:

  1. TCD sampler
  2. FaceID with --faceid_portrait
  3. --fix_bindi
info

As this is still in BETA stages, we encourage you to report any issues you may encounter using the support email.

Usage

You can find the "Backend version" dropdown in the Advanced settings of the prompt. Alternatively you may select the default account version for the account in the user account setting

For API usage provide the backend_version attribute in the Prompt payload. See: Create Prompt for more details.

Backend V1 advanced settings

- + \ No newline at end of file diff --git a/docs/features/face-inpainting/index.html b/docs/features/face-inpainting/index.html index 4e7b2939..09e8f01e 100644 --- a/docs/features/face-inpainting/index.html +++ b/docs/features/face-inpainting/index.html @@ -3,17 +3,17 @@ -Face Inpainting | Astria documentation +Face Inpainting | Astria documentation - +

Face Inpainting

Overview

Face inpainting is a feature that maintains facial similarity mainly in long-shot and full-body generations by performing additional facial enhancement. When enabled, it automatically improves facial consistency regardless of the shot distance.

Face Inpainting with Flux

source.png

Zoom on face - Before

source.png

Zoom on face - After

source.png

Full body longshot - before face inpainting

source.png

Full body longshot - after face inpainting

source.png

See examples in our gallery

Enabling Face Inpainting

Playground

To enable face inpainting, open the ‘Advanced’ settings when generating an image, and click the Inpaint faces toggle. Notice that this will turn on the super resolution toggle as well, which is necessary for this feature.

API

Use inpaint_faces and super_resolution in your prompt request.

Example Request

POST https://api.astria.ai/generate

{
"prompt": "<lora:1795721:1.0> Surrounded by the natural beauty of a serene, wooded environment, the ohwx woman exudes a sense of tranquility and connection with her surroundings. She wears a flowing, organic-inspired dress in earthy tones, her face framed by loose, windblown hair. The lighting is soft and diffused, creating a soothing, meditative atmosphere that invites the viewer to pause and connect with the moment.",
"num_images": 1,
"super_resolution": true,
"inpaint_faces": true,
"w": 896,
"h": 1152,
"scheduler": "euler_a",
"ar": "1:1"
}

Notes

When face inpainting is enabled the following occurs:

  • An additional inference cycle
  • This affects the total cost per generation - see our pricing page for details
  • Generation time will be a bit longer

Face inpainting Works with all Flux-based models, as well as SDXL and SD15

- + \ No newline at end of file diff --git a/docs/features/face-swap/index.html b/docs/features/face-swap/index.html index eaca00b5..7aa382ec 100644 --- a/docs/features/face-swap/index.html +++ b/docs/features/face-swap/index.html @@ -3,17 +3,17 @@ -Face Swap | Astria documentation +Face Swap | Astria documentation - + - + \ No newline at end of file diff --git a/docs/features/faceid-flux/index.html b/docs/features/faceid-flux/index.html index 6101886f..bb5c5a52 100644 --- a/docs/features/faceid-flux/index.html +++ b/docs/features/faceid-flux/index.html @@ -3,11 +3,11 @@ -FaceID for Flux | Astria documentation +FaceID for Flux | Astria documentation - + @@ -15,7 +15,7 @@

FaceID for Flux

BETA

See example prompts in the gallery

Overview

FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects.

Usage

  1. Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready. faceid-new-fine-tune.png
  2. Generate the image using the FaceID adapter using a syntax similar to LoRA - <faceid:ID:1>

Notes

  1. For realistic images, please consider enabling face-correct to improve facial features.

API

FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery. The fine-tune's trained_at is set upon creation and there is no training time. As such no callback is needed.

Step 1: Create fine-tune

POST /tunes

# With images as multipart/form-data
# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes
# https://www.astria.ai/gallery/tunes/690204/prompts
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[model_type]="faceid" \
-F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F "tune[images][]=@1.jpg" \
-F "tune[images][]=@2.jpg" \
-F "tune[images][]=@3.jpg" \
-F "tune[images][]=@4.jpg"

# With image_urls as form-data
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[model_type]="faceid" \
-F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"

# As JSON
cat > data.json <<- EOM
{
"tune": {
"title": "John Doe - UUID - 1234-6789-1234-56789",
"name": "man",
"model_type": "faceid",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",
"image_urls": [
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg"
]
}
}
EOM

curl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes

Response


[
{
"id": 1,
"title": "John Doe",
"name": "woman",
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"training_face_correct": false,
"ckpt_url": null,
"ckpt_urls": [],
"eta": "2023-10-02T14:32:40.363Z",
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"branch": "sd15",
"model_type": "faceid",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
},
{
"id": 775459,
"title": "Marry Jane",
"name": null,
"is_api": false,
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"training_face_correct": null,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"eta": "2023-09-23T16:07:49.137Z",
"trained_at": "2023-09-23T16:07:49.137Z",
"started_training_at": "2023-09-23T16:07:37.334Z",
"expires_at": "2023-10-23T16:07:49.137Z",
"created_at": "2023-09-23T16:07:36.606Z",
"branch": "sd15",
"model_type": "faceid",
"updated_at": "2023-09-23T16:07:49.138Z",
"url": "https://www.astria.ai/tunes/775459.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
]

Step 2: Create prompts

POST /tunes/:id/prompts

# Note the hard-coded 150494 which is the tune_id of Realistic Vision v5.1 from the gallery
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \
-F prompt[text]="<faceid:tune_id:strength> woman trekking in the alps" \
-F prompt[negative_prompt]="" \
-F prompt[super_resolution]=true \
-F prompt[face_correct]=true \
-F prompt[face_swap]=true \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
- + \ No newline at end of file diff --git a/docs/features/faceid/index.html b/docs/features/faceid/index.html index 17b16d1e..a94daff3 100644 --- a/docs/features/faceid/index.html +++ b/docs/features/faceid/index.html @@ -3,11 +3,11 @@ -FaceID | Astria documentation +FaceID | Astria documentation - + @@ -15,7 +15,7 @@

FaceID

BETA

See example prompts in the gallery

Overview

FaceID is a model adapter allowing to generate image while preserving a person identity without fine-tuning. Input images can be as few as just one image. The adapter was trained on human faces and cannot be used for pets or other subjects.

Usage

  1. Generate a placeholder fine-tune dataset which will contain the person images. The fine-tune will not go through training and will be immediately ready. faceid-new-fine-tune.png
  2. Generate the image using the FaceID adapter using a syntax similar to LoRA - <faceid:ID:1>

Notes

  1. Use cfg_scale=3
  2. FaceID can work nicely together with Face Swap to improve similarity.
  3. Disable Face-Swap in case your prompt is animation style. Additionally, make sure to select an animated model from the gallery.
  4. For fast generation use the LCM schedulers.
  5. For realistic images, please consider enabling face-correct to improve facial features.
  6. When creating a fine-tune: Base-model is only used as a default for UI generation but does not affect FaceID.
  7. When creating a fine-tune: steps and training_face_correct are not used for FaceID.

API

FaceID is an adapter loaded on top of a base model. As such the inference needs to take place on a model from the gallery. The fine-tune's trained_at is set upon creation and there is no training time. As such no callback is needed.

danger

If you are receiving 422 error model_type=faceid is not supported. Use a checkpoint instead - Change the request URL to https://api.astria.ai/tunes/690204/prompts with 690204 as a hard-coded tune_id of Realistic Vision v5.1 from the gallery. See explanation above.

Step 1: Create fine-tune

POST /tunes

# With images as multipart/form-data
# Hard coded tune id of Realistic Vision v5.1 from the gallery - https://www.astria.ai/gallery/tunes
# https://www.astria.ai/gallery/tunes/690204/prompts
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[model_type]="faceid" \
-F tune[callback]="https://optional-callback-url.com/webhooks/astria?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F "tune[images][]=@1.jpg" \
-F "tune[images][]=@2.jpg" \
-F "tune[images][]=@3.jpg" \
-F "tune[images][]=@4.jpg"

# With image_urls as form-data
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes \
-F tune[title]="John Doe - UUID - 1234-6789-1234-56789" \
-F tune[name]=man \
-F tune[model_type]="faceid" \
-F tune[callback]="https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1" \
-F tune[base_tune_id]=690204 \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg" \
-F "tune[image_urls][]=https://i.imgur.com/HLHBnl9.jpeg"

# As JSON
cat > data.json <<- EOM
{
"tune": {
"title": "John Doe - UUID - 1234-6789-1234-56789",
"name": "man",
"model_type": "faceid",
"callback": "https://optional-callback-url.com/to-your-service-when-ready?user_id=1&tune_id=1",
"image_urls": [
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg",
"https://i.imgur.com/HLHBnl9.jpeg"
]
}
}
EOM

curl -X POST -H"Content-Type: application/json" -H "Authorization: Bearer $API_KEY" --data @data.json https://api.astria.ai/tunes

Response


[
{
"id": 1,
"title": "John Doe",
"name": "woman",
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"training_face_correct": false,
"ckpt_url": null,
"ckpt_urls": [],
"eta": "2023-10-02T14:32:40.363Z",
"trained_at": "2023-10-02T14:32:40.363Z",
"started_training_at": "2023-10-02T14:32:05.229Z",
"expires_at": "2023-11-01T14:32:40.363Z",
"created_at": "2023-10-02T14:32:05.067Z",
"branch": "sd15",
"model_type": "faceid",
"updated_at": "2023-10-02T14:32:40.363Z",
"url": "https://www.astria.ai/tunes/788416.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
},
{
"id": 775459,
"title": "Marry Jane",
"name": null,
"is_api": false,
"token": "ohwx",
"base_tune_id": null,
"args": null,
"steps": null,
"face_crop": null,
"training_face_correct": null,
"ckpt_url": "https://sdbooth2-production.s3.amazonaws.com/mock",
"ckpt_urls": [
"https://sdbooth2-production.s3.amazonaws.com/mock"
],
"eta": "2023-09-23T16:07:49.137Z",
"trained_at": "2023-09-23T16:07:49.137Z",
"started_training_at": "2023-09-23T16:07:37.334Z",
"expires_at": "2023-10-23T16:07:49.137Z",
"created_at": "2023-09-23T16:07:36.606Z",
"branch": "sd15",
"model_type": "faceid",
"updated_at": "2023-09-23T16:07:49.138Z",
"url": "https://www.astria.ai/tunes/775459.json",
"orig_images": [
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock",
"https://sdbooth2-production.s3.amazonaws.com/mock"
]
}
]

Step 2: Create prompts

POST /tunes/:id/prompts

# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \
-F prompt[text]="<faceid:tune_id:strength> woman trekking in the alps" \
-F prompt[negative_prompt]="" \
-F prompt[super_resolution]=true \
-F prompt[face_correct]=true \
-F prompt[face_swap]=true \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
- + \ No newline at end of file diff --git a/docs/features/lcm/index.html b/docs/features/lcm/index.html index 12cde895..f785796b 100644 --- a/docs/features/lcm/index.html +++ b/docs/features/lcm/index.html @@ -3,17 +3,17 @@ -Latent Consistency Models | Astria documentation +Latent Consistency Models | Astria documentation - + - + \ No newline at end of file diff --git a/docs/features/lora/index.html b/docs/features/lora/index.html index 57b0ae8d..c01f95b7 100644 --- a/docs/features/lora/index.html +++ b/docs/features/lora/index.html @@ -7,13 +7,13 @@ - +

LoRA

LoRA (low ranking adaption) is a type of model fine-tuning which takes an additional set of model weights (or parameters) and trains those on top while not changing the existing model. For this reason LoRA training is faster comparing to full checkpoint training as it only trains a small amount of weights comparing to the full model. Additionally, LoRA can be loaded on top of any base model, and multiple LoRA can be combined.

The LoRA ecosystem contains many different types of weight structures with different ranks. For this reason some LoRA might not be compatible in different UIs or platforms.

LoRAs can be used to enhance the quality of the image or deepen a specific style that is desired.

Astria provides a LoRA gallery and allows importing external LoRAs. To use a LoRA go to the generate tab and use the LoRA syntax as such: <lora:name:weight>. For example, a very common usage <lora:epi_noiseoffset2:0.5> - will load a Noise offset lora at strength 0.5 which will turn the image a bit darker and deepen the contrast.

See example prompts in the gallery

You can also combine LoRAs as such:

<lora:epi_noiseoffset2:0.5><lora:FilmVelvia2:0.5><lora:add_detail:0.5><lora:epiCRealismHelper:0.2>
danger

Note that LoRA can reduce the similarity of trained subjects when used together. To avoid this use low-strength for the lora.

Some LoRAs may be trained on trigger words which are required to show in the prompt text. Check the LoRA information by clicking on the Website link and reading its docs and trigger words.

- + \ No newline at end of file diff --git a/docs/features/multiperson/index.html b/docs/features/multiperson/index.html index 59fa1775..74bbdc85 100644 --- a/docs/features/multiperson/index.html +++ b/docs/features/multiperson/index.html @@ -3,11 +3,11 @@ -Multi-Person | Astria documentation +Multi-Person | Astria documentation - + @@ -15,7 +15,7 @@

Multi-Person inference

BETA

Multiperson result

generated.png

See example prompts in the gallery

Overview

Multi-person inference is a feature that allows you to generate images with multiple people in them. See example prompts in the gallery or in the community feed.

See pricing for the cost of this feature.

Step 1: Training

Create a fine-tune for each person. Model can be either lora or a checkpoint.

img.png

Step 2 - Inference

Provide an input_image and controlnet=pose so that the generation has a solid image composition to start with. If no input_image is given, a constant pose input image (with arms crossed) will be used for each person.

The prompt is divided by the BREAK keyword such as:

  • 1st base prompt used to generate the background and scene.
  • 2nd common prompt that's concatenated to each person prompt and the base prompt to avoid repetition.
  • 3+ each person and its LoRA syntax reference (even for checkpoint)

Examples

1. Without an input image

Multiperson result

generated.png

Dramatic 1940s film noir scene. Couple standing together aiming guns, wooden paneled background.
BREAK
BREAK <lora:1533312:1.0> ohwx woman with determined expression, retro updo hairstyle, bright red lipstick, black and yellow color-blocked dress, aiming revolver with right hand
BREAK <lora:1558021:1.0> ohwx man with serious face, grey fedora hat, brown suit with patterned tie, white shirt, aiming pistol with left hand
num_images=4
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=1
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=1024
h=576

3. Prompt with input image as a background

In some cases it might be desired to keep the exact same background as the input image, and only change the people in the image. To do this, add an input_image and keep the base prompt empty, i.e: start the prompt with BREAK BREAK to keep both the base and common prompts empty.

Pose input image

multiperson-txt2img-pose.jpg

Multiperson result

multiperson-txt2img-pose.jpg

BREAK 
BREAK ohwx woman, red blouse jeans, and belt, holding a rifle <lora:749152:1>
BREAK ohwx man, dark vest <lora:749183:1>
num_images=4
negative_prompt=
seed=43
steps=30
cfg_scale=
controlnet=
input_image_url=https://sdbooth2-production.s3.amazonaws.com/4j0pej570oosmbj22xx6igf3gfi2
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=true
face_correct=false
film_grain=false
face_swap=true
hires_fix=true
ar=1:1
scheduler=dpm++sde_karras
color_grading=
use_lpw=true
w=
h=
- + \ No newline at end of file diff --git a/docs/features/outpainting/index.html b/docs/features/outpainting/index.html index cfb8106f..9b1d32d9 100644 --- a/docs/features/outpainting/index.html +++ b/docs/features/outpainting/index.html @@ -3,17 +3,17 @@ -Flux Outpainting | Astria documentation +Flux Outpainting | Astria documentation - +

Outpainting

For flux

Outpainting only

Input

outpainting for VTON

Outpainting only - no txt2img

Outpainting VTON result

txt2img + Outpainting

Txt2img only 1:1 (1024x1024)

outpainting for VTON

txt2img + outpaint to 9:16

Outpainting with txt2img result

txt2img + outpaint 16:9

outpainting for VTON

txt2img + outpaint 16:9

Outpainting with txt2img result

See outpaint examples in the gallery

Overview

Outpainting is a technique used to extend an image to bring in more context and background into the initally generated subject of the image. Examples for usage could be taking a 1:1 aspect-ratio (1024x1024) and extending it into a 16:9 cinematic view, or taking a waist up portrait 1:1 and extending it into a full body portrait 9:16. One of the advantages of this is better preservation of the face identity, as well as the ability of the model on focusing on the background generation due to it being separated into a separate task.

See pricing for the cost of this feature.

Usage

Below are the arguments that should be added at the end of the prompt text to enable outpainting:

  1. --outpaint - The anchor for outpainting. Options: top-left, top-right, bottom-left, bottom-right, center, top-center, bottom-center, left-center, right-center
  2. --outpaint_height
  3. --outpaint_width
  4. --outpaint_prompt - Optional

In case you're interested in setting an input image and doing only outpainting, and skipping the txt2img/img2img step, make sure to set denoising_strength: 0

Examples

Outpaint only

--outpaint top-center --outpaint_width 864 --outpaint_height 1296
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si
mask_image_url=
denoising_strength=0
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=true
w=576
h=864

txt2img + outpainting

<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=1024
h=1024

txt2img + multi-person outpainting

<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint left-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "president Trump the middle of the field"
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=1024
h=1024

API Usage

POST /tunes/1504944/prompts

# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery
# Outpaint only example
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \
-F prompt[text]="--outpaint top-center --outpaint_width 864 --outpaint_height 1296" \
-F prompt[denoising_strength]=0 \
-F prompt[input_image_url]="https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si" \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"

# txt2img + outpainting example
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \
-F prompt[text]='<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"' \
-F prompt[w]=1024 \
-F prompt[h]=1024 \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
- + \ No newline at end of file diff --git a/docs/features/prompt-masking/index.html b/docs/features/prompt-masking/index.html index 5d344816..2e5f1768 100644 --- a/docs/features/prompt-masking/index.html +++ b/docs/features/prompt-masking/index.html @@ -7,13 +7,13 @@ - +

Prompt Masking

Prompt masking uses a short text to create a mask from the input image. The mask can then be used to inpaint parts of the image. Use the below parameters as part of the prompts to use auto-masking

Prompt masking can be used for product shots or Masked Portraits.

See example prompts in the gallery

danger

SDXL inpainting results are poor. Use SD15 models instead.

Syntax

Below parameters should be used as text inside the prompt text

--mask_prompt

A short text like foreground or face, head or person.

--mask_negative

A space separated list of words that should not appear in the mask. e.g: clothes hat shoes

--mask_invert

Inverts the mask

--mask_dilate

Dilates the mask. Negative values will erode the mask. Use percentage values like -20% or -20 if input image size is dynamic.

--hires_denoising_strength

Denoising strength for hires-fix. Use hi-res fix with prompt-masking to smooth the colors and blending. Range 0-1. Default: 0.4.

realistic digital painting, astronaut in a garden on a spring day, by martine johanna and simon stalenhag and chie yoshii and casey weldon and wlop, ornate, dynamic, particulate, rich colors, intricate, elegant, highly detailed, harpers bazaar art, fashion magazine, smooth, sharp focus, 8 k, octane rende --mask_prompt foreground --mask_negative clothes --mask_invert --mask_dilate -20 --hires_denoising_strength 0.1
num_images=1
negative_prompt=clay, text, watermark, padding, cropped, typography
seed=
steps=30
cfg_scale=
controlnet=pose
input_image_url=https://sdbooth2-production.s3.amazonaws.com/esfd53purhhcijhmzka4c364x6lb
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=true
film_grain=false
face_swap=false
hires_fix=true
ar=1:1
scheduler=dpm++sde_karras
color_grading=
use_lpw=true
w=
h=
- + \ No newline at end of file diff --git a/docs/features/styles/index.html b/docs/features/styles/index.html index 7d3cead9..51f0608d 100644 --- a/docs/features/styles/index.html +++ b/docs/features/styles/index.html @@ -3,17 +3,17 @@ -Styles | Astria documentation +Styles | Astria documentation - +

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

Animated

Animated

Comic book

Comic book

Line art

Lineart

Enhance

Enhance

Fantasy art

Fantasy art

Lowpoly

Lowpoly

Neonpunk

Neonpunk

Photographic

Photographic

Usage

Styles can be used in the GUI style dropdown or in the API using the style attribute. When using a style template, provide a short prompt text describing the main subject and scene, while leaving the generic style keywords to the template.

- + \ No newline at end of file diff --git a/docs/features/tiled-upscale/index.html b/docs/features/tiled-upscale/index.html index 9cc13b3e..b420c19c 100644 --- a/docs/features/tiled-upscale/index.html +++ b/docs/features/tiled-upscale/index.html @@ -3,11 +3,11 @@ -Tiled upscale | Astria documentation +Tiled upscale | Astria documentation - + @@ -16,7 +16,7 @@ See example prompts in the gallery

Usage

To enable tiled upscale, add --tiled_upscale_v2 to the prompt text, or --tiled_upscale for the legacy version. Tiled upscale V2 requires Backend V1. Customize parameters tiled upscale if needed with the following flags and the default values:

  1. --hires_cfg_scale 5.5
  2. --resemblance 0.65

See pricing for the cost details.

Tiled Upscale V2

Tiled upscale V2 uses SDXL tile controlnet which better preserves identity and similarity while adding details and skin tones, and helps avoid the oversmoothing and painterly look of the original image.

Example

photograph of a woman, (smiling facial expression:1.1), textured skin, goosebumps, (blonde hair:1.2), (unbuttoned white shirt:1.2), distressed boyfriend jeans, long sleeves, (candlelight,chiaroscuro:1.1), cowboy shot, dark and mysterious cave with unique rock formations and hidden wonders, perfect eyes, Porta 160 color, shot on ARRI ALEXA 65, bokeh, sharp focus on subject, shot by Don McCullin --tiled_upscale_v2
num_images=2
negative_prompt=nude, nsfw, (CyberRealistic_Negative-neg:0.8), (deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation
seed=43
steps=30
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
ar=1:1
scheduler=dpm++sde_karras
color_grading=
use_lpw=true
w=512
h=768
- + \ No newline at end of file diff --git a/docs/tags/ai-avatars/index.html b/docs/tags/ai-avatars/index.html index f22d9f21..79983500 100644 --- a/docs/tags/ai-avatars/index.html +++ b/docs/tags/ai-avatars/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/ai-headshots/index.html b/docs/tags/ai-headshots/index.html index 2ff88299..bdf00d10 100644 --- a/docs/tags/ai-headshots/index.html +++ b/docs/tags/ai-headshots/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/ai-photoshoot/index.html b/docs/tags/ai-photoshoot/index.html index bba99aa3..92327f71 100644 --- a/docs/tags/ai-photoshoot/index.html +++ b/docs/tags/ai-photoshoot/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/animated/index.html b/docs/tags/animated/index.html index e687679f..f9b4763f 100644 --- a/docs/tags/animated/index.html +++ b/docs/tags/animated/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "animated"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/api/index.html b/docs/tags/api/index.html index 5b8ac64f..109f9f25 100644 --- a/docs/tags/api/index.html +++ b/docs/tags/api/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "api"

View All Tags

Flux API usage

For an overview of Flux fine-tuning, see Flux fine-tuning

- + \ No newline at end of file diff --git a/docs/tags/avatars/index.html b/docs/tags/avatars/index.html index d708336d..fe11fc14 100644 --- a/docs/tags/avatars/index.html +++ b/docs/tags/avatars/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/backend-v-0/index.html b/docs/tags/backend-v-0/index.html index d9c89892..3e32b0b0 100644 --- a/docs/tags/backend-v-0/index.html +++ b/docs/tags/backend-v-0/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/background-replacement/index.html b/docs/tags/background-replacement/index.html index f4d1fca1..7bffd10d 100644 --- a/docs/tags/background-replacement/index.html +++ b/docs/tags/background-replacement/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "background replacement"

View All Tags
- + \ No newline at end of file diff --git a/docs/tags/cinematic/index.html b/docs/tags/cinematic/index.html index e3a87a18..90b01637 100644 --- a/docs/tags/cinematic/index.html +++ b/docs/tags/cinematic/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/clarity/index.html b/docs/tags/clarity/index.html index 28908d91..c8b00b10 100644 --- a/docs/tags/clarity/index.html +++ b/docs/tags/clarity/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/clothing/index.html b/docs/tags/clothing/index.html index 7d13ab8d..705ecdc3 100644 --- a/docs/tags/clothing/index.html +++ b/docs/tags/clothing/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/comic-book/index.html b/docs/tags/comic-book/index.html index a9eb1426..c3d01e86 100644 --- a/docs/tags/comic-book/index.html +++ b/docs/tags/comic-book/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "comic book"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/creative-upscaler/index.html b/docs/tags/creative-upscaler/index.html index f6eb9a3a..ac5caa77 100644 --- a/docs/tags/creative-upscaler/index.html +++ b/docs/tags/creative-upscaler/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/e-commerce/index.html b/docs/tags/e-commerce/index.html index fc4e6dfe..f5f114c6 100644 --- a/docs/tags/e-commerce/index.html +++ b/docs/tags/e-commerce/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/ecommerce/index.html b/docs/tags/ecommerce/index.html index 609262c3..3c1af456 100644 --- a/docs/tags/ecommerce/index.html +++ b/docs/tags/ecommerce/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/enhance/index.html b/docs/tags/enhance/index.html index 6e789d29..6e174a76 100644 --- a/docs/tags/enhance/index.html +++ b/docs/tags/enhance/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "enhance"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/fantasy-art/index.html b/docs/tags/fantasy-art/index.html index f891f224..8c135de9 100644 --- a/docs/tags/fantasy-art/index.html +++ b/docs/tags/fantasy-art/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "fantasy art"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/fashion/index.html b/docs/tags/fashion/index.html index 008c8c9e..6d0ed774 100644 --- a/docs/tags/fashion/index.html +++ b/docs/tags/fashion/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/fine-tuning/index.html b/docs/tags/fine-tuning/index.html index 14c05c31..44f83f59 100644 --- a/docs/tags/fine-tuning/index.html +++ b/docs/tags/fine-tuning/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/flux/index.html b/docs/tags/flux/index.html index 947439ef..66d19490 100644 --- a/docs/tags/flux/index.html +++ b/docs/tags/flux/index.html @@ -7,13 +7,13 @@ - +

2 docs tagged with "flux"

View All Tags

Flux API usage

For an overview of Flux fine-tuning, see Flux fine-tuning

- + \ No newline at end of file diff --git a/docs/tags/garment/index.html b/docs/tags/garment/index.html index de3ec079..d609e786 100644 --- a/docs/tags/garment/index.html +++ b/docs/tags/garment/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/headshots/index.html b/docs/tags/headshots/index.html index fc93c716..f6d465bf 100644 --- a/docs/tags/headshots/index.html +++ b/docs/tags/headshots/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/image-enhancement/index.html b/docs/tags/image-enhancement/index.html index b9c9e6ff..c062799f 100644 --- a/docs/tags/image-enhancement/index.html +++ b/docs/tags/image-enhancement/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/index.html b/docs/tags/index.html index d6f86157..a35839d9 100644 --- a/docs/tags/index.html +++ b/docs/tags/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/line-art/index.html b/docs/tags/line-art/index.html index ff9fa47c..263be5bf 100644 --- a/docs/tags/line-art/index.html +++ b/docs/tags/line-art/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "line art"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/lineart/index.html b/docs/tags/lineart/index.html index 55b6f82f..9dcb3c21 100644 --- a/docs/tags/lineart/index.html +++ b/docs/tags/lineart/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/lo-ra/index.html b/docs/tags/lo-ra/index.html index ed535bf4..1ba410f8 100644 --- a/docs/tags/lo-ra/index.html +++ b/docs/tags/lo-ra/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/lora/index.html b/docs/tags/lora/index.html index 8c21b051..d208514e 100644 --- a/docs/tags/lora/index.html +++ b/docs/tags/lora/index.html @@ -7,13 +7,13 @@ - +

2 docs tagged with "lora"

View All Tags

Flux API usage

For an overview of Flux fine-tuning, see Flux fine-tuning

- + \ No newline at end of file diff --git a/docs/tags/lowpoly/index.html b/docs/tags/lowpoly/index.html index 9e0178a9..369029d5 100644 --- a/docs/tags/lowpoly/index.html +++ b/docs/tags/lowpoly/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "lowpoly"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/magnific/index.html b/docs/tags/magnific/index.html index 751ffa0e..871cc9f4 100644 --- a/docs/tags/magnific/index.html +++ b/docs/tags/magnific/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/neonpunk/index.html b/docs/tags/neonpunk/index.html index 61c7f508..090479ac 100644 --- a/docs/tags/neonpunk/index.html +++ b/docs/tags/neonpunk/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "neonpunk"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/noise-offset/index.html b/docs/tags/noise-offset/index.html index 5a18c99f..13048571 100644 --- a/docs/tags/noise-offset/index.html +++ b/docs/tags/noise-offset/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/oil-painting/index.html b/docs/tags/oil-painting/index.html index 536e5b84..3b71c0c1 100644 --- a/docs/tags/oil-painting/index.html +++ b/docs/tags/oil-painting/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/outpainting/index.html b/docs/tags/outpainting/index.html index 7fee36a9..e1001564 100644 --- a/docs/tags/outpainting/index.html +++ b/docs/tags/outpainting/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/photo-optimization/index.html b/docs/tags/photo-optimization/index.html index fcf3551f..76f9793e 100644 --- a/docs/tags/photo-optimization/index.html +++ b/docs/tags/photo-optimization/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/photographic/index.html b/docs/tags/photographic/index.html index 48f958c3..6bf3321f 100644 --- a/docs/tags/photographic/index.html +++ b/docs/tags/photographic/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "photographic"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/product-photo/index.html b/docs/tags/product-photo/index.html index 696d05d5..59a8f04a 100644 --- a/docs/tags/product-photo/index.html +++ b/docs/tags/product-photo/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/products/index.html b/docs/tags/products/index.html index 1ce1ce83..a30f2946 100644 --- a/docs/tags/products/index.html +++ b/docs/tags/products/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/prompt-styles/index.html b/docs/tags/prompt-styles/index.html index 837a03ab..1c19281d 100644 --- a/docs/tags/prompt-styles/index.html +++ b/docs/tags/prompt-styles/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "prompt styles"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/shopify/index.html b/docs/tags/shopify/index.html index ce4ca119..e59e916c 100644 --- a/docs/tags/shopify/index.html +++ b/docs/tags/shopify/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/social-profiles/index.html b/docs/tags/social-profiles/index.html index cef58dd0..0ee578c9 100644 --- a/docs/tags/social-profiles/index.html +++ b/docs/tags/social-profiles/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/style/index.html b/docs/tags/style/index.html index aea59c0c..61b1136a 100644 --- a/docs/tags/style/index.html +++ b/docs/tags/style/index.html @@ -7,13 +7,13 @@ - +

2 docs tagged with "style"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/super-resolution/index.html b/docs/tags/super-resolution/index.html index 54593f8f..674177f9 100644 --- a/docs/tags/super-resolution/index.html +++ b/docs/tags/super-resolution/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/templates/index.html b/docs/tags/templates/index.html index aa1ab3d8..a546f367 100644 --- a/docs/tags/templates/index.html +++ b/docs/tags/templates/index.html @@ -7,13 +7,13 @@ - +

One doc tagged with "templates"

View All Tags

Styles

Prompt style attribute allow to easily generate an image according to a preconfigured set of styles. The styles are essentially a set of weights that are applied to the model during the generation process.

- + \ No newline at end of file diff --git a/docs/tags/training/index.html b/docs/tags/training/index.html index ac6d360e..975ed783 100644 --- a/docs/tags/training/index.html +++ b/docs/tags/training/index.html @@ -7,13 +7,13 @@ - +

2 docs tagged with "training"

View All Tags

Flux API usage

For an overview of Flux fine-tuning, see Flux fine-tuning

- + \ No newline at end of file diff --git a/docs/tags/upscaling/index.html b/docs/tags/upscaling/index.html index bb25bd45..5f1e2a95 100644 --- a/docs/tags/upscaling/index.html +++ b/docs/tags/upscaling/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/virtual-influencers/index.html b/docs/tags/virtual-influencers/index.html index 721aca56..18f2baf4 100644 --- a/docs/tags/virtual-influencers/index.html +++ b/docs/tags/virtual-influencers/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/virtual-try-on/index.html b/docs/tags/virtual-try-on/index.html index 037c9901..f9b369cc 100644 --- a/docs/tags/virtual-try-on/index.html +++ b/docs/tags/virtual-try-on/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/tags/vton/index.html b/docs/tags/vton/index.html index 222b4220..131a4059 100644 --- a/docs/tags/vton/index.html +++ b/docs/tags/vton/index.html @@ -7,13 +7,13 @@ - + - + \ No newline at end of file diff --git a/docs/use-cases/ai-photoshoot/index.html b/docs/use-cases/ai-photoshoot/index.html index 240c25fe..d81a976e 100644 --- a/docs/use-cases/ai-photoshoot/index.html +++ b/docs/use-cases/ai-photoshoot/index.html @@ -3,17 +3,17 @@ -AI Photoshoot - fine-tuning for professional headshots | Astria documentation +AI Photoshoot - fine-tuning for professional headshots | Astria documentation - +

AI Photoshoot

Overview

The term "AI Photoshoot", "AI Headshots" or "AI Avatars" refers to the process of creating a generative AI model from around 16 images of a person. This model can then be used to create professional photography imagery of the person, without requiring high-end camera equipment, lighting, or wardrobe.

AI headshots are particularly useful for social profile photos, such as those used on LinkedIn or Facebook, as well as on dating sites.

Another recent trend is the creation of virtual social influencers - consistent characters that do not exist in reality, but can be generated consistently in different scenes and everyday life.

Training images

Fine-tuning training images

Output images

Generated images

Steps

1. Create a model

At this stage, we will create a 2GB numeric (AI) model file that contains the "features" of a person. This is not the part where we generate new images, but only train a dedicated AI model.

To begin, go to the New tune page.

Title - Enter the person's name, e.g. Elon Musk. Or choose whatever title that fits your needs. Choosing a title is not a part of the actual training of the model.

Class Name - Enter man or woman, or possibly boy, girl, cat, or dog. This is highly important as it is a part of the actual technical training of your model. We automatically generate images of the "class" while training, and by comparing them to your images (the training set), the model 'learns' your subject's unique features.

Base tune - Select a baseline model on which you would like to train. For best quality we recommend using Flux1.dev.

Other settings are optional and can be changed to your preference.

2. Generate images

Even before the model is ready, you can prepare a queue of prompts (texts) that will be fed into the model and used to generate models.

Tips for training images

  1. Upload both portrait and full body shots of the person
  2. Use 26 pictures of your subject. Preferably cropped to 1:1 aspect ratio.
  3. Use 6 photos of full body or entire object + 10 medium shot photos from the chest up + 10 close-ups.
  4. Variation is key - Change body pose for every picture, use pictures from different days backgrounds and lighting. Every picture of your subject should introduce new info about your subject.
  5. Avoid pictures taken at the same hour/day. For example few pictures with the same shirt will make the model learn the shirt as well as part of the subject.
  6. Always pick a new background.
  7. Do not upload pictures mixed with other people
  8. Do not upload upload funny faces

Tips for inference

  1. Use ohwx woman/man at the beginning of the sentence.
  2. Textual inversion can reduce similarity. Try to avoid it. Specifically TIs such as ng_deepnegative_v1_75t or CyberRealistic.
  3. Use of LoRA for styles can reduce similarity. Keep LoRA strength low around 0.2-0.3.
- + \ No newline at end of file diff --git a/docs/use-cases/controlnet/index.html b/docs/use-cases/controlnet/index.html index 128c05ac..eba2b0ec 100644 --- a/docs/use-cases/controlnet/index.html +++ b/docs/use-cases/controlnet/index.html @@ -3,17 +3,17 @@ -Controlnet | Astria documentation +Controlnet | Astria documentation - + - + \ No newline at end of file diff --git a/docs/use-cases/faq/index.html b/docs/use-cases/faq/index.html index e475df6d..5f1bba49 100644 --- a/docs/use-cases/faq/index.html +++ b/docs/use-cases/faq/index.html @@ -7,13 +7,13 @@ - +

FAQ

What image size should I upload?
Is there a size limit to uploads?

There is no hard limit on image uploads, the service does have some limits against JPEG bombs. A reasonable limit would be 3MB per image. The image size should be at least 512x512 pixels as models train on 512x512, but it's also a good idea to give some headroom for face-cropping, so possibly 1024x1024 or 2048x2048 could be a good target resize. Finally make sure compression level does not introduce artifacts to the uploaded images as the model is very sensitive to JPEG artifacts.

Why isn't it free?

For each model created using your training image, Astria creates an AI model using high-end GPU machines, and then serves those models to allow image generation. This process is expensive.

I didn't get my images. Where can I see it?

Check out your tunes page and click on the tune thumbnail to see your results.

Can I get higher resolution pictures?

Toggle the Super-resolution option in the prompt Advanced section.

How do I download my images ?

Go to https://www.astria.ai/tunes and click on the tune thumbnail, hit download to save the pictures of each prompt.

Generated images look weird. What happened?

See Fine-tuning guide and the AI Photohoot guide for tips on how to get the best results.

Can I download CKPT file? How do I use it?

  1. Once the fine-tune is done processing, you should be able to see a TAR and CKPT buttons at the top of the fine-tune page.
  2. You can use the CKPT with software like Automatic1111 and ComfyUI.

I would like to use your API for my service or app, would you be able to handle the load?

Astria is already powering some of the biggest companies and applications on the web and on the app-store using fine-tuning. All jobs are handled in parallel and there is no wait time or queuing.

What happens to my model, training pictures and image generations?

The entire fine-tune (including CKPT file, model, training pictures, generated images, prompts) is kept for 1 month, at the end of which it is all deleted. You can delete it at any time by clicking on the delete button in the fine-tunes page.

Can I extend my model beyond 30 days?

You can select to extend model storage in the billing page

Can I train a model for more than one person?

You can train a fine-tune using class_name=couple and get amazing results. Make sure that the couple appear in each of the training images together. In this case it might be harder for the model to create more variation and create long-shots and complex scenes.

- + \ No newline at end of file diff --git a/docs/use-cases/finetuning-guide/index.html b/docs/use-cases/finetuning-guide/index.html index f18f8a2f..ed11633c 100644 --- a/docs/use-cases/finetuning-guide/index.html +++ b/docs/use-cases/finetuning-guide/index.html @@ -3,11 +3,11 @@ -Fine-tuning guide | Astria documentation +Fine-tuning guide | Astria documentation - + @@ -15,7 +15,7 @@

Fine-tuning guide

The guide for high quality avatars and AI photography

When building an app for avatars or professional AI photoshoot, you should consider two aspects

  1. Similarity to the original subject
  2. High quality generation which look professional

Tracking subject similarity

Make sure to test results on a person you closely know and can judge similarity. Create a list of candidate prompts and run them on 2-3 subjects. For each prompt ask the person to rate how many of the images look similar. Finally sum the ratios for each prompt and compare prompts. Improve the prompts or reconsider a different prompt if similarity is low. Alternatively, consider switching to a different base model to match ethnicity or avoid biased models.

Fine-tuning training tips

  1. Enable Face-detection in your account settings page - This will augment the training dataset with face-crops from the original training images. This should increase similarity to the subject but can also cause generations to be more toward close-ups instead of nice medium or long shots. In this case you might need to adjust the prompts to use emphasis weights.
  2. Base model - Select plain SD15 for better resemblance. Select Realistic Vision V5.1 as a base model for nicer pictures. These models are good in realistic results. If you’d like to get generations that are more artistic - consider Deliberate or Reliberate as a base model. For a more diverse ethnically and possibly better similarity to subjects, consider Life Like Ethnicities. Finally, we suggest checking training on SDXL with text-embedding + LoRA.

Prompt generation tips

  1. Set width and height to 512 x 640 - to match Instagram aspect ratio of 4:5 and also create good portraits. Avoid higher aspect ratios as you might get artifacts such as duplicate heads.
  2. Enable face-inpainting - This is one of Astria’s unique features and allows creating long shots while avoiding deformed faces.
  3. Weighted prompts - when a prompt has multiple keywords that collide and reduce similarity - use the parenthesis syntax for emphasis to increase similarity, such as (ohwx man) On the flip side, try to avoid weighted prompts altogether to preserve similarity to subject.
  4. Use Controlnet with input image to preserve composition and create unique long-shots. Enable controlnet_txt2img if you’d like to create more variation and draw more from the prompt. Increase denoising_strength=1
- + \ No newline at end of file diff --git a/docs/use-cases/flux-finetuning/index.html b/docs/use-cases/flux-finetuning/index.html index 49bbeb95..8f93d5fb 100644 --- a/docs/use-cases/flux-finetuning/index.html +++ b/docs/use-cases/flux-finetuning/index.html @@ -3,17 +3,17 @@ -Flux training | Astria documentation +Flux training | Astria documentation - +

Flux training

Overview

Flux is a family of generative image models created by Black Forest Labs making use of some of the latest AI advancement such as diffusion, transformer (MMDiT), Flow-matching and a large T5 text encoder.

  • The large text encoder allows the text2img model to better align the image with the given prompt and create complex images with a single prompt.

  • The model base resolution is 1024x1024 however unlike previous models, was trained on a variety of aspect ratios its neural-network architecture is able to better cope with different aspect ratios both in training and inference.

  • Flux1.dev requires commercial licensing which is provided to Astria customers.

Input training imagesgenerated.png
Output imagesgenerated.png

Training presets

Astria uses training presets to evolve its training strategies and provide better results while also providing a stable API for its customers.

info

Our current recommendation is to use the portrait preset for training Flux models.

  1. Portrait - API flux-lora-portrait - This preset is generally recommended for any kind of training including non portraits, except for style training. With the latest portrait we now use more precise hyper-parameters for training, improved pre-processing, better handling of blurred/low-res images, face-cropping and focusing on learning face features, less overfitting to clothing and background. You will get more diverse images with better prompt alignment while better preserving identity and face. For this preset we default to 27 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements.
  2. Fast API flux-lora-fast - Legacy preset. Provides an alternative for the high preset, with faster training and lower cost. Similarly to the portrait preset, it uses 27 steps per image for training, with minimum steps of 300.
  3. High API null - High steps, low-learning rate. Should be used for style training or training sets with 20+ images. With the high preset, we default to 100 steps per image for training, with minimum steps of 300. You may override the number of steps depending on price and quality requirements.

Training tips

Default token for SDXL should be ohwx and will be set automatically if none is specified

  1. As with other models, a good training set is critical to getting great results. See AI photoshoot guide
  2. Astria currently defaults to 100 steps per image for training a Flux lora for the high preset, and 27 steps per image for the fast preset. Fast preset is recommended when training on people or headshots.
  3. You may opt to override the number of training steps in order to reduce costs and processing time. Reducing the steps can produce good results when the target inference images are similar to the input training images (like headshots). Example lower steps could be 600, 1000 or 1200 (roughly 50-70 * number of training images )

Inference tips

  1. Dense prompts - Flux works best when the prompt is descriptive and detailed, but as in most models, be concise. Overdoing the description can create conflicts in the inference.
  2. *No negatives - Flux doesn’t work with negatives, instead we suggest using positive prompts. For example, instead of writing ‘cartoon’ in the negative, write ‘realistic settings and characters’ in the prompt.
  3. No weighted prompts - using weights or parentheses () to emphasis certain parts of a prompt doesn’t work with Flux. Instead, make sure the important parts at the beginning of the prompt.
  4. Adding text in the image - One of the advantages of Flux is the ability to add text to an image. There are a few ways to do that, like “ohwx man holding a sign with the words ‘Hello’“.
  5. Looking for prompt ideas? Try the Themes feature. Themes uses Claude GPT to help write prompts for the specific model. You can add a theme and write any topic on your mind, and themes will produce 10 prompts on it.

API usage

See here for API usage

- + \ No newline at end of file diff --git a/docs/use-cases/inpainting-and-masking/index.html b/docs/use-cases/inpainting-and-masking/index.html index 668f7e23..62129584 100644 --- a/docs/use-cases/inpainting-and-masking/index.html +++ b/docs/use-cases/inpainting-and-masking/index.html @@ -7,13 +7,13 @@ - +
- + \ No newline at end of file diff --git a/docs/use-cases/masked-portraits/index.html b/docs/use-cases/masked-portraits/index.html index d3a3c667..cf85fda8 100644 --- a/docs/use-cases/masked-portraits/index.html +++ b/docs/use-cases/masked-portraits/index.html @@ -3,18 +3,18 @@ -Masked portraits | Astria documentation +Masked portraits | Astria documentation - +
-

Masked portraits

BETA

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

See example prompts in the gallery.

Overview

Use prompt masking feature to embed a person into a scene. +

Masked portraits

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

Input image

source.png

Result using RV v5.1

generated.png

using Cartoon

generated.png

Using Flat

generated.png

See example prompts in the gallery.

Overview

Use prompt masking feature to embed a person into a scene. This essentially allows you to create AI photogarphy or avatars without fine-tuning.

danger

SDXL inpainting results are poor. Use SD15 models instead.

See pricing for the cost of this feature.

Example prompt

realistic digital painting, astronaut in a garden on a spring day, by martine johanna and simon stalenhag and chie yoshii and casey weldon and wlop, ornate, dynamic, particulate, rich colors, intricate, elegant, highly detailed, harpers bazaar art, fashion magazine, smooth, sharp focus, 8 k, octane rende --mask_prompt foreground --mask_negative clothes --mask_invert --mask_dilate -20 --hires_denoising_strength 0.2
num_images=1
negative_prompt=clay, text, watermark, padding, cropped, typography
seed=
steps=30
cfg_scale=
controlnet=pose
input_image_url=https://sdbooth2-production.s3.amazonaws.com/d6ff3soq5pok5tlbcanf599vkw06
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=true
film_grain=false
face_swap=false
hires_fix=true
ar=1:1
scheduler=dpm++sde_karras
color_grading=
use_lpw=true
w=
h=

API usage

- + \ No newline at end of file diff --git a/docs/use-cases/product-shots/index.html b/docs/use-cases/product-shots/index.html index 8447dd19..f875cfb9 100644 --- a/docs/use-cases/product-shots/index.html +++ b/docs/use-cases/product-shots/index.html @@ -3,17 +3,17 @@ -Product placement | Astria documentation +Product placement | Astria documentation - +
- + \ No newline at end of file diff --git a/docs/use-cases/room-redesign/index.html b/docs/use-cases/room-redesign/index.html index 5b197c86..0f703e30 100644 --- a/docs/use-cases/room-redesign/index.html +++ b/docs/use-cases/room-redesign/index.html @@ -3,17 +3,17 @@ -AI Interior Design | Astria documentation +AI Interior Design | Astria documentation - +

AI Interior Design

Backend V1

Original room

Original room

Generated using mlsd

generated.png

Generated room using segroom + mlsd

Generated room using segroom + mlsd

Generated room with window masking

generated.png

Original sketch

Original room

Generated room with window masking

generated.png

See example prompts in the photobooth page or in the gallery.

Overview

AI Interrior design is the term for the process of generating images of a room with different furniture, wall colors, and decorations all while keeping the original room layout. This can be useful for interior designers, real estate agents, or when planning a renovation.

How to use

In order to preserve the room layout use either controlnet mlsd or segroom. Input images can be sketches, 3d models, or photos of the room. Depending on the input, you might need to adjust the strength and combination of controlnets as well as the prompts.

Controlnet segroom is a specific controlnet that was trained to preserve the meaning of the room layout, such as walls and windows.

Controlnet mlsd is a more general model, used with a pre-processor that produces straight lines and is suitable for architecture.

mlsd is support for both SDXL and SD1.5 models while segroom is only available for SD1.5 models.

Additionally you may decide to automatically mask out windows and doors by using the --mask_prompt windows door --mask_invert prompt. See more information on prompt masking syntax.

Example prompt

Clean scandinavian design living room, natural light, architecture magazine cover  <lora:epi_noiseoffset2:0.5><lora:FilmVelvia2:0.5><lora:add_detail:0.5><lora:epiCRealismHelper:0.2> --mask_prompt windows door --mask_invert --controlnets mlsd segroom --controlnet_weights 0.5 1
num_images=1
negative_prompt=painted, sketch, deformed, easynegative
seed=
steps=30
cfg_scale=
controlnet=lineart
input_image_url=https://sdbooth2-production.s3.amazonaws.com/du6cwkp9nojx3ze66vv5nqi39jxo
mask_image_url=
denoising_strength=1
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=true
backend_version=1
ar=1:1
scheduler=dpm++sde_karras
color_grading=
use_lpw=true
w=
h=
- + \ No newline at end of file diff --git a/docs/use-cases/sdxl-training/index.html b/docs/use-cases/sdxl-training/index.html index 5374ab0a..d44e7d03 100644 --- a/docs/use-cases/sdxl-training/index.html +++ b/docs/use-cases/sdxl-training/index.html @@ -3,17 +3,17 @@ -SDXL training | Astria documentation +SDXL training | Astria documentation - +

SDXL training

Overview

Stable Diffusion XL or SDXL is the 2nd gen image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition. SDXL can generate realistic faces, legible text within the images, and better image composition, all while using shorter and simpler prompts.

info

LoRA + Text-embedding is currently the only option for fine-tuning SDXL.

Input training imagesgenerated.png
Output imagesgenerated.png

Training tips

Default token for SDXL should be ohwx and will be set automatically if none is specified

Inference tips

  1. Do not copy and paste prompts from SD15
  2. Do not use textual-inversions such as easynegative or badhands from SD15
  3. Consider activating face-swap and face-inpainting (which in turn requires super-resolution) - this is the biggest boost you can get to increase similarity to subject
  4. Use clean small concise prompts - usually up to 15 words
  5. Avoid long negatives - this will decrease similarity to subject.
  6. Start with baseline SDXL 1.0 inference before going to other base models. Most custom SDXL models are biased and may reduce similarity. Models which we noticed that work okay are ZavyChromaXL and ClearChromaXL

All above tips will help increase similarity to the original subject.

Aspect ratios

The below aspect ratios are recommended for SDXL inference since these were also used for the training.

aspect: width, height
0.5: 704, 1408
0.52: 704, 1344
0.57: 768, 1344
0.6: 768, 1280
0.68: 832, 1216
0.72: 832, 1152
0.78: 896, 1152
0.82: 896, 1088
0.88: 960, 1088
0.94: 960, 1024
1.0: 1024, 1024
1.07: 1024, 960
1.13: 1088, 960
1.21: 1088, 896
1.29: 1152, 896
1.38: 1152, 832
1.46: 1216, 832
1.67: 1280, 768
1.75: 1344, 768
1.91: 1344, 704
2.0: 1408, 704
2.09: 1472, 704
2.4: 1536, 640
2.5: 1600, 640
2.89: 1664, 576
3.0: 1728, 576

API usage

See here for API usage

- + \ No newline at end of file diff --git a/docs/use-cases/toonify/index.html b/docs/use-cases/toonify/index.html index e8741bc7..af5d441d 100644 --- a/docs/use-cases/toonify/index.html +++ b/docs/use-cases/toonify/index.html @@ -3,17 +3,17 @@ -Toonify | Astria documentation +Toonify | Astria documentation - + - + \ No newline at end of file diff --git a/docs/use-cases/upscale/index.html b/docs/use-cases/upscale/index.html index de5c3131..ad927dd8 100644 --- a/docs/use-cases/upscale/index.html +++ b/docs/use-cases/upscale/index.html @@ -3,17 +3,17 @@ -Upscale | Astria documentation +Upscale | Astria documentation - +

Upscale

BETA

Low-res input

upscale-input

Low-res input
Low-res input

upscale-input

Low-res input

See example prompts in the gallery. Also check out free upscaling tool page.

Overview

Upscaling uses model and text guidance to add details to original image. Depending on the denoising_strength the model can hallucinate more details shifting away from the original image. For applying tiled upscaling straight after image generation see tiled upscaling.

Usage

  1. In the prompts generate page - Set an input image in the Controlnet/img2img section.
  2. Add a text prompt ending with --only_upscale
  3. Select a model from the dropdown that matches the style and content of the input image.

Example

Example prompt for the result above

masterpiece, best quality, highres, <lora:more_details:0.5> <lora:SDXLrender_v2.0:1> --only_upscale
num_images=1
negative_prompt=(worst quality, low quality, normal quality:2) JuggernautNegative-neg
seed=
steps=16
cfg_scale=6.0
controlnet=
input_image_url=https://sdbooth2-production.s3.amazonaws.com/cvrx6g5wx5tbiuz9ivoah1j19why
mask_image_url=
denoising_strength=0.1
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=1
prompt_expansion=undefined
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=
h=

POST /tunes/:id/prompts

# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/690204/prompts \
-F prompt[text]=very detailed, masterpiece, intricate details, UHD, 8K --only_upscale <lora:add_detail:1>" \
-F prompt[negative_prompt]="lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts" \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"
const fetch = require('node-fetch');
const FormData = require('form-data');

// Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery
const API_URL = 'https://api.astria.ai/tunes/690204/prompts';
const API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key
const headers = { Authorization: `Bearer ${API_KEY}` }

const form = new FormData();
form.append('prompt[text]', 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale <lora:add_detail:1>');
form.append('prompt[negative_prompt]', 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts');
form.append('prompt[callback]', 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1');

fetch(API_URL, {
method: 'POST',
headers: headers,
body: form
}).then(response => response.json())


import requests

# Note the hard-coded 690204 which is the tune_id of Realistic Vision v5.1 from the gallery
API_URL = 'https://api.astria.ai/tunes/690204/prompts'
API_KEY = 'YOUR_API_KEY' # Replace with your actual API key

headers = {
'Authorization': f'Bearer {API_KEY}'
}

data = {
'prompt[text]': 'very detailed, masterpiece, intricate details, UHD, 8K --only_upscale <lora:add_detail:1>',
'prompt[negative_prompt]': 'lowres, medium quality, lack of details, bad quality, worst quality, blur, blurry, pixelated, jpeg artifacts',
'prompt[callback]': 'https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1'
}
files = []
files.append((f"tune[prompts_attributes][{i}][input_image]", load_image(prompt['input_image'])))


response = requests.post(API_URL, headers=headers, data=data)
- + \ No newline at end of file diff --git a/docs/use-cases/video-generation/index.html b/docs/use-cases/video-generation/index.html index 2cc3302d..8f276296 100644 --- a/docs/use-cases/video-generation/index.html +++ b/docs/use-cases/video-generation/index.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@

Video Generation

To generate video use the regular prompt text box, and enter the frame number followed by a colon and the prompt to activate video generation frame number: prompt Don’t forget to use your model’s token. For example:

  0: portrait of ohwx woman with eyes closed
25: portrait of ohwx woman with eyes opened
50: portrait of ohwx woman smiling

Notice that the last prompt marks the end of the video generation and will not be rendered. When not specified in the prompt, our default camera movement is:

  translation_z=0:(-0.5)
rotation_3d_x=0:(2*sin(3.14*t/100)/80)
rotation_3d_y=0:(2*sin(3.14*t/100)/40)
rotation_3d_z=0:(2*sin(3.14*t/50)/40)

The camera will slowly pull back and wiggle-rotate slightly. You can always adjust the camera movement by adding parameters at the start of the prompt. For example:

  translation_x=0:(-2)
translation_y=0:(1)
translation_z=0:(0.5)
rotation_3d_x=0:(0)
rotation_3d_y=0:(1.5)
rotation_3d_z=0:(0)
0: portrait of ohwx woman with eyes closed
25: portrait of ohwx woman with eyes opened
50: portrait of ohwx woman smiling

The X-axis is a left/right translation; a positive translation shifts the camera to the right.

The Y-axis is an up/down translation; a positive translation shifts the camera upward.

The Z-axis is a forward/backward translation; a positive translation shifts the camera forward.

Parameters

Here is a partial list of parameters you can use in the prompt line to achieve certain control and effects:

strength_schedule=0:(0.50) How “loose” is the image generation from the previous frame. Lower numbers increase the probability of realizing the next prompt, but decrease the probability of temporal coherence.

seed=1 A starting point for an outcome (-1=random starting point)

diffusion_cadence=2 Blending of frames in the sequence

Check out the video gallery for inspiration. You can always copy/paste prompts to your tune. Don’t forget to change the token accordingly.

The video module is based on the Deforum Stable Diffusion notebook, and use the same parameters.

- + \ No newline at end of file diff --git a/docs/use-cases/virtual-try-on/index.html b/docs/use-cases/virtual-try-on/index.html index 257ac770..47bdd3b5 100644 --- a/docs/use-cases/virtual-try-on/index.html +++ b/docs/use-cases/virtual-try-on/index.html @@ -3,17 +3,17 @@ -Virtual Try-on for Flux | Astria documentation +Virtual Try-on for Flux | Astria documentation - +

Virtual Try-on for Flux

BETA. Flux + Backend V0 only feature.

Garment / Clothing - with a model - Recommended

Person + Garment

Generated images

Person + Garment

Garment / Clothing - with a model - Recommended

Person + Garment

Generated images

Person + Garment

Sports virtual try-on

Person + Garment

Generated images

Person + Garment

Garment / Clothing - Flat lay - must indicate "flat lay" in title - not recommended

Garment / Clothing

Generated images

Person + Garment

More examples in the gallery

Overview

Virtual try-on is the term for the process of generating images of a person wearing a specific garment or clothing item. This can be useful for e-commerce websites, fashion designers, or even for personal use.

See pricing for the cost of this feature.

Usage

To use Astria's virtual try-on feature, you need to create:

  1. A faceid fine-tune of the garment you want to try on. The faceid class name should be clothing, shirt or pants, coat or swimming suit. Class name is used to identify the garment in the image and remove the original model in case a reference image with a fashion model is used.
  2. Optional: A model of the person you want to dress up ideally through fine-tuning

Garment reference image

When creating a faceid of the garment, two types of images are possible for use:

  1. Reference image with a human model. This is recommended as it allows the virtual try-on AI model to infer relative position to the body and get a better understanding of the garment.
  2. Flat lay image - a plain image of the garment. In this case, image title must include the wording flat lay in the faceid tune description.
Virtual try on step 1 create reference

Tips for inference

  1. For the virtual try-on to work, generated image or input image must show elbows or lower part body. Use waist up or long shot in your prompt.
  2. To reference the garment use the <faceid:xxxxxx:1> syntax, where xxxxxx is the faceid of the garment.
  3. If a face of a specific model is desired, use a fine-tuned LoRA fine-tuned.
  4. Use a short prompt to describe the background, pose and composition. For example woman wearing a black shirt and jeans, fashion editorial plain white background.
  5. In case a reference image to the garment includes a fashion model, a better alternative to this, could be to use the input image as a reference pose as well as img2img to bring some of the background features into the image. See above example for dress and respective prompt below.
  6. Use 9:16 aspect-ratio i.e: 768x1280 width x height for generating the image.
  7. Use controlnet pose, preferably preprocessed stick figure. Set controlnet conditioning scale to a low 0.3-0.5 and
  8. Turn on super resolution, super resolution details and inpaint faces for better results.
  9. Avoid occlusions covering the garment in the generated image such as hands or a bag - The garment should be clearly visible.

Examples

Dress example prompt:

<lora:1533312:1.0>  <faceid:1350339:1> front view of ohwx woman wearing dress, fashion editorial plain, white background --control_guidance_end 0.5
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=pose
input_image_url=https://sdbooth2-production.s3.amazonaws.com/lttvv8rz1olcf28cah48igiydwqi
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=0.5
controlnet_txt2img=false
super_resolution=true
inpaint_faces=true
face_correct=false
film_grain=false
face_swap=false
hires_fix=true
backend_version=0
ar=1:1
scheduler=dpm++2m_karras
color_grading=
use_lpw=true
w=768
h=1280

Guns and roses flat lay t-shirt example prompt:

<lora:1533312:1.0>  <faceid:1823239:1.0> closeup view of ohwx woman wearing Guns And Roses shirt, fashion editorial plain, white background --control_guidance_end 0.5
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=0.5
controlnet_txt2img=true
super_resolution=true
inpaint_faces=true
face_correct=false
film_grain=false
face_swap=false
hires_fix=true
backend_version=0
ar=1:1
scheduler=dpm++2m_karras
color_grading=
use_lpw=true
w=768
h=1280
- + \ No newline at end of file diff --git a/index.html b/index.html index 3ccbd5b3..815acee6 100644 --- a/index.html +++ b/index.html @@ -7,13 +7,13 @@ - +

Astria documentation

Fine-tuning and high quality image generation

- + \ No newline at end of file diff --git a/markdown-page/index.html b/markdown-page/index.html index 3977a771..aa6e98ed 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -7,13 +7,13 @@ - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file