PageSourceSearch

https://app.aieasypic.com/_next/static/chunks/pages/tools/background-removal-02f7ff2e0c9f0dfa.js

js aieasypic.com collected 2026-10-04 13:25:02 UTC 5,693 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1899],{65003:(e,i,a)=>{"use strict";a.r(i),a.d(i,{default:()=>j});var n=a(6029),o=a(28945),l=a(50433),t=a(69943),r=a(63887),s=a(13445),d=a(73075),c=a(84335),u=a(37948),m=a(87462),g=a(73641),p=a(27835),h=a(75185),w=a(1751),v=a(92907),f=a(37514),x=a(78138),b=a(55729),_=a(40340);let j=()=>{let[e,i]=(0,b.useState)({source:{preview:"",uploaded:!1,uploadedId:"",type:""},target:{preview:null,uploaded:!1,uploadedId:"",type:""}}),{mutate:a,isLoading:j}=(0,w.XKe)(),{setInferenceJobId:y,pollJobStatus:k,processedImageUrl:R,inferenceJobLoading:U,inferenceJobId:E,setProcessedImageUrl:I,isLoading:L}=(0,h.V)({defaultProcessedImageUrl:"https://cdnr2.aieasypic.com/aieasypic/asian_woman_realistic_bg_remove.png"}),D=(0,b.useMemo)(()=>e.source.preview?e.source.preview instanceof Blob?URL.createObjectURL(e.source.preview):e.source.preview:"https://cdnr2.aieasypic.com/aieasypic/asian_woman_realistic.png",[e.source.preview]);return(0,n.jsxs)(l.a,{sx:e=>({minHeight:"80vh",padding:"30px 40px",[e.fn.smallerThan("md")]:{padding:"20px 10px"}}),children:[(0,n.jsx)(p.A,{title:"Background Removal",description:"Remove background from image for free using AI",url:"".concat(v._g.frontendUrl).concat(x.J.aieasypic.toolsBackgroundRemoval)}),(0,n.jsxs)(t.x,{children:[(0,n.jsx)(r.f,{span:12,order:2,orderSm:1,sm:4,offsetSm:1,children:(0,n.jsxs)(s.B,{children:[(0,n.jsx)(_.EW,{itemOne:(0,n.jsx)(_.D4,{src:D,alt:"Image one",width:500,height:500}),itemTwo:R?(0,n.jsx)(_.D4,{src:R,alt:"Image two",width:500,height:500}):(0,n.jsx)(d.E,{height:500,width:500})}),(0,n.jsx)(c.$,{size:"lg",loading:j||!R,onClick:()=>(0,g.m)(R),children:"Download"}),(0,n.jsx)(u.E,{size:"sm",color:"dimmed",inline:!0,children:"Processed images will be available also in your dashboard"})]})}),(0,n.jsx)(r.f,{span:12,sm:6,children:(0,n.jsxs)(l.a,{children:[(0,n.jsx)(m.h,{align:"center",children:"Remove Backgroun
1d Using AI"}),(0,n.jsx)(l.a,{sx:e=>({[e.fn.smallerThan("md")]:{padding:"20px 10px"},padding:"30px 10px"}),children:(0,n.jsxs)(s.B,{spacing:"md",children:[(0,n.jsx)(o.A,{images:e,type:"source",description:"Upload an image below or choose from the gallery",setImages:i,setProcessedImageUrl:I}),(0,n.jsx)(c.$,{size:"lg",loading:L||j,onClick:()=>{e.source.uploadedId&&a({data:{input_image:e.source.uploadedId}},{onError:e=>{(0,f.A)(e)},onSuccess:async e=>{y(e.id),await k()}})},children:"Remove Background"})]})})]})})]})]})}},73641:(e,i,a)=>{"use strict";a.d(i,{A:()=>d,m:()=>s});var n=a(6029),o=a(99690),l=a(26500),t=a(37948),r=a(50016);let s=async e=>{if(e)try{if(e.startsWith("data:image")){let i=((e,i)=>{let a=atob(e),n=null==a?void 0:a.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=a.charCodeAt(e);return new Blob([o],{type:i})})(e.split(",")[1],e.split(";")[0].split(":")[1]),a=window.URL.createObjectURL(i),n=document.createElement("a");n.href=a,n.download="image.png",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(a),document.body.removeChild(n)}else{let i=await fetch(e),a=await i.blob(),n=window.URL.createObjectURL(a),o=document.createElement("a");o.href=n,o.download="image.png",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o)}}catch(e){console.error("Error downloading image:",e)}},d=e=>{let{image:i,withText:a=!0}=e;return(0,n.jsxs)(o.Y,{onClick:e=>{e.stopPropagation(),s(i)},children:[(0,n.jsx)(l.M,{variant:"filled",color:"blue",children:(0,n.jsx)(r.s3U,{})}),a&&(0,n.jsx)(t.E,{children:"Download"})]})}},75185:(e,i,a)=>{"use strict";a.d(i,{V:()=>m});var n=a(35670),o=a(18090),l=a(1751),t=a(58943),r=a(89948),s=a(74312),d=a.n(s),c=a(55729),u=a(34417);let m=e=>{let{defaultProcessedImageUrl:i=null}=e,[a,s]=(0,c.useState)(null),[m,g]=(0,c.useState)(i),p=(0,c.useRef)([]),[h,w]=(0,c.useState)(!1),{refetch:v,isFetching:f,isRefetching:x}=(0,l.Z5_)(a||0,{query:{enabled:null!==a&&0!==a}}),{data:b,refetch:_}=(0,u.P)(),[j,y]=(0,n.M)({key:"freeGenerations".concat(d()().format("YYYY-MM-DD")),defaultValue:r.iF}),k=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,a=new Date().getTime(),n=!0;for(w(!0);new Date().getTime()-a<i&&n;){try{await v().then(e=>{var i,l,r,s,d,c,u,h,v,f;let{data:x}=e;return(console.log("Job status:",x),console.log("Time elapsed:",new Date().getTime()-a),(null==x?void 0:x.status)===t.Mf.FL)?((0,o.Ds)({title:"Image processing failed",message:"Please try again later",color:"red"}),g(null),w(!1),n=!1,_(),m):(null==x?void 0:x.prediction_images)&&(null==x||null==(i=x.prediction_images)?void 0:i.length)>0&&((null==(r=x.prediction_images)||null==(l=r[0])?void 0:l.image)||(null==(d=x.prediction_images)||null==(s=d[0])?void 0:s.base_encoded))?(p.current=null==(c=x.prediction_images)?void 0:c.map(e=>(null==e?void 0:e.image)||(null==e?void 0:e.base_encoded)),g((null==(h=x.prediction_images)||null==(u=h[0])?void 0:u.image)||(null==x||null==(f=x.prediction_images)||null==(v=f[0])?void 0:v.base_encoded)),y(e=>e-1),n=!1,w(!1),_(),m):void 0})}catch(e){console.error("Error fetching job status:",e),w(!1)}if(!n)break;await new Promise(i=>setTimeout(i,e))}return n&&(g(null),w(!1),p.current=[],(0,o.Ds)({title:"Image processing timed out",message:"Please try again later",color:"red"})),m};return{inferenceJobId:a,setInferenceJobId:s,processedImageUrl:m,inferenceJobLoading:f,pollJobStatus:k,setProcessedImageUrl:g,isLoading:h,processedImageUrlRef:p,inferenceJobRefetching:x}}},96527:(e,i,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/background-removal",function(){return a(65003)}])}},e=>{e.O(0,[182,9720,8945,636,6593,8792],()=>e(e.s=96527)),_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.