PageSourceSearch

https://app.aieasypic.com/_next/static/chunks/pages/tools/instant-avatars_hidden-bbcc0789aa2090a1.js

js aieasypic.com collected 2026-10-04 13:25:05 UTC 8,913 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7849],{42524:(e,t,a)=>{"use strict";function i(e,t,a){return Math.min(Math.max(e,t),a)}a.d(t,{q:()=>i})},68469:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>L});var i=a(6029),r=a(90967),n=a(28945),s=a(69943),l=a(63887),o=a(13445),d=a(99690),c=a(13692),u=a(87462),g=a(74536),h=a(24565),m=a(37948),p=a(26500),f=a(7703),w=a(84335),x=a(50433),v=a(73075),j=a(35670),_=a(18090),y=a(50016),b=a(73641),I=a(87041),P=a(27835),k=a(75185),A=a(34417),C=a(1751),U=a(89948),D=a(92907),E=a(74312),M=a.n(E),Y=a(55729),S=a(40340);let L=()=>{let[e,t]=(0,Y.useState)({source:{preview:null,uploaded:!1,uploadedId:"",type:""},source_second:{preview:null,uploaded:!1,uploadedId:"",type:""},target:{preview:null,uploaded:!1,uploadedId:"",type:""}}),[a,E]=(0,Y.useState)("a portrait, masterpiece, van gogh style"),{setInferenceJobId:L,pollJobStatus:R,processedImageUrl:F,inferenceJobLoading:T,inferenceJobId:N,setProcessedImageUrl:O,isLoading:B}=(0,k.V)({defaultProcessedImageUrl:null}),[W,z]=(0,j.M)({key:"freeGenerations".concat(M()().format("YYYY-MM-DD")),defaultValue:U.iF}),{data:V}=(0,A.P)(),G=(0,C.piO)(),{data:J}=(0,C.Pns)({civit_model_version_name:"turbo",has_prompt:!0,nsfw:!1}),[$,q]=(0,Y.useState)({first_weight:.5,second_weight:.5}),X=async()=>{if(e.source.uploading||e.target.uploading||e.source_second.uploading)return void(0,_.Ds)({title:"Error",message:"Please wait for the images to finish uploading",color:"red"});if(!e.source.uploadedId||!e.target.uploadedId||!e.source_second.uploadedId)return void(0,_.Ds)({title:"Error",message:"Please upload all images",color:"red"});try{let{id:t}=await G.mutateAsync({data:{input_image:e.source.uploadedId,source_second_image:e.source_second.uploadedId,target_image:e.target.uploadedId,prompt:a,first_weight:"0.7",second_weight:"1.5"}});L(t),await R()}catch(e){console.error("Error starting face swap process:",e)}};return(0,i.jsxs)(I.A,{children:[(0,i.jsx)(P.A,{title:"FaceSwap Image - ".concat(D._g.fullSiteName),description:"FaceSwap Images using ".concat(D._g.fullSiteName)}),(0,i.jsxs)(s.x,{align:"baseline",children:[(0,i.jsxs)(l.f,{span:12,lg:6,children:[(0,i.jsxs)(o.B,{children:[(0,i.jsxs)(o.B,{spacing:10,my:5,children:[(0,i.jsxs)(d.Y,{noWrap:!0,spacing:5,position:"center",children:[(0,i.jsx)(c._,{src:"/android-chrome-512x512.png",width:40,height:40,alt:"Logo"}),(0,i.jsx)(u.h,{order:1,sx:e=>({[e.fn.smallerThan("md")]:{fontSize:"22px"}}),children:D._g.siteName})]}),(0,i.jsx)(u.h,{align:"center",order:4,children:"Start your journey with our AI avatar generator."})]}),(0,i.jsxs)(g.Z,{shadow:"sm",padding:"lg",children:[(0,i.jsxs)(s.x,{children:[(0,i.jsx)(l.f,{span:6,children:(0,i.jsx)(n.A,{images:e,type:"source",description:"Face used from this image",setImages:t,setProcessedImageUrl:O})}),(0,i.jsx)(l.f,{span:6,children:(0,i.jsx)(n.A,{images:e,type:"source_second",description:"Face used from this image",setImages:t,setProcessedImageUrl:O})}),(0,i.jsx)(l.f,{span:6,children:(0,i.jsx)(n.A,{images:e,type:"target",description:"Position used from this image",setImages:t,setProcessedImageUrl:O})})]}),(0,i.jsx)(h.k,{my:10,value:a,label:"Prompt",description:(0,i.jsxs)(d.Y,{position:"apart",p:0,mt:-25,align:"flex-end",children:[(0,i.jsx)(m.E,{children:"What you want in the image."}),(0,i.jsxs)(o.B,{align:"center",spacing:2,onClick:()=>{if(null==J?void 0:J.results){var e;let t=J.results[Math.floor(Math.random()*(null==(e=J.results)?void 0:e.length))];(null==t?void 0:t.prompt)&&E(t.prompt.replace(/<lora:[^>]+>/g,""))}},children:[(0,i.jsx)(p.M,{children:(0,i.jsx)(y.jfu,{transform:"scale(1.5)"})}),"Random"]})]}),onChange:e=>E(e.currentTarget.value),placeholder:"man with glasses, taking a selfie, van gogh style"})]})]}),(0,i.jsxs)(o.B,{children:[(0,i.jsx)(f.A,{value:$.first_weight,onChange:e=>q({...$,first_weight:e}),step:.1,min:0,max:2}),(0,i.jsx)(f.A,{value:$.second_weight,onChange:e=>q({...$,second_weight:e}),step:.1,min:0,max:2})]}),(0,i.jsxs)(w.$,{size:"lg",mt:"lg",onClick:X,fullWidth:!0,children:["Create Avatar"," ",!(null==V?void 0:V.email)&&"".concat(W,"/").concat(U.iF)]}),(0,i.jsx)(r.A,{eventName:"InstantId"})]}),(0,i.jsxs)(l.f,{span:12,lg:5,offsetLg:1,children:[(0,i.jsx)(u.h,{align:"center",children:"Avatar Preview"}),(0,i.jsx)(x.a,{sx:{minHeight:"400px"},children:(null==e?void 0:e.target.preview)&&F?(0,i.jsx)(S.EW,{itemOne:(0,i.jsx)(S.D4,{src:e.target.preview?"string"==typeof e.target.preview?e.target.preview:URL.createObjectURL(e.target.preview):"",alt:"Target Image",width:400,height:400}),itemTwo:F?(0,i.jsx)(S.D4,{src:F,alt:"Processed Image",width:400,height:400}):(0,i.jsx)(v.E,{height:500,width:500})}):(0,i.jsx)(c._,{src:"",withPlaceholder:!0,height:"400px",mt:30})}),(0,i.jsx)(w.$,{size:"lg",mt:"lg",disabled:!F,onClick:()=>{(0,b.m)(F)},fullWidth:!0,loading:T,children:"Download Avatar"})]})]})]})}},73641:(e,t,a)=>{"use strict";a.d(t,{A:()=>d,m:()=>
1o});var i=a(6029),r=a(99690),n=a(26500),s=a(37948),l=a(50016);let o=async e=>{if(e)try{if(e.startsWith("data:image")){let t=((e,t)=>{let a=atob(e),i=null==a?void 0:a.length,r=new Uint8Array(i);for(let e=0;e<i;e++)r[e]=a.charCodeAt(e);return new Blob([r],{type:t})})(e.split(",")[1],e.split(";")[0].split(":")[1]),a=window.URL.createObjectURL(t),i=document.createElement("a");i.href=a,i.download="image.png",document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(a),document.body.removeChild(i)}else{let t=await fetch(e),a=await t.blob(),i=window.URL.createObjectURL(a),r=document.createElement("a");r.href=i,r.download="image.png",document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(i),document.body.removeChild(r)}}catch(e){console.error("Error downloading image:",e)}},d=e=>{let{image:t,withText:a=!0}=e;return(0,i.jsxs)(r.Y,{onClick:e=>{e.stopPropagation(),o(t)},children:[(0,i.jsx)(n.M,{variant:"filled",color:"blue",children:(0,i.jsx)(l.s3U,{})}),a&&(0,i.jsx)(s.E,{children:"Download"})]})}},74343:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/instant-avatars_hidden",function(){return a(68469)}])},75185:(e,t,a)=>{"use strict";a.d(t,{V:()=>g});var i=a(35670),r=a(18090),n=a(1751),s=a(58943),l=a(89948),o=a(74312),d=a.n(o),c=a(55729),u=a(34417);let g=e=>{let{defaultProcessedImageUrl:t=null}=e,[a,o]=(0,c.useState)(null),[g,h]=(0,c.useState)(t),m=(0,c.useRef)([]),[p,f]=(0,c.useState)(!1),{refetch:w,isFetching:x,isRefetching:v}=(0,n.Z5_)(a||0,{query:{enabled:null!==a&&0!==a}}),{data:j,refetch:_}=(0,u.P)(),[y,b]=(0,i.M)({key:"freeGenerations".concat(d()().format("YYYY-MM-DD")),defaultValue:l.iF}),I=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,a=new Date().getTime(),i=!0;for(f(!0);new Date().getTime()-a<t&&i;){try{await w().then(e=>{var t,n,l,o,d,c,u,p,w,x;let{data:v}=e;return(console.log("Job status:",v),console.log("Time elapsed:",new Date().getTime()-a),(null==v?void 0:v.status)===s.Mf.FL)?((0,r.Ds)({title:"Image processing failed",message:"Please try again later",color:"red"}),h(null),f(!1),i=!1,_(),g):(null==v?void 0:v.prediction_images)&&(null==v||null==(t=v.prediction_images)?void 0:t.length)>0&&((null==(l=v.prediction_images)||null==(n=l[0])?void 0:n.image)||(null==(d=v.prediction_images)||null==(o=d[0])?void 0:o.base_encoded))?(m.current=null==(c=v.prediction_images)?void 0:c.map(e=>(null==e?void 0:e.image)||(null==e?void 0:e.base_encoded)),h((null==(p=v.prediction_images)||null==(u=p[0])?void 0:u.image)||(null==v||null==(x=v.prediction_images)||null==(w=x[0])?void 0:w.base_encoded)),b(e=>e-1),i=!1,f(!1),_(),g):void 0})}catch(e){console.error("Error fetching job status:",e),f(!1)}if(!i)break;await new Promise(t=>setTimeout(t,e))}return i&&(h(null),f(!1),m.current=[],(0,r.Ds)({title:"Image processing timed out",message:"Please try again later",color:"red"})),g};return{inferenceJobId:a,setInferenceJobId:o,processedImageUrl:g,inferenceJobLoading:x,pollJobStatus:I,setProcessedImageUrl:h,isLoading:p,processedImageUrlRef:m,inferenceJobRefetching:v}}},90967:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var i=a(6029),r=a(13445),n=a(84335),s=a(37948),l=a(35670),o=a(34417),d=a(89948),c=a(78138),u=a(74312),g=a.n(u),h=a(82203),m=a.n(h),p=a(67051);let f=e=>{let{eventName:t}=e,{data:a}=(0,o.P)(),[u,h]=(0,l.M)({key:"freeGenerations".concat(g()().format("YYYY-MM-DD")),defaultValue:d.iF});return(0,i.jsx)(i.Fragment,{children:!(null==a?void 0:a.email)&&u<=0&&(0,i.jsxs)(r.B,{children:[(0,i.jsx)(n.$,{component:m(),href:"".concat(c.J.common.register,"?nextUrl=").concat(c.J.aieasypic.textToImage),size:"xl",onClick:()=>{p.Ay.event({category:"Signup Click",action:"Clicked Signup Button After Free ".concat(t," Complete")})},children:"Sign Up"}),(0,i.jsx)(s.E,{weight:300,size:"xs",children:"* You have used up your free generations. Please sign up to continue."})]})})}}},e=>{e.O(0,[182,9720,7703,8945,636,6593,8792],()=>e(e.s=74343)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.