diff --git a/README.md b/README.md index 2d2b0200fb..3b209c99da 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # InvokeAI: A Stable Diffusion Toolkit -_Formally known as lstein/stable-diffusion_ +_Formerly known as lstein/stable-diffusion_ ![project logo](docs/assets/logo.png) diff --git a/docs/assets/inpainting/000019.curly.hair.deselected.png b/docs/assets/inpainting/000019.curly.hair.deselected.png new file mode 100644 index 0000000000..54f2285550 Binary files /dev/null and b/docs/assets/inpainting/000019.curly.hair.deselected.png differ diff --git a/docs/assets/inpainting/000019.curly.hair.masked.png b/docs/assets/inpainting/000019.curly.hair.masked.png new file mode 100644 index 0000000000..a221c522f3 Binary files /dev/null and b/docs/assets/inpainting/000019.curly.hair.masked.png differ diff --git a/docs/assets/inpainting/000019.curly.hair.selected.png b/docs/assets/inpainting/000019.curly.hair.selected.png new file mode 100644 index 0000000000..e25bb4340c Binary files /dev/null and b/docs/assets/inpainting/000019.curly.hair.selected.png differ diff --git a/docs/assets/inpainting/000024.801380492.png b/docs/assets/inpainting/000024.801380492.png new file mode 100644 index 0000000000..9c72eb06b8 Binary files /dev/null and b/docs/assets/inpainting/000024.801380492.png differ diff --git a/docs/features/CLI.md b/docs/features/CLI.md index 1219a2bed7..78f035b871 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -503,6 +503,16 @@ invoke> !search surreal This clears the search history from memory and disk. Be advised that this operation is irreversible and does not issue any warnings! +Other ! Commands + +### !mask + +This command takes an image, a text prompt, and uses the `clipseg` +algorithm to automatically generate a mask of the area that matches +the text prompt. It is useful for debugging the text masking process +prior to inpainting with the `--text_mask` argument. See +[INPAINTING.md] for details. + ## Command-line editing and completion The command-line offers convenient history tracking, editing, and diff --git a/docs/features/INPAINTING.md b/docs/features/INPAINTING.md index ac558917e7..226144de95 100644 --- a/docs/features/INPAINTING.md +++ b/docs/features/INPAINTING.md @@ -74,6 +74,60 @@ up at all! invoke> a baseball -I /path/to/breakfast.png -tm orange 0.6 ~~~ +The `!mask` command may be useful for debugging problems with the +text2mask feature. The syntax is `!mask /path/to/image.png -tm +` + +It will generate three files: + +- The image with the selected area highlighted. +- The image with the un-selected area highlighted. +- The image with the selected area converted into a black and white + image according to the threshold level. + +Note that none of these images are intended to be used as the mask +passed to invoke via `-M` and may give unexpected results if you try +to use them this way. Instead, use `!mask` for testing that you are +selecting the right mask area, and then do inpainting using the +best selection term and threshold. + +Here is an example of how `!mask` works: + +``` +invoke> !mask ./test-pictures/curly.png -tm hair 0.5 +>> generating masks from ./test-pictures/curly.png +>> Initializing clipseg model for text to mask inference +Outputs: +[941.1] outputs/img-samples/000019.curly.hair.deselected.png: !mask ./test-pictures/curly.png -tm hair 0.5 +[941.2] outputs/img-samples/000019.curly.hair.selected.png: !mask ./test-pictures/curly.png -tm hair 0.5 +[941.3] outputs/img-samples/000019.curly.hair.masked.png: !mask ./test-pictures/curly.png -tm hair 0.5 +``` + +**Original image "curly.png"** + + +**000019.curly.hair.selected.png** + + +**000019.curly.hair.deselected.png** + + +**000019.curly.hair.masked.png** + + +It looks like we selected the hair pretty well at the 0.5 threshold +(which is the default, so we didn't actually have to specify it), so +let's have some fun: + +``` +invoke> medusa with cobras -I ./test-pictures/curly.png -tm hair 0.5 -C20 +>> loaded input image of size 512x512 from ./test-pictures/curly.png +... +Outputs: +[946] outputs/img-samples/000024.801380492.png: "medusa with cobras" -s 50 -S 801380492 -W 512 -H 512 -C 20.0 -I ./test-pictures/curly.png -A k_lms -f 0.75 +``` + + ### Inpainting is not changing the masked region enough! diff --git a/docs/index.md b/docs/index.md index c9a19a18ce..25ab1bd48e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ title: Home -->
-# ^^**InvokeAI: A Stable Diffusion Toolkit**^^ :tools:
Formally known as lstein/stable-diffusion +# ^^**InvokeAI: A Stable Diffusion Toolkit**^^ :tools:
Formerly known as lstein/stable-diffusion ![project logo](assets/logo.png) diff --git a/environment-mac.yml b/environment-mac.yml index 9b43fd0978..14509ccff7 100644 --- a/environment-mac.yml +++ b/environment-mac.yml @@ -57,7 +57,7 @@ dependencies: - -e git+https://github.com/openai/CLIP.git@main#egg=clip - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - -e git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan - - -e git+https://github.com/invoke-ai/clipseg.git#egg=clipseg + - -e git+https://github.com/invoke-ai/clipseg.git@models-rename#egg=clipseg - -e . variables: PYTORCH_ENABLE_MPS_FALLBACK: 1 diff --git a/environment.yml b/environment.yml index 72468067e4..820f940608 100644 --- a/environment.yml +++ b/environment.yml @@ -37,5 +37,5 @@ dependencies: - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - -e git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan - - -e git+https://github.com/invoke-ai/clipseg.git#egg=clipseg + - -e git+https://github.com/invoke-ai/clipseg.git@models-rename#egg=clipseg - -e . diff --git a/frontend/dist/assets/index.89883620.js b/frontend/dist/assets/index.89883620.js deleted file mode 100644 index 8b13789179..0000000000 --- a/frontend/dist/assets/index.89883620.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/frontend/dist/assets/index.dcc1d08e.js b/frontend/dist/assets/index.b06af007.js similarity index 88% rename from frontend/dist/assets/index.dcc1d08e.js rename to frontend/dist/assets/index.b06af007.js index 2757ebd474..d537a6fdee 100644 --- a/frontend/dist/assets/index.dcc1d08e.js +++ b/frontend/dist/assets/index.b06af007.js @@ -682,7 +682,7 @@ __p += '`),kn&&(Ie+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ie+`return __p -}`;var mn=y2(function(){return Zn(j,vt+"return "+Ie).apply(n,q)});if(mn.source=Ie,eu(mn))throw mn;return mn}function LC(l){return Xn(l).toLowerCase()}function r1(l){return Xn(l).toUpperCase()}function OC(l,d,g){if(l=Xn(l),l&&(g||d===n))return _s(l);if(!l||!(d=aa(d)))return l;var E=Qo(l),D=Qo(d),j=gd(E,D),q=Ob(E,D)+1;return Os(E,j,q).join("")}function i1(l,d,g){if(l=Xn(l),l&&(g||d===n))return l.slice(0,Ib(l)+1);if(!l||!(d=aa(d)))return l;var E=Qo(l),D=Ob(E,Qo(d))+1;return Os(E,0,D).join("")}function b2(l,d,g){if(l=Xn(l),l&&(g||d===n))return l.replace(ji,"");if(!l||!(d=aa(d)))return l;var E=Qo(l),D=gd(E,Qo(d));return Os(E,D).join("")}function MC(l,d){var g=le,E=ge;if(wr(d)){var D="separator"in d?d.separator:D;g="length"in d?an(d.length):g,E="omission"in d?aa(d.omission):E}l=Xn(l);var j=l.length;if(Bc(l)){var q=Qo(l);j=q.length}if(g>=j)return l;var Q=g-Vu(E);if(Q<1)return E;var se=q?Os(q,0,Q).join(""):l.slice(0,Q);if(D===n)return se+E;if(q&&(Q+=se.length-Q),ih(D)){if(l.slice(Q).search(D)){var Me,ke=se;for(D.global||(D=ll(D.source,Xn(Vn.exec(D))+"g")),D.lastIndex=0;Me=D.exec(ke);)var Ie=Me.index;se=se.slice(0,Ie===n?Q:Ie)}}else if(l.indexOf(aa(D),Q)!=Q){var Qe=se.lastIndexOf(D);Qe>-1&&(se=se.slice(0,Qe))}return se+E}function DC(l){return l=Xn(l),l&&Ci.test(l)?l.replace(jn,y3):l}var PC=uf(function(l,d,g){return l+(g?" ":"")+d.toUpperCase()}),a1=py("toUpperCase");function o1(l,d,g){return l=Xn(l),d=g?n:d,d===n?b3(l)?C3(l):$v(l):l.match(d)||[]}var y2=bn(function(l,d){try{return yt(l,n,d)}catch(g){return eu(g)?g:new rn(g)}}),IC=yl(function(l,d){return Rt(d,function(g){g=Da(g),Rs(l,g,eh(l[g],l))}),l});function FC(l){var d=l==null?0:l.length,g=Pt();return l=d?Mn(l,function(E){if(typeof E[1]!="function")throw new Xa(c);return[g(E[0]),E[1]]}):[],bn(function(E){for(var D=-1;++Dbe)return[];var g=we,E=si(l,we);d=Pt(d),l-=we;for(var D=hm(E,d);++g0||d<0)?new An(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),d!==n&&(d=an(d),g=d<0?g.dropRight(-d):g.take(d-l)),g)},An.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},An.prototype.toArray=function(){return this.take(we)},gr(An.prototype,function(l,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),E=/^(?:head|last)$/.test(d),D=B[E?"take"+(d=="last"?"Right":""):d],j=E||/^find/.test(d);!D||(B.prototype[d]=function(){var q=this.__wrapped__,Q=E?[1]:arguments,se=q instanceof An,Me=Q[0],ke=se||ln(q),Ie=function(yn){var kn=D.apply(B,La([yn],Q));return E&&Qe?kn[0]:kn};ke&&g&&typeof Me=="function"&&Me.length!=1&&(se=ke=!1);var Qe=this.__chain__,vt=!!this.__actions__.length,It=j&&!Qe,mn=se&&!vt;if(!j&&ke){q=mn?q:new An(this);var $t=l.apply(q,Q);return $t.__actions__.push({func:Qm,args:[Ie],thisArg:n}),new bo($t,Qe)}return It&&mn?l.apply(this,Q):($t=this.thru(Ie),It?E?$t.value()[0]:$t.value():$t)})}),Rt(["pop","push","shift","sort","splice","unshift"],function(l){var d=ul[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",E=/^(?:pop|shift)$/.test(l);B.prototype[l]=function(){var D=arguments;if(E&&!this.__chain__){var j=this.value();return d.apply(ln(j)?j:[],D)}return this[g](function(q){return d.apply(ln(q)?q:[],D)})}}),gr(An.prototype,function(l,d){var g=B[d];if(g){var E=g.name+"";er.call(Zc,E)||(Zc[E]=[]),Zc[E].push({name:d,func:g})}}),Zc[cf(n,z).name]=[{name:"wrapper",func:n}],An.prototype.clone=zt,An.prototype.reverse=Qc,An.prototype.value=Wr,B.prototype.at=Cx,B.prototype.chain=Nx,B.prototype.commit=wx,B.prototype.next=By,B.prototype.plant=tp,B.prototype.reverse=_x,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Uy,B.prototype.first=B.prototype.head,Cd&&(B.prototype[Cd]=z0),B},$c=N3();L?((L.exports=$c)._=$c,S._=$c):Kt._=$c}).call(Ac)})(Wa,Wa.exports);const tb=Wa.exports,ive={currentImageUuid:"",images:[],areMoreImagesAvailable:!0},iU=xE({name:"gallery",initialState:ive,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const n=t.payload,i=e.images.filter(o=>o.uuid!==n);if(n===e.currentImageUuid){const o=e.images.findIndex(c=>c.uuid===n),u=Wa.exports.clamp(o,0,i.length-1);e.currentImage=i.length?i[u]:void 0,e.currentImageUuid=i.length?i[u].uuid:""}e.images=i},addImage:(e,t)=>{const n=t.payload,{uuid:i,mtime:o}=n;e.images.unshift(n),e.currentImageUuid=i,e.intermediateImage=void 0,e.currentImage=n,e.latest_mtime=o},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{images:t,currentImage:n}=e;if(n){const i=t.findIndex(o=>o.uuid===n.uuid);if(tb.inRange(i,0,t.length)){const o=t[i+1];e.currentImage=o,e.currentImageUuid=o.uuid}}},selectPrevImage:e=>{const{images:t,currentImage:n}=e;if(n){const i=t.findIndex(o=>o.uuid===n.uuid);if(tb.inRange(i,1,t.length+1)){const o=t[i-1];e.currentImage=o,e.currentImageUuid=o.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:i}=t.payload;if(n.length>0){if(e.images=e.images.concat(n).sort((o,u)=>u.mtime-o.mtime),!e.currentImage){const o=n[0];e.currentImage=o,e.currentImageUuid=o.uuid}e.latest_mtime=n[0].mtime,e.earliest_mtime=n[n.length-1].mtime}i!==void 0&&(e.areMoreImagesAvailable=i)}}}),{addImage:E6,clearIntermediateImage:NM,removeImage:ave,setCurrentImage:ove,addGalleryImages:sve,setIntermediateImage:lve,selectNextImage:aU,selectPrevImage:oU}=iU.actions,uve=iU.reducer,cve={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",hasError:!1,wasErrorSeen:!0},fve=cve,sU=xE({name:"system",initialState:fve,reducers:{setShouldDisplayInProgress:(e,t)=>{e.shouldDisplayInProgress=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Server error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:i,level:o}=t.payload,c={timestamp:n,message:i,level:o||"info"};e.log.push(c)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"}}}),{setShouldDisplayInProgress:dve,setIsProcessing:M4,addLogEntry:Ao,setShouldShowLogViewer:wM,setIsConnected:_M,setSocketId:Tye,setShouldConfirmOnDelete:lU,setOpenAccordions:pve,setSystemStatus:mve,setCurrentStatus:EM,setSystemConfig:hve,setShouldDisplayGuides:vve,processingCanceled:gve,errorOccurred:bve,errorSeen:uU}=sU.actions,yve=sU.reducer,Iu=Object.create(null);Iu.open="0";Iu.close="1";Iu.ping="2";Iu.pong="3";Iu.message="4";Iu.upgrade="5";Iu.noop="6";const D4=Object.create(null);Object.keys(Iu).forEach(e=>{D4[Iu[e]]=e});const Sve={type:"error",data:"parser error"},xve=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Cve=typeof ArrayBuffer=="function",Nve=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,cU=({type:e,data:t},n,i)=>xve&&t instanceof Blob?n?i(t):TM(t,i):Cve&&(t instanceof ArrayBuffer||Nve(t))?n?i(t):TM(new Blob([t]),i):i(Iu[e]+(t||"")),TM=(e,t)=>{const n=new FileReader;return n.onload=function(){const i=n.result.split(",")[1];t("b"+i)},n.readAsDataURL(e)},RM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,i,o=0,u,c,p,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const v=new ArrayBuffer(t),b=new Uint8Array(v);for(i=0;i>4,b[o++]=(c&15)<<4|p>>2,b[o++]=(p&3)<<6|h&63;return v},_ve=typeof ArrayBuffer=="function",fU=(e,t)=>{if(typeof e!="string")return{type:"message",data:dU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Eve(e.substring(1),t)}:D4[n]?e.length>1?{type:D4[n],data:e.substring(1)}:{type:D4[n]}:Sve},Eve=(e,t)=>{if(_ve){const n=wve(e);return dU(n,t)}else return{base64:!0,data:e}},dU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},pU=String.fromCharCode(30),Tve=(e,t)=>{const n=e.length,i=new Array(n);let o=0;e.forEach((u,c)=>{cU(u,!1,p=>{i[c]=p,++o===n&&t(i.join(pU))})})},Rve=(e,t)=>{const n=e.split(pU),i=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function hU(e,...t){return t.reduce((n,i)=>(e.hasOwnProperty(i)&&(n[i]=e[i]),n),{})}const kve=setTimeout,Lve=clearTimeout;function c3(e,t){t.useNativeTimers?(e.setTimeoutFn=kve.bind(ed),e.clearTimeoutFn=Lve.bind(ed)):(e.setTimeoutFn=setTimeout.bind(ed),e.clearTimeoutFn=clearTimeout.bind(ed))}const Ove=1.33;function Mve(e){return typeof e=="string"?Dve(e):Math.ceil((e.byteLength||e.size)*Ove)}function Dve(e){let t=0,n=0;for(let i=0,o=e.length;i=57344?n+=3:(i++,n+=4);return n}class Pve extends Error{constructor(t,n,i){super(t),this.description=n,this.context=i,this.type="TransportError"}}class vU extends Si{constructor(t){super(),this.writable=!1,c3(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,i){return super.emitReserved("error",new Pve(t,n,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=fU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const gU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),C8=64,Ive={};let AM=0,n4=0,kM;function LM(e){let t="";do t=gU[e%C8]+t,e=Math.floor(e/C8);while(e>0);return t}function bU(){const e=LM(+new Date);return e!==kM?(AM=0,kM=e):e+"."+LM(AM++)}for(;n4{this.readyState="paused",t()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||n()})),this.writable||(i++,this.once("drain",function(){--i||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Rve(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Tve(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=bU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=yU(t),u=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(u?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Ou(this.uri(),t)}doWrite(t,n){const i=this.request({method:"POST",data:t});i.on("success",n),i.on("error",(o,u)=>{this.onError("xhr post error",o,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,i)=>{this.onError("xhr poll error",n,i)}),this.pollXhr=t}}class Ou extends Si{constructor(t,n){super(),c3(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=hU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new xU(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Ou.requestsCount++,Ou.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Bve,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ou.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Ou.requestsCount=0;Ou.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",OM);else if(typeof addEventListener=="function"){const e="onpagehide"in ed?"pagehide":"unload";addEventListener(e,OM,!1)}}function OM(){for(let e in Ou.requests)Ou.requests.hasOwnProperty(e)&&Ou.requests[e].abort()}const jve=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),r4=ed.WebSocket||ed.MozWebSocket,MM=!0,Vve="arraybuffer",DM=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Hve extends vU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,i=DM?{}:hU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=MM&&!DM?n?new r4(t,n):new r4(t):new r4(t,n,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||Vve,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const c={};try{MM&&this.ws.send(u)}catch{}o&&jve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=bU()),this.supportsBinary||(t.b64=1);const o=yU(t),u=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(u?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!r4}}const Wve={websocket:Hve,polling:$ve},Gve=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yve=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function N8(e){const t=e,n=e.indexOf("["),i=e.indexOf("]");n!=-1&&i!=-1&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));let o=Gve.exec(e||""),u={},c=14;for(;c--;)u[Yve[c]]=o[c]||"";return n!=-1&&i!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=qve(u,u.path),u.queryKey=Zve(u,u.query),u}function qve(e,t){const n=/\/{2,9}/g,i=t.replace(n,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&i.splice(0,1),t.substr(t.length-1,1)=="/"&&i.splice(i.length-1,1),i}function Zve(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,u){o&&(n[o]=u)}),n}class Zf extends Si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=N8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=N8(n.host).host),c3(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=Fve(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=mU,n.transport=t,this.id&&(n.sid=this.id);const i=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Wve[t](i)}open(){let t;if(this.opts.rememberUpgrade&&Zf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),i=!1;Zf.priorWebsocketSuccess=!1;const o=()=>{i||(n.send([{type:"ping",data:"probe"}]),n.once("packet",x=>{if(!i)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Zf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(b(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const N=new Error("probe error");N.transport=n.name,this.emitReserved("upgradeError",N)}}))};function u(){i||(i=!0,b(),n.close(),n=null)}const c=x=>{const N=new Error("probe error: "+x);N.transport=n.name,u(),this.emitReserved("upgradeError",N)};function p(){c("transport closed")}function h(){c("socket closed")}function v(x){n&&x.name!==n.name&&u()}const b=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",p),this.off("close",h),this.off("upgrading",v)};n.once("open",o),n.once("error",c),n.once("close",p),this.once("close",h),this.once("upgrading",v),n.open()}onOpen(){if(this.readyState="open",Zf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let i=0;i0&&n>this.maxPayload)return this.writeBuffer.slice(0,i);n+=2}return this.writeBuffer}write(t,n,i){return this.sendPacket("message",t,n,i),this}send(t,n,i){return this.sendPacket("message",t,n,i),this}sendPacket(t,n,i,o){if(typeof n=="function"&&(o=n,n=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const u={type:t,data:n,options:i};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},i=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}onError(t){Zf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let i=0;const o=t.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,CU=Object.prototype.toString,Jve=typeof Blob=="function"||typeof Blob<"u"&&CU.call(Blob)==="[object BlobConstructor]",e0e=typeof File=="function"||typeof File<"u"&&CU.call(File)==="[object FileConstructor]";function AE(e){return Xve&&(e instanceof ArrayBuffer||Qve(e))||Jve&&e instanceof Blob||e0e&&e instanceof File}function P4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,i=e.length;n=0&&e.num0;case qn.ACK:case qn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class a0e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=n0e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const o0e=Object.freeze(Object.defineProperty({__proto__:null,protocol:r0e,get PacketType(){return qn},Encoder:i0e,Decoder:kE},Symbol.toStringTag,{value:"Module"}));function Fl(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const s0e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class NU extends Si{constructor(t,n,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Fl(t,"open",this.onopen.bind(this)),Fl(t,"packet",this.onpacket.bind(this)),Fl(t,"error",this.onerror.bind(this)),Fl(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(s0e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const i={type:qn.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,p=n.pop();this._registerAckCallback(c,p),i.id=c}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){const i=this.flags.timeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u{this.io.clearTimeoutFn(o),n.apply(this,[null,...u])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:qn.CONNECT,data:t})}):this.packet({type:qn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case qn.CONNECT:if(t.data&&t.data.sid){const o=t.data.sid;this.onconnect(o)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case qn.EVENT:case qn.BINARY_EVENT:this.onevent(t);break;case qn.ACK:case qn.BINARY_ACK:this.onack(t);break;case qn.DISCONNECT:this.ondisconnect();break;case qn.CONNECT_ERROR:this.destroy();const i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const i of n)i.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let i=!1;return function(...o){i||(i=!0,n.packet({type:qn.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:qn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let i=0;i0&&e.jitter<=1?e.jitter:0,this.attempts=0}zv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};zv.prototype.reset=function(){this.attempts=0};zv.prototype.setMin=function(e){this.ms=e};zv.prototype.setMax=function(e){this.max=e};zv.prototype.setJitter=function(e){this.jitter=e};class E8 extends Si{constructor(t,n){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,c3(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((i=n.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new zv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||o0e;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Zf(this.uri,this.opts);const n=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Fl(n,"open",function(){i.onopen(),t&&t()}),u=Fl(n,"error",c=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",c),t?t(c):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const c=this._timeout;c===0&&o();const p=this.setTimeoutFn(()=>{o(),n.close(),n.emit("error",new Error("timeout"))},c);this.opts.autoUnref&&p.unref(),this.subs.push(function(){clearTimeout(p)})}return this.subs.push(o),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Fl(t,"ping",this.onping.bind(this)),Fl(t,"data",this.ondata.bind(this)),Fl(t,"error",this.onerror.bind(this)),Fl(t,"close",this.onclose.bind(this)),Fl(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch{this.onclose("parse error")}}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,n){let i=this.nsps[t];return i||(i=new NU(this,t,n),this.nsps[t]=i),i}_destroy(t){const n=Object.keys(this.nsps);for(const i of n)if(this.nsps[i].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let i=0;it()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ag={};function I4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Kve(e,t.path||"/socket.io"),i=n.source,o=n.id,u=n.path,c=ag[o]&&u in ag[o].nsps,p=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return p?h=new E8(i,t):(ag[o]||(ag[o]=new E8(i,t)),h=ag[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(I4,{Manager:E8,Socket:NU,io:I4,connect:I4});let i4;const l0e=new Uint8Array(16);function u0e(){if(!i4&&(i4=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i4))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i4(l0e)}const ya=[];for(let e=0;e<256;++e)ya.push((e+256).toString(16).slice(1));function c0e(e,t=0){return(ya[e[t+0]]+ya[e[t+1]]+ya[e[t+2]]+ya[e[t+3]]+"-"+ya[e[t+4]]+ya[e[t+5]]+"-"+ya[e[t+6]]+ya[e[t+7]]+"-"+ya[e[t+8]]+ya[e[t+9]]+"-"+ya[e[t+10]]+ya[e[t+11]]+ya[e[t+12]]+ya[e[t+13]]+ya[e[t+14]]+ya[e[t+15]]).toLowerCase()}const f0e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PM={randomUUID:f0e};function a4(e,t,n){if(PM.randomUUID&&!t&&!e)return PM.randomUUID();e=e||{};const i=e.random||(e.rng||u0e)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=i[o];return t}return c0e(i)}var d0e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,p0e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,m0e=/[^-+\dA-Z]/g;function ko(e,t,n,i){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(IM[t]||t||IM.default);var o=t.slice(0,4);(o==="UTC:"||o==="GMT:")&&(t=t.slice(4),n=!0,o==="GMT:"&&(i=!0));var u=function(){return n?"getUTC":"get"},c=function(){return e[u()+"Date"]()},p=function(){return e[u()+"Day"]()},h=function(){return e[u()+"Month"]()},v=function(){return e[u()+"FullYear"]()},b=function(){return e[u()+"Hours"]()},x=function(){return e[u()+"Minutes"]()},N=function(){return e[u()+"Seconds"]()},_=function(){return e[u()+"Milliseconds"]()},T=function(){return n?0:e.getTimezoneOffset()},A=function(){return h0e(e)},M=function(){return v0e(e)},z={d:function(){return c()},dd:function(){return as(c())},ddd:function(){return To.dayNames[p()]},DDD:function(){return FM({y:v(),m:h(),d:c(),_:u(),dayName:To.dayNames[p()],short:!0})},dddd:function(){return To.dayNames[p()+7]},DDDD:function(){return FM({y:v(),m:h(),d:c(),_:u(),dayName:To.dayNames[p()+7]})},m:function(){return h()+1},mm:function(){return as(h()+1)},mmm:function(){return To.monthNames[h()]},mmmm:function(){return To.monthNames[h()+12]},yy:function(){return String(v()).slice(2)},yyyy:function(){return as(v(),4)},h:function(){return b()%12||12},hh:function(){return as(b()%12||12)},H:function(){return b()},HH:function(){return as(b())},M:function(){return x()},MM:function(){return as(x())},s:function(){return N()},ss:function(){return as(N())},l:function(){return as(_(),3)},L:function(){return as(Math.floor(_()/10))},t:function(){return b()<12?To.timeNames[0]:To.timeNames[1]},tt:function(){return b()<12?To.timeNames[2]:To.timeNames[3]},T:function(){return b()<12?To.timeNames[4]:To.timeNames[5]},TT:function(){return b()<12?To.timeNames[6]:To.timeNames[7]},Z:function(){return i?"GMT":n?"UTC":g0e(e)},o:function(){return(T()>0?"-":"+")+as(Math.floor(Math.abs(T())/60)*100+Math.abs(T())%60,4)},p:function(){return(T()>0?"-":"+")+as(Math.floor(Math.abs(T())/60),2)+":"+as(Math.floor(Math.abs(T())%60),2)},S:function(){return["th","st","nd","rd"][c()%10>3?0:(c()%100-c()%10!=10)*c()%10]},W:function(){return A()},WW:function(){return as(A())},N:function(){return M()}};return t.replace(d0e,function(P){return P in z?z[P]():P.slice(1,P.length-1)})}var IM={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},To={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},as=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},FM=function(t){var n=t.y,i=t.m,o=t.d,u=t._,c=t.dayName,p=t.short,h=p===void 0?!1:p,v=new Date,b=new Date;b.setDate(b[u+"Date"]()-1);var x=new Date;x.setDate(x[u+"Date"]()+1);var N=function(){return v[u+"Date"]()},_=function(){return v[u+"Month"]()},T=function(){return v[u+"FullYear"]()},A=function(){return b[u+"Date"]()},M=function(){return b[u+"Month"]()},z=function(){return b[u+"FullYear"]()},P=function(){return x[u+"Date"]()},I=function(){return x[u+"Month"]()},F=function(){return x[u+"FullYear"]()};return T()===n&&_()===i&&N()===o?h?"Tdy":"Today":z()===n&&M()===i&&A()===o?h?"Ysd":"Yesterday":F()===n&&I()===i&&P()===o?h?"Tmw":"Tomorrow":c},h0e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var i=new Date(n.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var o=n.getTimezoneOffset()-i.getTimezoneOffset();n.setHours(n.getHours()-o);var u=(n-i)/(864e5*7);return 1+Math.floor(u)},v0e=function(t){var n=t.getDay();return n===0&&(n=7),n},g0e=function(t){return(String(t).match(p0e)||[""]).pop().replace(m0e,"").replace(/GMT\+0000/g,"UTC")};const T8=fo("socketio/generateImage"),b0e=fo("socketio/runESRGAN"),y0e=fo("socketio/runFacetool"),S0e=fo("socketio/deleteImage"),wU=fo("socketio/requestImages"),x0e=fo("socketio/requestNewImages"),C0e=fo("socketio/cancelProcessing"),N0e=fo("socketio/uploadInitialImage");fo("socketio/uploadMaskImage");const w0e=fo("socketio/requestSystemConfig"),_0e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(_M(!0)),t(EM("Connected")),n().gallery.latest_mtime?t(x0e()):t(wU())}catch(i){console.error(i)}},onDisconnect:()=>{try{t(_M(!1)),t(EM("Disconnected")),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(i){console.error(i)}},onGenerationResult:i=>{try{const{url:o,mtime:u,metadata:c}=i,p=a4();t(E6({uuid:p,url:o,mtime:u,metadata:c})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Image generated: ${o}`}))}catch(o){console.error(o)}},onIntermediateResult:i=>{try{const o=a4(),{url:u,metadata:c,mtime:p}=i;t(lve({uuid:o,url:u,mtime:p,metadata:c})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Intermediate image generated: ${u}`}))}catch(o){console.error(o)}},onPostprocessingResult:i=>{try{const{url:o,metadata:u,mtime:c}=i;t(E6({uuid:a4(),url:o,mtime:c,metadata:u})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Postprocessed: ${o}`}))}catch(o){console.error(o)}},onProgressUpdate:i=>{try{t(M4(!0)),t(mve(i))}catch(o){console.error(o)}},onError:i=>{const{message:o,additionalData:u}=i;try{t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Server error: ${o}`,level:"error"})),t(bve()),t(NM())}catch(c){console.error(c)}},onGalleryImages:i=>{const{images:o,areMoreImagesAvailable:u}=i,c=o.map(p=>{const{url:h,metadata:v,mtime:b}=p;return{uuid:a4(),url:h,mtime:b,metadata:v}});t(sve({images:c,areMoreImagesAvailable:u})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Loaded ${o.length} images`}))},onProcessingCanceled:()=>{t(gve());const{intermediateImage:i}=n().gallery;i&&(t(E6(i)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Intermediate image saved: ${i.url}`})),t(NM())),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:i=>{const{url:o,uuid:u}=i;t(ave(u));const{initialImagePath:c,maskPath:p}=n().options;c===o&&t(Tv("")),p===o&&t(x8("")),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Image deleted: ${o}`}))},onInitialImageUploaded:i=>{const{url:o}=i;t(Tv(o)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Initial image uploaded: ${o}`}))},onMaskImageUploaded:i=>{const{url:o}=i;t(x8(o)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Mask image uploaded: ${o}`}))},onSystemConfig:i=>{t(hve(i))}}},E0e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],T0e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],R0e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],A0e=[{key:"2x",value:2},{key:"4x",value:4}],LE=0,OE=4294967295,k0e=["gfpgan","codeformer"],_U=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),L0e=(e,t)=>{const{prompt:n,iterations:i,steps:o,cfgScale:u,threshold:c,perlin:p,height:h,width:v,sampler:b,seed:x,seamless:N,hiresFix:_,shouldUseInitImage:T,img2imgStrength:A,initialImagePath:M,maskPath:z,shouldFitToWidthHeight:P,shouldGenerateVariations:I,variationAmount:F,seedWeights:$,shouldRunESRGAN:Y,upscalingLevel:Z,upscalingStrength:ue,shouldRunFacetool:ce,facetoolStrength:le,codeformerFidelity:ge,facetoolType:Ye,shouldRandomizeSeed:re}=e,{shouldDisplayInProgress:ie}=t,Ce={prompt:n,iterations:i,steps:o,cfg_scale:u,threshold:c,perlin:p,height:h,width:v,sampler_name:b,seed:x,seamless:N,hires_fix:_,progress_images:ie};Ce.seed=re?_U(LE,OE):x,T&&(Ce.init_img=M,Ce.strength=A,Ce.fit=P,z&&(Ce.init_mask=z)),I?(Ce.variation_amount=F,$&&(Ce.with_variations=Whe($))):Ce.variation_amount=0;let xe=!1,K=!1;return Y&&(xe={level:Z,strength:ue}),ce&&(K={type:Ye,strength:le},Ye==="codeformer"&&(K.codeformer_fidelity=ge)),{generationParameters:Ce,esrganParameters:xe,facetoolParameters:K}};var T6=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function R6(e,t,n,i){e.addEventListener?e.addEventListener(t,n,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function EU(e,t){for(var n=t.slice(0,t.length-1),i=0;i=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function O0e(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,o=!0,u=0;u=0&&Pr.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Pr.splice(0,Pr.length),(t===93||t===224)&&(t=91),t in xa){xa[t]=!1;for(var i in ud)ud[i]===t&&(us[i]=!1)}}function z0e(e){if(typeof e>"u")Object.keys(vi).forEach(function(c){return delete vi[c]});else if(Array.isArray(e))e.forEach(function(c){c.key&&A6(c)});else if(typeof e=="object")e.key&&A6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?EU(ud,v):[];vi[N]=vi[N].filter(function(T){var A=o?T.method===o:!0;return!(A&&T.scope===i&&O0e(T.mods,_))})}})};function BM(e,t,n,i){if(t.element===i){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var u in xa)Object.prototype.hasOwnProperty.call(xa,u)&&(!xa[u]&&t.mods.indexOf(+u)>-1||xa[u]&&t.mods.indexOf(+u)===-1)&&(o=!1);(t.mods.length===0&&!xa[16]&&!xa[18]&&!xa[17]&&!xa[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function UM(e,t){var n=vi["*"],i=e.keyCode||e.which||e.charCode;if(!!us.filter.call(this,e)){if((i===93||i===224)&&(i=91),Pr.indexOf(i)===-1&&i!==229&&Pr.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(T){var A=R8[T];e[T]&&Pr.indexOf(A)===-1?Pr.push(A):!e[T]&&Pr.indexOf(A)>-1?Pr.splice(Pr.indexOf(A),1):T==="metaKey"&&e[T]&&Pr.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Pr=Pr.slice(Pr.indexOf(A))))}),i in xa){xa[i]=!0;for(var o in ud)ud[o]===i&&(us[o]=!0);if(!n)return}for(var u in xa)Object.prototype.hasOwnProperty.call(xa,u)&&(xa[u]=e[R8[u]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Pr.indexOf(17)===-1&&Pr.push(17),Pr.indexOf(18)===-1&&Pr.push(18),xa[17]=!0,xa[18]=!0);var c=nb();if(n)for(var p=0;p-1}function us(e,t,n){Pr=[];var i=TU(e),o=[],u="all",c=document,p=0,h=!1,v=!0,b="+",x=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(u=t.scope),t.element&&(c=t.element),t.keyup&&(h=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(x=t.capture),typeof t.splitKey=="string"&&(b=t.splitKey)),typeof t=="string"&&(u=t);p1&&(o=EU(ud,e)),e=e[e.length-1],e=e==="*"?"*":f3(e),e in vi||(vi[e]=[]),vi[e].push({keyup:h,keydown:v,scope:u,mods:o,shortcut:i[p],method:n,key:i[p],splitKey:b,element:c});typeof c<"u"&&!B0e(c)&&window&&(AU.push(c),R6(c,"keydown",function(N){UM(N,c)},x),zM||(zM=!0,R6(window,"focus",function(){Pr=[]},x)),R6(c,"keyup",function(N){UM(N,c),F0e(N)},x))}function U0e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(vi).forEach(function(n){var i=vi[n].find(function(o){return o.scope===t&&o.shortcut===e});i&&i.method&&i.method()})}var k6={setScope:kU,getScope:nb,deleteScope:I0e,getPressedKeyCodes:M0e,isPressed:P0e,filter:D0e,trigger:U0e,unbind:z0e,keyMap:ME,modifier:ud,modifierMap:R8};for(var L6 in k6)Object.prototype.hasOwnProperty.call(k6,L6)&&(us[L6]=k6[L6]);if(typeof window<"u"){var $0e=window.hotkeys;us.noConflict=function(e){return e&&window.hotkeys===us&&(window.hotkeys=$0e),us},window.hotkeys=us}us.filter=function(){return!0};var LU=function(t,n){var i=t.target,o=i&&i.tagName;return Boolean(o&&n&&n.includes(o))},j0e=function(t){return LU(t,["INPUT","TEXTAREA","SELECT"])};function ii(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var o=n||{},u=o.enableOnTags,c=o.filter,p=o.keyup,h=o.keydown,v=o.filterPreventDefault,b=v===void 0?!0:v,x=o.enabled,N=x===void 0?!0:x,_=o.enableOnContentEditable,T=_===void 0?!1:_,A=k.exports.useRef(null),M=k.exports.useCallback(function(z,P){var I,F;return c&&!c(z)?!b:j0e(z)&&!LU(z,u)||(I=z.target)!=null&&I.isContentEditable&&!T?!0:A.current===null||document.activeElement===A.current||(F=A.current)!=null&&F.contains(document.activeElement)?(t(z,P),!0):!1},i?[A,u,c].concat(i):[A,u,c]);return k.exports.useEffect(function(){if(!N){us.unbind(e,M);return}return p&&h!==!0&&(n.keydown=!1),us(e,n||{},M),function(){return us.unbind(e,M)}},[M,e,N]),A}us.isPressed;var O6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/InpaintingWIP.tsx";function V0e(){return C("div",{className:"work-in-progress inpainting-work-in-progress",children:[C("h1",{children:"Inpainting"},void 0,!1,{fileName:O6,lineNumber:6,columnNumber:7},this),C("p",{children:"Inpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."},void 0,!1,{fileName:O6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:O6,lineNumber:5,columnNumber:5},this)}var M6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/NodesWIP.tsx";function H0e(){return C("div",{className:"work-in-progress nodes-work-in-progress",children:[C("h1",{children:"Nodes"},void 0,!1,{fileName:M6,lineNumber:6,columnNumber:7},this),C("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."},void 0,!1,{fileName:M6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:M6,lineNumber:5,columnNumber:5},this)}var D6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/OutpaintingWIP.tsx";function W0e(){return C("div",{className:"work-in-progress outpainting-work-in-progress",children:[C("h1",{children:"Outpainting"},void 0,!1,{fileName:D6,lineNumber:6,columnNumber:7},this),C("p",{children:"Outpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."},void 0,!1,{fileName:D6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:D6,lineNumber:5,columnNumber:5},this)}var s4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/PostProcessingWIP.tsx";const G0e=()=>C("div",{className:"work-in-progress post-processing-work-in-progress",children:[C("h1",{children:"Post Processing"},void 0,!1,{fileName:s4,lineNumber:6,columnNumber:7},void 0),C("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image tab. A dedicated UI will be released soon."},void 0,!1,{fileName:s4,lineNumber:7,columnNumber:7},void 0),C("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen, High Resolution Fixing and more."},void 0,!1,{fileName:s4,lineNumber:13,columnNumber:7},void 0)]},void 0,!0,{fileName:s4,lineNumber:5,columnNumber:5},void 0);var $M="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/ImageToImageIcon.tsx";const Y0e=kv({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:C("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"},void 0,!1,{fileName:$M,lineNumber:8,columnNumber:7},void 0)},void 0,!1,{fileName:$M,lineNumber:7,columnNumber:5},void 0)});var q0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/InpaintIcon.tsx";const Z0e=kv({displayName:"InpaintIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593C0,768.593 0,2774.71 0,2774.71C0,3025.98 203.999,3229.98 455.269,3229.98L3088.04,3229.98C3339.31,3229.98 3543.31,3025.98 3543.31,2774.71C3543.31,2774.71 3543.31,768.593 3543.31,768.593ZM3446.56,2252.63L3446.56,768.593C3446.56,570.718 3285.91,410.068 3088.04,410.068C3088.04,410.068 455.269,410.068 455.269,410.068C257.394,410.068 96.745,570.718 96.745,768.593L96.745,2061.49L988.344,1051.01L1326.63,1423.12C1281.74,1438.3 1227.39,1454.93 1158.26,1480.89C995.738,1541.9 944.356,1613.28 911.834,1718.7C884.979,1805.76 875.814,1922.93 811.322,2093.5C763.918,2218.87 765.18,2304.83 790.606,2364.87C817.014,2427.22 869.858,2467.73 941.71,2493.83C1023.86,2523.67 1134.43,2534.25 1242.45,2557.97C1365.72,2585.04 1455.23,2643.2 1532.76,2665.96C1587.03,2681.89 1637.04,2683.6 1686.56,2663.56C1731.54,2645.36 1777.95,2607.64 1825.43,2535.92C1874.9,2461.2 1979.98,2369.94 2102.8,2276.91L2241.64,2429.63L2739.91,1850.53C2754.47,1841.35 2767.47,1833.12 2778.66,1825.94C2832.6,1791.35 2866.82,1742.41 2884.38,1682.61L2898.06,1666.72L3446.56,2252.63ZM1680.71,2559.9C1666.7,2570.37 1652.86,2577.22 1638.81,2580.95L1610.62,2588.45L1625.61,2644.82L1653.8,2637.33C1674.48,2631.83 1695.02,2622.04 1715.64,2606.61L1739,2589.14L1704.06,2542.43L1680.71,2559.9ZM1541.62,2570.42C1524.94,2564.58 1507.63,2557.37 1489.49,2549.48L1462.75,2537.84L1439.48,2591.33L1466.22,2602.97C1485.74,2611.46 1504.38,2619.18 1522.33,2625.47L1549.86,2635.12L1569.15,2580.07L1541.62,2570.42ZM1381.21,2503.1C1363.08,2496.04 1344.17,2489.24 1324.38,2483.03L1296.55,2474.29L1279.07,2529.94L1306.9,2538.68C1325.41,2544.49 1343.09,2550.86 1360.05,2557.46L1387.23,2568.04L1408.39,2513.68L1381.21,2503.1ZM1788.46,2430.83C1773.91,2447.61 1761.19,2463.86 1750.55,2479.44L1734.09,2503.52L1782.25,2536.43L1798.71,2512.35C1808.2,2498.46 1819.56,2484 1832.53,2469.04L1851.64,2447.01L1807.57,2408.79L1788.46,2430.83ZM1262.54,2466.49C1243.17,2462.24 1223.71,2458.43 1204.35,2454.87L1175.67,2449.6L1165.12,2506.97L1193.81,2512.24C1212.52,2515.68 1231.32,2519.35 1250.03,2523.46L1278.52,2529.72L1291.03,2472.74L1262.54,2466.49ZM1089.5,2434.66C1070.28,2431.1 1051.6,2427.35 1033.72,2423.15L1005.32,2416.49L992.002,2473.28L1020.4,2479.94C1039.14,2484.34 1058.71,2488.28 1078.86,2492.02L1107.54,2497.34L1118.18,2439.99L1089.5,2434.66ZM932.182,2386.94C917.545,2378.53 904.788,2368.71 894.532,2356.8L875.504,2334.69L831.294,2372.75L850.322,2394.85C864.755,2411.62 882.513,2425.67 903.11,2437.51L928.396,2452.05L957.469,2401.48L932.182,2386.94ZM1917.04,2306.1C1901.59,2319.37 1886.77,2332.5 1872.67,2345.44L1851.18,2365.17L1890.64,2408.14L1912.12,2388.41C1925.76,2375.89 1940.1,2363.19 1955.04,2350.36L1977.17,2331.36L1939.17,2287.1L1917.04,2306.1ZM866.485,2267.79C866.715,2251.85 868.706,2234.39 872.54,2215.21L878.257,2186.61L821.055,2175.17L815.338,2203.77C810.733,2226.81 808.434,2247.8 808.158,2266.94L807.737,2296.11L866.064,2296.95L866.485,2267.79ZM2055.08,2195.63C2039.24,2207.6 2023.66,2219.55 2008.43,2231.46L1985.45,2249.43L2021.38,2295.38L2044.36,2277.42C2059.34,2265.7 2074.66,2253.95 2090.23,2242.18L2113.51,2224.61L2078.35,2178.06L2055.08,2195.63ZM2197.62,2092.3C2181.57,2103.52 2165.6,2114.82 2149.74,2126.16L2126.02,2143.12L2159.95,2190.57L2183.67,2173.61C2199.36,2162.38 2215.18,2151.21 2231.05,2140.1L2254.95,2123.38L2221.52,2075.58L2197.62,2092.3ZM905.788,2108.14C912.858,2088.7 919.236,2069.96 925.03,2051.88L933.93,2024.1L878.378,2006.3L869.478,2034.08C863.905,2051.47 857.769,2069.5 850.968,2088.2L840.998,2115.61L895.817,2135.55L905.788,2108.14ZM2342.87,1993.45C2326.76,2004.15 2310.52,2015.01 2294.22,2026L2270.04,2042.31L2302.65,2090.67L2326.83,2074.37C2343.01,2063.45 2359.14,2052.67 2375.14,2042.04L2399.44,2025.91L2367.17,1977.31L2342.87,1993.45ZM2489.92,1897.67C2473.88,1907.94 2457.46,1918.5 2440.74,1929.32L2416.26,1945.16L2447.95,1994.14L2472.44,1978.29C2489.07,1967.53 2505.41,1957.02 2521.37,1946.8L2545.93,1931.07L2514.48,1881.94L2489.92,1897.67ZM956.972,1937.49C961.849,1917.31 966.133,1898.15 970.079,1879.93L976.253,1851.43L919.241,1839.08L913.067,1867.59C909.215,1885.38 905.033,1904.08 900.271,1923.79L893.42,1952.13L950.121,1965.84L956.972,1937.49ZM2638.01,1803.95C2622.5,1813.69 2605.98,1824.08 2588.59,1835.04L2563.91,1850.59L2595.02,1899.94L2619.69,1884.38C2637.05,1873.44 2653.55,1863.08 2669.03,1853.35L2693.73,1837.84L2662.71,1788.44L2638.01,1803.95ZM2769.59,1708.14C2760.26,1721.07 2748.81,1732.54 2735.03,1742.4L2711.31,1759.37L2745.25,1806.81L2768.97,1789.84C2788.08,1776.17 2803.93,1760.22 2816.88,1742.3L2833.95,1718.65L2786.67,1684.5L2769.59,1708.14ZM995.304,1767.43C1000.24,1748.86 1005.64,1731.66 1012.23,1715.62L1023.31,1688.64L969.359,1666.47L958.273,1693.45C950.767,1711.72 944.551,1731.29 938.928,1752.44L931.436,1780.63L987.812,1795.62L995.304,1767.43ZM1071.42,1633.09C1083.85,1622.63 1098.26,1612.75 1115.07,1603.23L1140.45,1588.86L1111.71,1538.1L1086.33,1552.47C1066.11,1563.92 1048.82,1575.88 1033.86,1588.46L1011.55,1607.24L1049.11,1651.87L1071.42,1633.09ZM2804.87,1559.28C2805.5,1578.06 2804.95,1596.1 2803,1613.27L2799.72,1642.25L2857.68,1648.81L2860.97,1619.83C2863.22,1599.96 2863.9,1579.07 2863.17,1557.33L2862.2,1528.18L2803.9,1530.12L2804.87,1559.28ZM1217.5,1558.88C1236.87,1551.88 1254.98,1545.61 1271.98,1539.88L1299.62,1530.55L1280.97,1475.28L1253.33,1484.6C1235.96,1490.46 1217.45,1496.87 1197.66,1504.02L1170.23,1513.94L1190.07,1568.8L1217.5,1558.88ZM1383.15,1502.63C1403.9,1495.17 1422.61,1487.67 1439.93,1479.27L1466.18,1466.54L1440.73,1414.06L1414.48,1426.78C1398.91,1434.33 1382.06,1441.03 1363.41,1447.74L1335.96,1457.62L1355.71,1512.51L1383.15,1502.63ZM2777.41,1393.4C2782.33,1412.11 2786.73,1430.56 2790.49,1448.67L2796.42,1477.23L2853.54,1465.37L2847.6,1436.81C2843.64,1417.72 2839.01,1398.28 2833.83,1378.57L2826.41,1350.36L2770,1365.19L2777.41,1393.4ZM1541.19,1401.64C1553.52,1387.35 1565.77,1370.94 1578.31,1351.79L1594.28,1327.39L1545.48,1295.44L1529.5,1319.84C1518.52,1336.62 1507.83,1351.02 1497.03,1363.53L1477.97,1385.61L1522.14,1423.72L1541.19,1401.64ZM2725.02,1229.27C2731.61,1247.45 2738.01,1265.61 2744.12,1283.7L2753.45,1311.33L2808.72,1292.66L2799.38,1265.03C2793.13,1246.53 2786.6,1227.96 2779.85,1209.37L2769.9,1181.95L2715.07,1201.86L2725.02,1229.27ZM1636.99,1247.12C1644.26,1232.56 1651.77,1217.04 1659.58,1200.45C1660.59,1198.3 1661.61,1196.15 1662.61,1194.02L1675.08,1167.65L1622.34,1142.72L1609.88,1169.09C1608.86,1171.25 1607.83,1173.42 1606.81,1175.59C1599.2,1191.75 1591.88,1206.88 1584.8,1221.06L1571.77,1247.16L1623.96,1273.21L1636.99,1247.12ZM2251.58,766.326C2320.04,672.986 2430.48,612.355 2554.96,612.355C2762.48,612.355 2930.95,780.83 2930.95,988.344C2930.95,1087.56 2892.44,1177.85 2829.58,1245.06C2804.67,1171.95 2775.67,1097.93 2747.18,1026.98C2699.54,908.311 2654.38,849.115 2602.9,816.501C2565.59,792.868 2523.88,781.903 2471.8,777.274C2416.47,772.355 2346.53,774.829 2251.58,766.326ZM2662.3,1066.95C2669.46,1084.79 2676.66,1102.83 2683.81,1120.98L2694.51,1148.12L2748.78,1126.72L2738.08,1099.59C2730.88,1081.32 2723.64,1063.18 2716.44,1045.23L2705.58,1018.16L2651.44,1039.88L2662.3,1066.95ZM1713.81,1090.65C1723.08,1073.13 1732.27,1056.54 1741.52,1040.87L1756.33,1015.74L1706.08,986.113L1691.27,1011.24C1681.59,1027.65 1671.95,1045.03 1662.25,1063.39L1648.61,1089.17L1700.18,1116.44L1713.81,1090.65ZM2584.06,922.671C2594.47,934.345 2604.5,948.467 2614.55,965.492L2629.38,990.608L2679.62,960.949L2664.79,935.834C2652.56,915.134 2640.26,898.042 2627.6,883.849L2608.19,862.079L2564.65,900.901L2584.06,922.671ZM1805.33,949.853C1817.51,935.859 1830.16,923.259 1843.5,912.06L1865.85,893.314L1828.36,848.625L1806.01,867.372C1790.4,880.469 1775.59,895.178 1761.34,911.545L1742.18,933.541L1786.17,971.849L1805.33,949.853ZM2446.47,869.303C2466.17,870.516 2483.98,872.335 2500.35,875.649L2528.94,881.438L2540.51,824.265L2511.93,818.476C2493.13,814.67 2472.68,812.474 2450.05,811.08L2420.94,809.287L2417.35,867.51L2446.47,869.303ZM1935.15,861.305C1951.44,856.036 1968.78,851.999 1987.35,849.144L2016.18,844.713L2007.32,787.057L1978.49,791.488C1956.68,794.84 1936.32,799.616 1917.19,805.802L1889.44,814.778L1907.39,870.28L1935.15,861.305ZM2271.35,861.832C2292.28,863.33 2311.95,864.351 2330.47,865.114L2359.61,866.316L2362.01,808.032L2332.87,806.83C2314.9,806.09 2295.82,805.1 2275.51,803.648L2246.42,801.567L2242.26,859.751L2271.35,861.832ZM2097.81,844.858C2115.7,845.771 2134.46,847.337 2154.17,849.543L2183.16,852.787L2189.65,794.816L2160.66,791.572C2139.72,789.228 2119.79,787.57 2100.78,786.6L2071.65,785.114L2068.68,843.372L2097.81,844.858Z"},void 0,!1,{fileName:q0e,lineNumber:7,columnNumber:5},void 0)});var K0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/NodesIcon.tsx";const X0e=kv({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"},void 0,!1,{fileName:K0e,lineNumber:7,columnNumber:5},void 0)});var Q0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/OutpaintIcon.tsx";const J0e=kv({displayName:"OutpaintIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,766.352C3543.31,516.705 3340.63,314.024 3090.98,314.024L452.328,314.024C202.681,314.024 0,516.705 0,766.352L0,2776.95C0,3026.6 202.681,3229.28 452.328,3229.28C452.328,3229.28 3090.98,3229.28 3090.98,3229.28C3340.63,3229.28 3543.31,3026.6 3543.31,2776.95C3543.31,2776.95 3543.31,766.352 3543.31,766.352ZM3454.26,766.352L3454.26,2776.95C3454.26,2977.46 3291.48,3140.24 3090.98,3140.24L452.328,3140.24C251.825,3140.24 89.043,2977.46 89.043,2776.95C89.043,2776.95 89.043,766.352 89.043,766.352C89.043,565.849 251.825,403.067 452.328,403.067C452.328,403.067 3090.98,403.067 3090.98,403.067C3291.48,403.067 3454.26,565.849 3454.26,766.352ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265Z"},void 0,!1,{fileName:Q0e,lineNumber:7,columnNumber:5},void 0)});var e1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/PostprocessingIcon.tsx";const t1e=kv({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"},void 0,!1,{fileName:e1e,lineNumber:7,columnNumber:5},void 0)});var jM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/TextToImageIcon.tsx";const n1e=kv({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:C("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:C("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"},void 0,!1,{fileName:jM,lineNumber:13,columnNumber:7},void 0)},void 0,!1,{fileName:jM,lineNumber:7,columnNumber:5},void 0)});var zl=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e))(zl||{});const r1e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"ImageToImage allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}};var l4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAISwitch.tsx";const pm=e=>{const{label:t,isDisabled:n=!1,fontSize:i="md",size:o="md",width:u="auto",...c}=e;return C(fd,{isDisabled:n,width:u,children:C(Sr,{justifyContent:"space-between",alignItems:"center",children:[t&&C(sm,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:l4,lineNumber:30,columnNumber:11},void 0),C(s3,{size:o,className:"switch-button",...c},void 0,!1,{fileName:l4,lineNumber:39,columnNumber:9},void 0)]},void 0,!0,{fileName:l4,lineNumber:28,columnNumber:7},void 0)},void 0,!1,{fileName:l4,lineNumber:27,columnNumber:5},void 0)};var P6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestore.tsx";function OU(){const e=gt(o=>o.system.isGFPGANAvailable),t=gt(o=>o.options.shouldRunFacetool),n=Sn();return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Restore Face"},void 0,!1,{fileName:P6,lineNumber:32,columnNumber:7},this),C(pm,{isDisabled:!e,isChecked:t,onChange:o=>n(Qhe(o.target.checked))},void 0,!1,{fileName:P6,lineNumber:33,columnNumber:7},this)]},void 0,!0,{fileName:P6,lineNumber:26,columnNumber:5},this)}var Ip="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAINumberInput.tsx";const VM=/^-?(0\.)?\.?$/,Vl=e=>{const{label:t,styleClass:n,isDisabled:i=!1,showStepper:o=!0,fontSize:u="1rem",size:c="sm",width:p,textAlign:h,isInvalid:v,value:b,onChange:x,min:N,max:_,isInteger:T=!0,...A}=e,[M,z]=k.exports.useState(String(b));k.exports.useEffect(()=>{!M.match(VM)&&b!==Number(M)&&z(String(b))},[b,M]);const P=F=>{z(F),F.match(VM)||x(T?Math.floor(Number(F)):Number(F))},I=F=>{const $=tb.clamp(T?Math.floor(Number(F.target.value)):Number(F.target.value),N,_);z(String($)),x($)};return C(fd,{isDisabled:i,isInvalid:v,className:`number-input ${n}`,children:[t&&C(sm,{fontSize:u,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"number-input-label",children:t},void 0,!1,{fileName:Ip,lineNumber:103,columnNumber:9},void 0),C(Rz,{size:c,...A,className:"number-input-field",value:M,keepWithinRange:!0,clampValueOnBlur:!1,onChange:P,onBlur:I,children:[C(Az,{fontSize:u,className:"number-input-entry",width:p,textAlign:h},void 0,!1,{fileName:Ip,lineNumber:123,columnNumber:9},void 0),C("div",{className:"number-input-stepper",style:o?{display:"block"}:{display:"none"},children:[C(Oz,{className:"number-input-stepper-button"},void 0,!1,{fileName:Ip,lineNumber:133,columnNumber:11},void 0),C(Lz,{className:"number-input-stepper-button"},void 0,!1,{fileName:Ip,lineNumber:134,columnNumber:11},void 0)]},void 0,!0,{fileName:Ip,lineNumber:129,columnNumber:9},void 0)]},void 0,!0,{fileName:Ip,lineNumber:113,columnNumber:7},void 0)]},void 0,!0,{fileName:Ip,lineNumber:97,columnNumber:5},void 0)};var og="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAISelect.tsx";const Rb=e=>{const{label:t,isDisabled:n,validValues:i,size:o="sm",fontSize:u="md",styleClass:c,...p}=e;return C(fd,{isDisabled:n,className:`iai-select ${c}`,children:[C(sm,{fontSize:u,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"iai-select-label",children:t},void 0,!1,{fileName:og,lineNumber:25,columnNumber:7},void 0),C(Iz,{fontSize:u,size:o,...p,className:"iai-select-picker",children:i.map(h=>typeof h=="string"||typeof h=="number"?C("option",{value:h,className:"iai-select-option",children:h},h,!1,{fileName:og,lineNumber:42,columnNumber:13},void 0):C("option",{value:h.value,children:h.key},h.value,!1,{fileName:og,lineNumber:46,columnNumber:13},void 0))},void 0,!1,{fileName:og,lineNumber:34,columnNumber:7},void 0)]},void 0,!0,{fileName:og,lineNumber:24,columnNumber:5},void 0)};var u4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx";const i1e=Ga(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),a1e=Ga(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),DE=()=>{const e=Sn(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:i}=gt(i1e),{isGFPGANAvailable:o}=gt(a1e),u=h=>e(L4(h)),c=h=>e(eU(h)),p=h=>e(O4(h.target.value));return C(Sr,{direction:"column",gap:2,children:[C(Rb,{label:"Type",validValues:k0e.concat(),value:n,onChange:p},void 0,!1,{fileName:u4,lineNumber:71,columnNumber:7},void 0),C(Vl,{isDisabled:!o,label:"Strength",step:.05,min:0,max:1,onChange:u,value:t,width:"90px",isInteger:!1},void 0,!1,{fileName:u4,lineNumber:77,columnNumber:7},void 0),n==="codeformer"&&C(Vl,{isDisabled:!o,label:"Fidelity",step:.05,min:0,max:1,onChange:c,value:i,width:"90px",isInteger:!1},void 0,!1,{fileName:u4,lineNumber:89,columnNumber:9},void 0)]},void 0,!0,{fileName:u4,lineNumber:70,columnNumber:5},void 0)};var o1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageFit.tsx";function s1e(){const e=Sn(),t=gt(i=>i.options.shouldFitToWidthHeight);return C(pm,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:i=>e(tU(i.target.checked))},void 0,!1,{fileName:o1e,lineNumber:21,columnNumber:5},this)}var l1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx";function u1e(e){const{label:t="Strength",styleClass:n}=e,i=gt(c=>c.options.img2imgStrength),o=Sn();return C(Vl,{label:t,step:.01,min:.01,max:.99,onChange:c=>o(JB(c)),value:i,width:"90px",isInteger:!1,styleClass:n},void 0,!1,{fileName:l1e,lineNumber:26,columnNumber:5},this)}var c1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/RandomizeSeed.tsx";function f1e(){const e=Sn(),t=gt(i=>i.options.shouldRandomizeSeed);return C(pm,{label:"Randomize Seed",isChecked:t,onChange:i=>e(eve(i.target.checked))},void 0,!1,{fileName:c1e,lineNumber:22,columnNumber:5},this)}var d1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Seed.tsx";function p1e(){const e=gt(u=>u.options.seed),t=gt(u=>u.options.shouldRandomizeSeed),n=gt(u=>u.options.shouldGenerateVariations),i=Sn(),o=u=>i(Tb(u));return C(Vl,{label:"Seed",step:1,precision:0,flexGrow:1,min:LE,max:OE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"10rem"},void 0,!1,{fileName:d1e,lineNumber:25,columnNumber:5},this)}var HM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/ShuffleSeed.tsx";function m1e(){const e=Sn(),t=gt(i=>i.options.shouldRandomizeSeed);return C(Du,{size:"sm",isDisabled:t,onClick:()=>e(Tb(_U(LE,OE))),children:C("p",{children:"Shuffle"},void 0,!1,{fileName:HM,lineNumber:27,columnNumber:7},this)},void 0,!1,{fileName:HM,lineNumber:22,columnNumber:5},this)}var h1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Threshold.tsx";function v1e(){const e=Sn(),t=gt(i=>i.options.threshold);return C(Vl,{label:"Threshold",min:0,max:1e3,step:.1,onChange:i=>e(qhe(i)),value:t,isInteger:!1},void 0,!1,{fileName:h1e,lineNumber:19,columnNumber:5},this)}var g1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Perlin.tsx";function b1e(){const e=Sn(),t=gt(i=>i.options.perlin);return C(Vl,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:i=>e(Zhe(i)),value:t,isInteger:!1},void 0,!1,{fileName:g1e,lineNumber:17,columnNumber:5},this)}var Ec="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/SeedOptions.tsx";const MU=()=>C(Sr,{gap:2,direction:"column",children:[C(f1e,{},void 0,!1,{fileName:Ec,lineNumber:14,columnNumber:7},void 0),C(Sr,{gap:2,children:[C(p1e,{},void 0,!1,{fileName:Ec,lineNumber:16,columnNumber:9},void 0),C(m1e,{},void 0,!1,{fileName:Ec,lineNumber:17,columnNumber:9},void 0)]},void 0,!0,{fileName:Ec,lineNumber:15,columnNumber:7},void 0),C(Sr,{gap:2,children:C(v1e,{},void 0,!1,{fileName:Ec,lineNumber:20,columnNumber:9},void 0)},void 0,!1,{fileName:Ec,lineNumber:19,columnNumber:7},void 0),C(Sr,{gap:2,children:C(b1e,{},void 0,!1,{fileName:Ec,lineNumber:23,columnNumber:9},void 0)},void 0,!1,{fileName:Ec,lineNumber:22,columnNumber:7},void 0)]},void 0,!0,{fileName:Ec,lineNumber:13,columnNumber:5},void 0);var I6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Upscale/Upscale.tsx";function DU(){const e=gt(o=>o.system.isESRGANAvailable),t=gt(o=>o.options.shouldRunESRGAN),n=Sn();return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Upscale"},void 0,!1,{fileName:I6,lineNumber:30,columnNumber:7},this),C(pm,{isDisabled:!e,isChecked:t,onChange:o=>n(Jhe(o.target.checked))},void 0,!1,{fileName:I6,lineNumber:31,columnNumber:7},this)]},void 0,!0,{fileName:I6,lineNumber:24,columnNumber:5},this)}var F6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Upscale/UpscaleOptions.tsx";const y1e=Ga(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),S1e=Ga(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),PE=()=>{const e=Sn(),{upscalingLevel:t,upscalingStrength:n}=gt(y1e),{isESRGANAvailable:i}=gt(S1e);return C("div",{className:"upscale-options",children:[C(Rb,{isDisabled:!i,label:"Scale",value:t,onChange:c=>e(y8(Number(c.target.value))),validValues:A0e},void 0,!1,{fileName:F6,lineNumber:64,columnNumber:7},void 0),C(Vl,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:c=>e(S8(c)),value:n,isInteger:!1},void 0,!1,{fileName:F6,lineNumber:71,columnNumber:7},void 0)]},void 0,!0,{fileName:F6,lineNumber:63,columnNumber:5},void 0)};var x1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/GenerateVariations.tsx";function C1e(){const e=gt(i=>i.options.shouldGenerateVariations),t=Sn();return C(pm,{isChecked:e,width:"auto",onChange:i=>t(Khe(i.target.checked))},void 0,!1,{fileName:x1e,lineNumber:22,columnNumber:5},this)}var z6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/Variations.tsx";function PU(){return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Variations"},void 0,!1,{fileName:z6,lineNumber:13,columnNumber:7},this),C(C1e,{},void 0,!1,{fileName:z6,lineNumber:14,columnNumber:7},this)]},void 0,!0,{fileName:z6,lineNumber:7,columnNumber:5},this)}var B6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIInput.tsx";function N1e(e){const{label:t,styleClass:n,isDisabled:i=!1,fontSize:o="1rem",width:u,isInvalid:c,...p}=e;return C(fd,{className:`input ${n}`,isInvalid:c,isDisabled:i,flexGrow:1,children:[C(sm,{fontSize:o,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t},void 0,!1,{fileName:B6,lineNumber:30,columnNumber:7},this),C(M_,{...p,className:"input-entry",size:"sm",width:u},void 0,!1,{fileName:B6,lineNumber:38,columnNumber:7},this)]},void 0,!0,{fileName:B6,lineNumber:24,columnNumber:5},this)}var w1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/SeedWeights.tsx";function _1e(){const e=gt(o=>o.options.seedWeights),t=gt(o=>o.options.shouldGenerateVariations),n=Sn(),i=o=>n(nU(o.target.value));return C(N1e,{label:"Seed Weights",value:e,isInvalid:t&&!(RE(e)||e===""),isDisabled:!t,onChange:i},void 0,!1,{fileName:w1e,lineNumber:26,columnNumber:5},this)}var E1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/VariationAmount.tsx";function T1e(){const e=gt(o=>o.options.variationAmount),t=gt(o=>o.options.shouldGenerateVariations),n=Sn();return C(Vl,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>n(Xhe(o)),isInteger:!1},void 0,!1,{fileName:E1e,lineNumber:24,columnNumber:5},this)}var U6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/VariationsOptions.tsx";const IU=()=>C(Sr,{gap:2,direction:"column",children:[C(T1e,{},void 0,!1,{fileName:U6,lineNumber:11,columnNumber:7},void 0),C(_1e,{},void 0,!1,{fileName:U6,lineNumber:12,columnNumber:7},void 0)]},void 0,!0,{fileName:U6,lineNumber:10,columnNumber:5},void 0);var $6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainAdvancedOptions.tsx";function FU(){const e=gt(i=>i.options.showAdvancedOptions),t=Sn();return C("div",{className:"advanced_options_checker",children:[C("input",{type:"checkbox",name:"advanced_options",id:"",onChange:i=>t(tve(i.target.checked)),checked:e},void 0,!1,{fileName:$6,lineNumber:16,columnNumber:7},this),C("label",{htmlFor:"advanced_options",children:"Advanced Options"},void 0,!1,{fileName:$6,lineNumber:23,columnNumber:7},this)]},void 0,!0,{fileName:$6,lineNumber:15,columnNumber:5},this)}var R1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainCFGScale.tsx";function A1e(){const e=Sn(),t=gt(i=>i.options.cfgScale);return C(Vl,{label:"CFG Scale",step:.5,min:1,max:30,onChange:i=>e(YB(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center",isInteger:!1},void 0,!1,{fileName:R1e,lineNumber:14,columnNumber:5},this)}var k1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainHeight.tsx";function L1e(){const e=gt(i=>i.options.height),t=Sn();return C(Rb,{label:"Height",value:e,flexGrow:1,onChange:i=>t(qB(Number(i.target.value))),validValues:R0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:k1e,lineNumber:16,columnNumber:5},this)}var O1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainIterations.tsx";function M1e(){const e=Sn(),t=gt(i=>i.options.iterations);return C(Vl,{label:"Images",step:1,min:1,max:9999,onChange:i=>e(Yhe(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center"},void 0,!1,{fileName:O1e,lineNumber:16,columnNumber:5},this)}var D1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainSampler.tsx";function P1e(){const e=gt(i=>i.options.sampler),t=Sn();return C(Rb,{label:"Sampler",value:e,onChange:i=>t(KB(i.target.value)),validValues:E0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:D1e,lineNumber:16,columnNumber:5},this)}var I1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainSteps.tsx";function F1e(){const e=Sn(),t=gt(i=>i.options.steps);return C(Vl,{label:"Steps",min:1,max:9999,step:1,onChange:i=>e(GB(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center"},void 0,!1,{fileName:I1e,lineNumber:14,columnNumber:5},this)}var z1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainWidth.tsx";function B1e(){const e=gt(i=>i.options.width),t=Sn();return C(Rb,{label:"Width",value:e,flexGrow:1,onChange:i=>t(ZB(Number(i.target.value))),validValues:T0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:z1e,lineNumber:16,columnNumber:5},this)}var gu="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainOptions.tsx";const Bv="0.9rem",IE="auto";function zU(){return C("div",{className:"main-options",children:C("div",{className:"main-options-list",children:[C("div",{className:"main-options-row",children:[C(M1e,{},void 0,!1,{fileName:gu,lineNumber:16,columnNumber:11},this),C(F1e,{},void 0,!1,{fileName:gu,lineNumber:17,columnNumber:11},this),C(A1e,{},void 0,!1,{fileName:gu,lineNumber:18,columnNumber:11},this)]},void 0,!0,{fileName:gu,lineNumber:15,columnNumber:9},this),C("div",{className:"main-options-row",children:[C(B1e,{},void 0,!1,{fileName:gu,lineNumber:21,columnNumber:11},this),C(L1e,{},void 0,!1,{fileName:gu,lineNumber:22,columnNumber:11},this),C(P1e,{},void 0,!1,{fileName:gu,lineNumber:23,columnNumber:11},this)]},void 0,!0,{fileName:gu,lineNumber:20,columnNumber:9},this)]},void 0,!0,{fileName:gu,lineNumber:14,columnNumber:7},this)},void 0,!1,{fileName:gu,lineNumber:13,columnNumber:5},this)}var BU={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},WM=Ae.createContext&&Ae.createContext(BU),F4="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/react-icons/lib/esm/iconBase.js",nd=globalThis&&globalThis.__assign||function(){return nd=Object.assign||function(e){for(var t,n=1,i=arguments.length;ne.system,e=>e.shouldDisplayGuides),Q1e=({children:e,feature:t})=>{const n=gt(X1e),{text:i}=r1e[t];return n?C(aE,{trigger:"hover",children:[C(uE,{children:C(Xs,{children:e},void 0,!1,{fileName:Yh,lineNumber:31,columnNumber:9},void 0)},void 0,!1,{fileName:Yh,lineNumber:30,columnNumber:7},void 0),C(lE,{className:"guide-popover-content",maxWidth:"400px",onClick:o=>o.preventDefault(),cursor:"initial",children:[C(oE,{className:"guide-popover-arrow"},void 0,!1,{fileName:Yh,lineNumber:39,columnNumber:9},void 0),C("div",{className:"guide-popover-guide-content",children:i},void 0,!1,{fileName:Yh,lineNumber:40,columnNumber:9},void 0)]},void 0,!0,{fileName:Yh,lineNumber:33,columnNumber:7},void 0)]},void 0,!0,{fileName:Yh,lineNumber:29,columnNumber:5},void 0):C(Ui,{},void 0,!1)};var j6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/GuideIcon.tsx";const J1e=qe(({feature:e,icon:t=$U},n)=>C(Q1e,{feature:e,children:C(Xs,{ref:n,children:C(ms,{as:t},void 0,!1,{fileName:j6,lineNumber:16,columnNumber:9},void 0)},void 0,!1,{fileName:j6,lineNumber:15,columnNumber:7},void 0)},void 0,!1,{fileName:j6,lineNumber:14,columnNumber:5},void 0));var qh="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AccordionItems/InvokeAccordionItem.tsx";function ege(e){const{header:t,feature:n,options:i}=e;return C(VI,{className:"advanced-settings-item",children:[C("h2",{children:C($I,{className:"advanced-settings-header",children:[t,C(J1e,{feature:n},void 0,!1,{fileName:qh,lineNumber:25,columnNumber:11},this),C(jI,{},void 0,!1,{fileName:qh,lineNumber:26,columnNumber:11},this)]},void 0,!0,{fileName:qh,lineNumber:23,columnNumber:9},this)},void 0,!1,{fileName:qh,lineNumber:22,columnNumber:7},this),C(HI,{className:"advanced-settings-panel",children:i},void 0,!1,{fileName:qh,lineNumber:29,columnNumber:7},this)]},void 0,!0,{fileName:qh,lineNumber:21,columnNumber:5},this)}var YM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OptionsAccordion.tsx";const VU=e=>{const{accordionInfo:t}=e,n=gt(c=>c.system.openAccordions),i=Sn();return C(WI,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:c=>i(pve(c)),className:"advanced-settings",children:(()=>{const c=[];return t&&Object.keys(t).forEach(p=>{c.push(C(ege,{header:t[p].header,feature:t[p].feature,options:t[p].options},p,!1,{fileName:YM,lineNumber:40,columnNumber:11},void 0))}),c})()},void 0,!1,{fileName:YM,lineNumber:53,columnNumber:5},void 0)};var qM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/HiresOptions.tsx";const tge=()=>{const e=Sn(),t=gt(i=>i.options.hiresFix);return C(Sr,{gap:2,direction:"column",children:C(pm,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:i=>e(QB(i.target.checked))},void 0,!1,{fileName:qM,lineNumber:22,columnNumber:7},void 0)},void 0,!1,{fileName:qM,lineNumber:21,columnNumber:5},void 0)};var ZM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SeamlessOptions.tsx";const nge=()=>{const e=Sn(),t=gt(i=>i.options.seamless);return C(Sr,{gap:2,direction:"column",children:C(pm,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:i=>e(XB(i.target.checked))},void 0,!1,{fileName:ZM,lineNumber:18,columnNumber:7},void 0)},void 0,!1,{fileName:ZM,lineNumber:17,columnNumber:5},void 0)};var V6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OutputOptions.tsx";const HU=()=>C(Sr,{gap:2,direction:"column",children:[C(nge,{},void 0,!1,{fileName:V6,lineNumber:10,columnNumber:7},void 0),C(tge,{},void 0,!1,{fileName:V6,lineNumber:11,columnNumber:7},void 0)]},void 0,!0,{fileName:V6,lineNumber:9,columnNumber:5},void 0);var KM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIButton.tsx";const vg=e=>{const{label:t,tooltip:n="",size:i="sm",...o}=e;return C(Ca,{label:n,children:C(Du,{size:i,...o,children:t},void 0,!1,{fileName:KM,lineNumber:17,columnNumber:7},void 0)},void 0,!1,{fileName:KM,lineNumber:16,columnNumber:5},void 0)},XM=Ga(e=>e.options,e=>({prompt:e.prompt,shouldGenerateVariations:e.shouldGenerateVariations,seedWeights:e.seedWeights,maskPath:e.maskPath,initialImagePath:e.initialImagePath,seed:e.seed,activeTab:e.activeTab}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),FE=Ga(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),WU=()=>{const{prompt:e}=gt(XM),{shouldGenerateVariations:t,seedWeights:n,maskPath:i,initialImagePath:o,seed:u,activeTab:c}=gt(XM),{isProcessing:p,isConnected:h}=gt(FE);return k.exports.useMemo(()=>!(!e||Boolean(e.match(/^[\s\r\n]+$/))||e&&!o&&c===1||i&&!o||p||!h||t&&(!(RE(n)||n==="")||u===-1)),[e,i,o,p,h,t,n,u,c])};var rge="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/InvokeButton.tsx";function ige(){const e=Sn(),t=WU();return C(vg,{label:"Invoke","aria-label":"Invoke",type:"submit",isDisabled:!t,onClick:()=>{e(T8())},className:"invoke-btn"},void 0,!1,{fileName:rge,lineNumber:16,columnNumber:5},this)}var QM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIIconButton.tsx";const Wp=e=>{const{tooltip:t="",tooltipPlacement:n="bottom",onClick:i,...o}=e;return C(Ca,{label:t,hasArrow:!0,placement:n,children:C(bi,{...o,cursor:i?"pointer":"unset",onClick:i},void 0,!1,{fileName:QM,lineNumber:22,columnNumber:7},void 0)},void 0,!1,{fileName:QM,lineNumber:21,columnNumber:5},void 0)};var JM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/CancelButton.tsx";function age(){const e=Sn(),{isProcessing:t,isConnected:n}=gt(FE),i=()=>e(C0e());return ii("shift+x",()=>{(n||t)&&i()},[n,t]),C(Wp,{icon:C(K1e,{},void 0,!1,{fileName:JM,lineNumber:26,columnNumber:13},this),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!n||!t,onClick:i,className:"cancel-btn"},void 0,!1,{fileName:JM,lineNumber:25,columnNumber:5},this)}var H6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/ProcessButtons.tsx";const GU=()=>C("div",{className:"process-buttons",children:[C(ige,{},void 0,!1,{fileName:H6,lineNumber:10,columnNumber:7},void 0),C(age,{},void 0,!1,{fileName:H6,lineNumber:11,columnNumber:7},void 0)]},void 0,!0,{fileName:H6,lineNumber:9,columnNumber:5},void 0);var W6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/PromptInput/PromptInput.tsx";const oge=Ga(e=>e.options,e=>({prompt:e.prompt}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),YU=()=>{const e=k.exports.useRef(null),{prompt:t}=gt(oge),{isProcessing:n}=gt(FE),i=Sn(),o=WU(),u=p=>{i(WB(p.target.value))};ii("ctrl+enter",()=>{o&&i(T8())},[o]),ii("alt+a",()=>{e.current?.focus()},[]);const c=p=>{p.key==="Enter"&&p.shiftKey===!1&&o&&(p.preventDefault(),i(T8()))};return C("div",{className:"prompt-bar",children:C(fd,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),isDisabled:n,children:C(Wz,{id:"prompt",name:"prompt",placeholder:"I'm dreaming of...",size:"lg",value:t,onChange:u,onKeyDown:c,resize:"vertical",height:30,ref:e},void 0,!1,{fileName:W6,lineNumber:73,columnNumber:9},void 0)},void 0,!1,{fileName:W6,lineNumber:69,columnNumber:7},void 0)},void 0,!1,{fileName:W6,lineNumber:68,columnNumber:5},void 0)};var Xi="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx";function sge(){const e=gt(n=>n.options.showAdvancedOptions),t={seed:{header:C(Xs,{flex:"1",textAlign:"left",children:"Seed"},void 0,!1,{fileName:Xi,lineNumber:29,columnNumber:9},this),feature:zl.SEED,options:C(MU,{},void 0,!1,{fileName:Xi,lineNumber:34,columnNumber:16},this)},variations:{header:C(PU,{},void 0,!1,{fileName:Xi,lineNumber:37,columnNumber:15},this),feature:zl.VARIATIONS,options:C(IU,{},void 0,!1,{fileName:Xi,lineNumber:39,columnNumber:16},this)},face_restore:{header:C(OU,{},void 0,!1,{fileName:Xi,lineNumber:42,columnNumber:15},this),feature:zl.FACE_CORRECTION,options:C(DE,{},void 0,!1,{fileName:Xi,lineNumber:44,columnNumber:16},this)},upscale:{header:C(DU,{},void 0,!1,{fileName:Xi,lineNumber:47,columnNumber:15},this),feature:zl.UPSCALE,options:C(PE,{},void 0,!1,{fileName:Xi,lineNumber:49,columnNumber:16},this)},other:{header:C(Xs,{flex:"1",textAlign:"left",children:"Other"},void 0,!1,{fileName:Xi,lineNumber:53,columnNumber:9},this),feature:zl.OTHER,options:C(HU,{},void 0,!1,{fileName:Xi,lineNumber:58,columnNumber:16},this)}};return C("div",{className:"image-to-image-panel",children:[C(YU,{},void 0,!1,{fileName:Xi,lineNumber:64,columnNumber:7},this),C(GU,{},void 0,!1,{fileName:Xi,lineNumber:65,columnNumber:7},this),C(zU,{},void 0,!1,{fileName:Xi,lineNumber:66,columnNumber:7},this),C(u1e,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"},void 0,!1,{fileName:Xi,lineNumber:67,columnNumber:7},this),C(s1e,{},void 0,!1,{fileName:Xi,lineNumber:71,columnNumber:7},this),C(FU,{},void 0,!1,{fileName:Xi,lineNumber:72,columnNumber:7},this),e?C(VU,{accordionInfo:t},void 0,!1,{fileName:Xi,lineNumber:74,columnNumber:9},this):null]},void 0,!0,{fileName:Xi,lineNumber:63,columnNumber:5},this)}function lge(e){return hr({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function uge(e){return hr({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function cge(e){return hr({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function fge(e){return hr({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function dge(e){return hr({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function pge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function mge(e){return hr({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function hge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function vge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function gge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function bge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function yge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function Sge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function xge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Cge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}var Nge=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ab(e,t){var n=wge(e);if(typeof n.path!="string"){var i=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof i=="string"&&i.length>0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function wge(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var i=t.split(".").pop().toLowerCase(),o=Nge.get(i);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var _ge=[".DS_Store","Thumbs.db"];function Ege(e){return Ov(this,void 0,void 0,function(){return Mv(this,function(t){return CS(e)&&Tge(e.dataTransfer)?[2,Lge(e.dataTransfer,e.type)]:Rge(e)?[2,Age(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,kge(e)]:[2,[]]})})}function Tge(e){return CS(e)}function Rge(e){return CS(e)&&CS(e.target)}function CS(e){return typeof e=="object"&&e!==null}function Age(e){return A8(e.target.files).map(function(t){return Ab(t)})}function kge(e){return Ov(this,void 0,void 0,function(){var t;return Mv(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(i){return Ab(i)})]}})})}function Lge(e,t){return Ov(this,void 0,void 0,function(){var n,i;return Mv(this,function(o){switch(o.label){case 0:return e.items?(n=A8(e.items).filter(function(u){return u.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Oge))]):[3,2];case 1:return i=o.sent(),[2,eD(qU(i))];case 2:return[2,eD(A8(e.files).map(function(u){return Ab(u)}))]}})})}function eD(e){return e.filter(function(t){return _ge.indexOf(t.name)===-1})}function A8(e){if(e===null)return[];for(var t=[],n=0;n=j)return l;var Q=g-Vu(E);if(Q<1)return E;var se=q?Os(q,0,Q).join(""):l.slice(0,Q);if(D===n)return se+E;if(q&&(Q+=se.length-Q),ih(D)){if(l.slice(Q).search(D)){var Me,ke=se;for(D.global||(D=ll(D.source,Xn(Vn.exec(D))+"g")),D.lastIndex=0;Me=D.exec(ke);)var Ie=Me.index;se=se.slice(0,Ie===n?Q:Ie)}}else if(l.indexOf(aa(D),Q)!=Q){var Qe=se.lastIndexOf(D);Qe>-1&&(se=se.slice(0,Qe))}return se+E}function DC(l){return l=Xn(l),l&&Ci.test(l)?l.replace(jn,y3):l}var PC=uf(function(l,d,g){return l+(g?" ":"")+d.toUpperCase()}),a1=py("toUpperCase");function o1(l,d,g){return l=Xn(l),d=g?n:d,d===n?b3(l)?C3(l):$v(l):l.match(d)||[]}var y2=bn(function(l,d){try{return yt(l,n,d)}catch(g){return eu(g)?g:new rn(g)}}),IC=yl(function(l,d){return Rt(d,function(g){g=Da(g),Rs(l,g,eh(l[g],l))}),l});function FC(l){var d=l==null?0:l.length,g=Pt();return l=d?Mn(l,function(E){if(typeof E[1]!="function")throw new Xa(c);return[g(E[0]),E[1]]}):[],bn(function(E){for(var D=-1;++Dbe)return[];var g=we,E=si(l,we);d=Pt(d),l-=we;for(var D=hm(E,d);++g0||d<0)?new An(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),d!==n&&(d=an(d),g=d<0?g.dropRight(-d):g.take(d-l)),g)},An.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},An.prototype.toArray=function(){return this.take(we)},gr(An.prototype,function(l,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),E=/^(?:head|last)$/.test(d),D=B[E?"take"+(d=="last"?"Right":""):d],j=E||/^find/.test(d);!D||(B.prototype[d]=function(){var q=this.__wrapped__,Q=E?[1]:arguments,se=q instanceof An,Me=Q[0],ke=se||ln(q),Ie=function(yn){var kn=D.apply(B,La([yn],Q));return E&&Qe?kn[0]:kn};ke&&g&&typeof Me=="function"&&Me.length!=1&&(se=ke=!1);var Qe=this.__chain__,vt=!!this.__actions__.length,It=j&&!Qe,mn=se&&!vt;if(!j&&ke){q=mn?q:new An(this);var $t=l.apply(q,Q);return $t.__actions__.push({func:Qm,args:[Ie],thisArg:n}),new bo($t,Qe)}return It&&mn?l.apply(this,Q):($t=this.thru(Ie),It?E?$t.value()[0]:$t.value():$t)})}),Rt(["pop","push","shift","sort","splice","unshift"],function(l){var d=ul[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",E=/^(?:pop|shift)$/.test(l);B.prototype[l]=function(){var D=arguments;if(E&&!this.__chain__){var j=this.value();return d.apply(ln(j)?j:[],D)}return this[g](function(q){return d.apply(ln(q)?q:[],D)})}}),gr(An.prototype,function(l,d){var g=B[d];if(g){var E=g.name+"";er.call(Zc,E)||(Zc[E]=[]),Zc[E].push({name:d,func:g})}}),Zc[cf(n,z).name]=[{name:"wrapper",func:n}],An.prototype.clone=zt,An.prototype.reverse=Qc,An.prototype.value=Wr,B.prototype.at=Cx,B.prototype.chain=Nx,B.prototype.commit=wx,B.prototype.next=By,B.prototype.plant=tp,B.prototype.reverse=_x,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Uy,B.prototype.first=B.prototype.head,Cd&&(B.prototype[Cd]=z0),B},$c=N3();L?((L.exports=$c)._=$c,S._=$c):Kt._=$c}).call(Ac)})(Wa,Wa.exports);const tb=Wa.exports,ive={currentImageUuid:"",images:[],areMoreImagesAvailable:!0},iU=xE({name:"gallery",initialState:ive,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const n=t.payload,i=e.images.filter(o=>o.uuid!==n);if(n===e.currentImageUuid){const o=e.images.findIndex(c=>c.uuid===n),u=Wa.exports.clamp(o,0,i.length-1);e.currentImage=i.length?i[u]:void 0,e.currentImageUuid=i.length?i[u].uuid:""}e.images=i},addImage:(e,t)=>{const n=t.payload,{uuid:i,url:o,mtime:u}=n;e.images.find(c=>c.url===o&&c.mtime===u)||(e.images.unshift(n),e.currentImageUuid=i,e.intermediateImage=void 0,e.currentImage=n,e.latest_mtime=u)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{images:t,currentImage:n}=e;if(n){const i=t.findIndex(o=>o.uuid===n.uuid);if(tb.inRange(i,0,t.length)){const o=t[i+1];e.currentImage=o,e.currentImageUuid=o.uuid}}},selectPrevImage:e=>{const{images:t,currentImage:n}=e;if(n){const i=t.findIndex(o=>o.uuid===n.uuid);if(tb.inRange(i,1,t.length+1)){const o=t[i-1];e.currentImage=o,e.currentImageUuid=o.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:i}=t.payload;if(n.length>0){const o=n.filter(u=>!e.images.find(c=>c.url===u.url&&c.mtime===u.mtime));if(e.images=e.images.concat(o).sort((u,c)=>c.mtime-u.mtime),!e.currentImage){const u=n[0];e.currentImage=u,e.currentImageUuid=u.uuid}e.latest_mtime=n[0].mtime,e.earliest_mtime=n[n.length-1].mtime}i!==void 0&&(e.areMoreImagesAvailable=i)}}}),{addImage:E6,clearIntermediateImage:NM,removeImage:ave,setCurrentImage:ove,addGalleryImages:sve,setIntermediateImage:lve,selectNextImage:aU,selectPrevImage:oU}=iU.actions,uve=iU.reducer,cve={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",hasError:!1,wasErrorSeen:!0},fve=cve,sU=xE({name:"system",initialState:fve,reducers:{setShouldDisplayInProgress:(e,t)=>{e.shouldDisplayInProgress=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Server error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:i,level:o}=t.payload,c={timestamp:n,message:i,level:o||"info"};e.log.push(c)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"}}}),{setShouldDisplayInProgress:dve,setIsProcessing:M4,addLogEntry:Ao,setShouldShowLogViewer:wM,setIsConnected:_M,setSocketId:Tye,setShouldConfirmOnDelete:lU,setOpenAccordions:pve,setSystemStatus:mve,setCurrentStatus:EM,setSystemConfig:hve,setShouldDisplayGuides:vve,processingCanceled:gve,errorOccurred:bve,errorSeen:uU}=sU.actions,yve=sU.reducer,Iu=Object.create(null);Iu.open="0";Iu.close="1";Iu.ping="2";Iu.pong="3";Iu.message="4";Iu.upgrade="5";Iu.noop="6";const D4=Object.create(null);Object.keys(Iu).forEach(e=>{D4[Iu[e]]=e});const Sve={type:"error",data:"parser error"},xve=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Cve=typeof ArrayBuffer=="function",Nve=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,cU=({type:e,data:t},n,i)=>xve&&t instanceof Blob?n?i(t):TM(t,i):Cve&&(t instanceof ArrayBuffer||Nve(t))?n?i(t):TM(new Blob([t]),i):i(Iu[e]+(t||"")),TM=(e,t)=>{const n=new FileReader;return n.onload=function(){const i=n.result.split(",")[1];t("b"+i)},n.readAsDataURL(e)},RM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,i,o=0,u,c,p,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const v=new ArrayBuffer(t),b=new Uint8Array(v);for(i=0;i>4,b[o++]=(c&15)<<4|p>>2,b[o++]=(p&3)<<6|h&63;return v},_ve=typeof ArrayBuffer=="function",fU=(e,t)=>{if(typeof e!="string")return{type:"message",data:dU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Eve(e.substring(1),t)}:D4[n]?e.length>1?{type:D4[n],data:e.substring(1)}:{type:D4[n]}:Sve},Eve=(e,t)=>{if(_ve){const n=wve(e);return dU(n,t)}else return{base64:!0,data:e}},dU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},pU=String.fromCharCode(30),Tve=(e,t)=>{const n=e.length,i=new Array(n);let o=0;e.forEach((u,c)=>{cU(u,!1,p=>{i[c]=p,++o===n&&t(i.join(pU))})})},Rve=(e,t)=>{const n=e.split(pU),i=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function hU(e,...t){return t.reduce((n,i)=>(e.hasOwnProperty(i)&&(n[i]=e[i]),n),{})}const kve=setTimeout,Lve=clearTimeout;function c3(e,t){t.useNativeTimers?(e.setTimeoutFn=kve.bind(ed),e.clearTimeoutFn=Lve.bind(ed)):(e.setTimeoutFn=setTimeout.bind(ed),e.clearTimeoutFn=clearTimeout.bind(ed))}const Ove=1.33;function Mve(e){return typeof e=="string"?Dve(e):Math.ceil((e.byteLength||e.size)*Ove)}function Dve(e){let t=0,n=0;for(let i=0,o=e.length;i=57344?n+=3:(i++,n+=4);return n}class Pve extends Error{constructor(t,n,i){super(t),this.description=n,this.context=i,this.type="TransportError"}}class vU extends Si{constructor(t){super(),this.writable=!1,c3(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,i){return super.emitReserved("error",new Pve(t,n,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=fU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const gU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),C8=64,Ive={};let AM=0,n4=0,kM;function LM(e){let t="";do t=gU[e%C8]+t,e=Math.floor(e/C8);while(e>0);return t}function bU(){const e=LM(+new Date);return e!==kM?(AM=0,kM=e):e+"."+LM(AM++)}for(;n4{this.readyState="paused",t()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||n()})),this.writable||(i++,this.once("drain",function(){--i||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Rve(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Tve(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=bU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=yU(t),u=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(u?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Ou(this.uri(),t)}doWrite(t,n){const i=this.request({method:"POST",data:t});i.on("success",n),i.on("error",(o,u)=>{this.onError("xhr post error",o,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,i)=>{this.onError("xhr poll error",n,i)}),this.pollXhr=t}}class Ou extends Si{constructor(t,n){super(),c3(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=hU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new xU(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Ou.requestsCount++,Ou.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Bve,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ou.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Ou.requestsCount=0;Ou.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",OM);else if(typeof addEventListener=="function"){const e="onpagehide"in ed?"pagehide":"unload";addEventListener(e,OM,!1)}}function OM(){for(let e in Ou.requests)Ou.requests.hasOwnProperty(e)&&Ou.requests[e].abort()}const jve=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),r4=ed.WebSocket||ed.MozWebSocket,MM=!0,Vve="arraybuffer",DM=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Hve extends vU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,i=DM?{}:hU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=MM&&!DM?n?new r4(t,n):new r4(t):new r4(t,n,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||Vve,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const c={};try{MM&&this.ws.send(u)}catch{}o&&jve(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=bU()),this.supportsBinary||(t.b64=1);const o=yU(t),u=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(u?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!r4}}const Wve={websocket:Hve,polling:$ve},Gve=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yve=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function N8(e){const t=e,n=e.indexOf("["),i=e.indexOf("]");n!=-1&&i!=-1&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));let o=Gve.exec(e||""),u={},c=14;for(;c--;)u[Yve[c]]=o[c]||"";return n!=-1&&i!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=qve(u,u.path),u.queryKey=Zve(u,u.query),u}function qve(e,t){const n=/\/{2,9}/g,i=t.replace(n,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&i.splice(0,1),t.substr(t.length-1,1)=="/"&&i.splice(i.length-1,1),i}function Zve(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,u){o&&(n[o]=u)}),n}class Zf extends Si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=N8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=N8(n.host).host),c3(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=Fve(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=mU,n.transport=t,this.id&&(n.sid=this.id);const i=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Wve[t](i)}open(){let t;if(this.opts.rememberUpgrade&&Zf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),i=!1;Zf.priorWebsocketSuccess=!1;const o=()=>{i||(n.send([{type:"ping",data:"probe"}]),n.once("packet",x=>{if(!i)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Zf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(b(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const N=new Error("probe error");N.transport=n.name,this.emitReserved("upgradeError",N)}}))};function u(){i||(i=!0,b(),n.close(),n=null)}const c=x=>{const N=new Error("probe error: "+x);N.transport=n.name,u(),this.emitReserved("upgradeError",N)};function p(){c("transport closed")}function h(){c("socket closed")}function v(x){n&&x.name!==n.name&&u()}const b=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",p),this.off("close",h),this.off("upgrading",v)};n.once("open",o),n.once("error",c),n.once("close",p),this.once("close",h),this.once("upgrading",v),n.open()}onOpen(){if(this.readyState="open",Zf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let i=0;i0&&n>this.maxPayload)return this.writeBuffer.slice(0,i);n+=2}return this.writeBuffer}write(t,n,i){return this.sendPacket("message",t,n,i),this}send(t,n,i){return this.sendPacket("message",t,n,i),this}sendPacket(t,n,i,o){if(typeof n=="function"&&(o=n,n=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const u={type:t,data:n,options:i};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},i=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}onError(t){Zf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let i=0;const o=t.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,CU=Object.prototype.toString,Jve=typeof Blob=="function"||typeof Blob<"u"&&CU.call(Blob)==="[object BlobConstructor]",e0e=typeof File=="function"||typeof File<"u"&&CU.call(File)==="[object FileConstructor]";function AE(e){return Xve&&(e instanceof ArrayBuffer||Qve(e))||Jve&&e instanceof Blob||e0e&&e instanceof File}function P4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,i=e.length;n=0&&e.num0;case qn.ACK:case qn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class a0e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=n0e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const o0e=Object.freeze(Object.defineProperty({__proto__:null,protocol:r0e,get PacketType(){return qn},Encoder:i0e,Decoder:kE},Symbol.toStringTag,{value:"Module"}));function Fl(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const s0e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class NU extends Si{constructor(t,n,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Fl(t,"open",this.onopen.bind(this)),Fl(t,"packet",this.onpacket.bind(this)),Fl(t,"error",this.onerror.bind(this)),Fl(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(s0e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const i={type:qn.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,p=n.pop();this._registerAckCallback(c,p),i.id=c}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){const i=this.flags.timeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u{this.io.clearTimeoutFn(o),n.apply(this,[null,...u])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:qn.CONNECT,data:t})}):this.packet({type:qn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case qn.CONNECT:if(t.data&&t.data.sid){const o=t.data.sid;this.onconnect(o)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case qn.EVENT:case qn.BINARY_EVENT:this.onevent(t);break;case qn.ACK:case qn.BINARY_ACK:this.onack(t);break;case qn.DISCONNECT:this.ondisconnect();break;case qn.CONNECT_ERROR:this.destroy();const i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const i of n)i.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let i=!1;return function(...o){i||(i=!0,n.packet({type:qn.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:qn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let i=0;i0&&e.jitter<=1?e.jitter:0,this.attempts=0}zv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};zv.prototype.reset=function(){this.attempts=0};zv.prototype.setMin=function(e){this.ms=e};zv.prototype.setMax=function(e){this.max=e};zv.prototype.setJitter=function(e){this.jitter=e};class E8 extends Si{constructor(t,n){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,c3(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((i=n.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new zv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||o0e;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Zf(this.uri,this.opts);const n=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Fl(n,"open",function(){i.onopen(),t&&t()}),u=Fl(n,"error",c=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",c),t?t(c):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const c=this._timeout;c===0&&o();const p=this.setTimeoutFn(()=>{o(),n.close(),n.emit("error",new Error("timeout"))},c);this.opts.autoUnref&&p.unref(),this.subs.push(function(){clearTimeout(p)})}return this.subs.push(o),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Fl(t,"ping",this.onping.bind(this)),Fl(t,"data",this.ondata.bind(this)),Fl(t,"error",this.onerror.bind(this)),Fl(t,"close",this.onclose.bind(this)),Fl(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch{this.onclose("parse error")}}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,n){let i=this.nsps[t];return i||(i=new NU(this,t,n),this.nsps[t]=i),i}_destroy(t){const n=Object.keys(this.nsps);for(const i of n)if(this.nsps[i].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let i=0;it()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ag={};function I4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Kve(e,t.path||"/socket.io"),i=n.source,o=n.id,u=n.path,c=ag[o]&&u in ag[o].nsps,p=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return p?h=new E8(i,t):(ag[o]||(ag[o]=new E8(i,t)),h=ag[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(I4,{Manager:E8,Socket:NU,io:I4,connect:I4});let i4;const l0e=new Uint8Array(16);function u0e(){if(!i4&&(i4=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i4))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i4(l0e)}const ya=[];for(let e=0;e<256;++e)ya.push((e+256).toString(16).slice(1));function c0e(e,t=0){return(ya[e[t+0]]+ya[e[t+1]]+ya[e[t+2]]+ya[e[t+3]]+"-"+ya[e[t+4]]+ya[e[t+5]]+"-"+ya[e[t+6]]+ya[e[t+7]]+"-"+ya[e[t+8]]+ya[e[t+9]]+"-"+ya[e[t+10]]+ya[e[t+11]]+ya[e[t+12]]+ya[e[t+13]]+ya[e[t+14]]+ya[e[t+15]]).toLowerCase()}const f0e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PM={randomUUID:f0e};function a4(e,t,n){if(PM.randomUUID&&!t&&!e)return PM.randomUUID();e=e||{};const i=e.random||(e.rng||u0e)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=i[o];return t}return c0e(i)}var d0e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,p0e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,m0e=/[^-+\dA-Z]/g;function ko(e,t,n,i){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(IM[t]||t||IM.default);var o=t.slice(0,4);(o==="UTC:"||o==="GMT:")&&(t=t.slice(4),n=!0,o==="GMT:"&&(i=!0));var u=function(){return n?"getUTC":"get"},c=function(){return e[u()+"Date"]()},p=function(){return e[u()+"Day"]()},h=function(){return e[u()+"Month"]()},v=function(){return e[u()+"FullYear"]()},b=function(){return e[u()+"Hours"]()},x=function(){return e[u()+"Minutes"]()},N=function(){return e[u()+"Seconds"]()},_=function(){return e[u()+"Milliseconds"]()},T=function(){return n?0:e.getTimezoneOffset()},A=function(){return h0e(e)},M=function(){return v0e(e)},z={d:function(){return c()},dd:function(){return as(c())},ddd:function(){return To.dayNames[p()]},DDD:function(){return FM({y:v(),m:h(),d:c(),_:u(),dayName:To.dayNames[p()],short:!0})},dddd:function(){return To.dayNames[p()+7]},DDDD:function(){return FM({y:v(),m:h(),d:c(),_:u(),dayName:To.dayNames[p()+7]})},m:function(){return h()+1},mm:function(){return as(h()+1)},mmm:function(){return To.monthNames[h()]},mmmm:function(){return To.monthNames[h()+12]},yy:function(){return String(v()).slice(2)},yyyy:function(){return as(v(),4)},h:function(){return b()%12||12},hh:function(){return as(b()%12||12)},H:function(){return b()},HH:function(){return as(b())},M:function(){return x()},MM:function(){return as(x())},s:function(){return N()},ss:function(){return as(N())},l:function(){return as(_(),3)},L:function(){return as(Math.floor(_()/10))},t:function(){return b()<12?To.timeNames[0]:To.timeNames[1]},tt:function(){return b()<12?To.timeNames[2]:To.timeNames[3]},T:function(){return b()<12?To.timeNames[4]:To.timeNames[5]},TT:function(){return b()<12?To.timeNames[6]:To.timeNames[7]},Z:function(){return i?"GMT":n?"UTC":g0e(e)},o:function(){return(T()>0?"-":"+")+as(Math.floor(Math.abs(T())/60)*100+Math.abs(T())%60,4)},p:function(){return(T()>0?"-":"+")+as(Math.floor(Math.abs(T())/60),2)+":"+as(Math.floor(Math.abs(T())%60),2)},S:function(){return["th","st","nd","rd"][c()%10>3?0:(c()%100-c()%10!=10)*c()%10]},W:function(){return A()},WW:function(){return as(A())},N:function(){return M()}};return t.replace(d0e,function(P){return P in z?z[P]():P.slice(1,P.length-1)})}var IM={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},To={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},as=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},FM=function(t){var n=t.y,i=t.m,o=t.d,u=t._,c=t.dayName,p=t.short,h=p===void 0?!1:p,v=new Date,b=new Date;b.setDate(b[u+"Date"]()-1);var x=new Date;x.setDate(x[u+"Date"]()+1);var N=function(){return v[u+"Date"]()},_=function(){return v[u+"Month"]()},T=function(){return v[u+"FullYear"]()},A=function(){return b[u+"Date"]()},M=function(){return b[u+"Month"]()},z=function(){return b[u+"FullYear"]()},P=function(){return x[u+"Date"]()},I=function(){return x[u+"Month"]()},F=function(){return x[u+"FullYear"]()};return T()===n&&_()===i&&N()===o?h?"Tdy":"Today":z()===n&&M()===i&&A()===o?h?"Ysd":"Yesterday":F()===n&&I()===i&&P()===o?h?"Tmw":"Tomorrow":c},h0e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var i=new Date(n.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var o=n.getTimezoneOffset()-i.getTimezoneOffset();n.setHours(n.getHours()-o);var u=(n-i)/(864e5*7);return 1+Math.floor(u)},v0e=function(t){var n=t.getDay();return n===0&&(n=7),n},g0e=function(t){return(String(t).match(p0e)||[""]).pop().replace(m0e,"").replace(/GMT\+0000/g,"UTC")};const T8=fo("socketio/generateImage"),b0e=fo("socketio/runESRGAN"),y0e=fo("socketio/runFacetool"),S0e=fo("socketio/deleteImage"),wU=fo("socketio/requestImages"),x0e=fo("socketio/requestNewImages"),C0e=fo("socketio/cancelProcessing"),N0e=fo("socketio/uploadInitialImage");fo("socketio/uploadMaskImage");const w0e=fo("socketio/requestSystemConfig"),_0e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(_M(!0)),t(EM("Connected")),n().gallery.latest_mtime?t(x0e()):t(wU())}catch(i){console.error(i)}},onDisconnect:()=>{try{t(_M(!1)),t(EM("Disconnected")),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(i){console.error(i)}},onGenerationResult:i=>{try{const{url:o,mtime:u,metadata:c}=i,p=a4();t(E6({uuid:p,url:o,mtime:u,metadata:c})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Image generated: ${o}`}))}catch(o){console.error(o)}},onIntermediateResult:i=>{try{const o=a4(),{url:u,metadata:c,mtime:p}=i;t(lve({uuid:o,url:u,mtime:p,metadata:c})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Intermediate image generated: ${u}`}))}catch(o){console.error(o)}},onPostprocessingResult:i=>{try{const{url:o,metadata:u,mtime:c}=i;t(E6({uuid:a4(),url:o,mtime:c,metadata:u})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Postprocessed: ${o}`}))}catch(o){console.error(o)}},onProgressUpdate:i=>{try{t(M4(!0)),t(mve(i))}catch(o){console.error(o)}},onError:i=>{const{message:o,additionalData:u}=i;try{t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Server error: ${o}`,level:"error"})),t(bve()),t(NM())}catch(c){console.error(c)}},onGalleryImages:i=>{const{images:o,areMoreImagesAvailable:u}=i,c=o.map(p=>{const{url:h,metadata:v,mtime:b}=p;return{uuid:a4(),url:h,mtime:b,metadata:v}});t(sve({images:c,areMoreImagesAvailable:u})),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Loaded ${o.length} images`}))},onProcessingCanceled:()=>{t(gve());const{intermediateImage:i}=n().gallery;i&&(t(E6(i)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Intermediate image saved: ${i.url}`})),t(NM())),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:i=>{const{url:o,uuid:u}=i;t(ave(u));const{initialImagePath:c,maskPath:p}=n().options;c===o&&t(Tv("")),p===o&&t(x8("")),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Image deleted: ${o}`}))},onInitialImageUploaded:i=>{const{url:o}=i;t(Tv(o)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Initial image uploaded: ${o}`}))},onMaskImageUploaded:i=>{const{url:o}=i;t(x8(o)),t(Ao({timestamp:ko(new Date,"isoDateTime"),message:`Mask image uploaded: ${o}`}))},onSystemConfig:i=>{t(hve(i))}}},E0e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],T0e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],R0e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],A0e=[{key:"2x",value:2},{key:"4x",value:4}],LE=0,OE=4294967295,k0e=["gfpgan","codeformer"],_U=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),L0e=(e,t)=>{const{prompt:n,iterations:i,steps:o,cfgScale:u,threshold:c,perlin:p,height:h,width:v,sampler:b,seed:x,seamless:N,hiresFix:_,shouldUseInitImage:T,img2imgStrength:A,initialImagePath:M,maskPath:z,shouldFitToWidthHeight:P,shouldGenerateVariations:I,variationAmount:F,seedWeights:$,shouldRunESRGAN:Y,upscalingLevel:Z,upscalingStrength:ue,shouldRunFacetool:ce,facetoolStrength:le,codeformerFidelity:ge,facetoolType:Ye,shouldRandomizeSeed:re}=e,{shouldDisplayInProgress:ie}=t,Ce={prompt:n,iterations:i,steps:o,cfg_scale:u,threshold:c,perlin:p,height:h,width:v,sampler_name:b,seed:x,seamless:N,hires_fix:_,progress_images:ie};Ce.seed=re?_U(LE,OE):x,T&&(Ce.init_img=M,Ce.strength=A,Ce.fit=P,z&&(Ce.init_mask=z)),I?(Ce.variation_amount=F,$&&(Ce.with_variations=Whe($))):Ce.variation_amount=0;let xe=!1,K=!1;return Y&&(xe={level:Z,strength:ue}),ce&&(K={type:Ye,strength:le},Ye==="codeformer"&&(K.codeformer_fidelity=ge)),{generationParameters:Ce,esrganParameters:xe,facetoolParameters:K}};var T6=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function R6(e,t,n,i){e.addEventListener?e.addEventListener(t,n,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function EU(e,t){for(var n=t.slice(0,t.length-1),i=0;i=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function O0e(e,t){for(var n=e.length>=t.length?e:t,i=e.length>=t.length?t:e,o=!0,u=0;u=0&&Pr.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Pr.splice(0,Pr.length),(t===93||t===224)&&(t=91),t in xa){xa[t]=!1;for(var i in ud)ud[i]===t&&(us[i]=!1)}}function z0e(e){if(typeof e>"u")Object.keys(vi).forEach(function(c){return delete vi[c]});else if(Array.isArray(e))e.forEach(function(c){c.key&&A6(c)});else if(typeof e=="object")e.key&&A6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?EU(ud,v):[];vi[N]=vi[N].filter(function(T){var A=o?T.method===o:!0;return!(A&&T.scope===i&&O0e(T.mods,_))})}})};function BM(e,t,n,i){if(t.element===i){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var u in xa)Object.prototype.hasOwnProperty.call(xa,u)&&(!xa[u]&&t.mods.indexOf(+u)>-1||xa[u]&&t.mods.indexOf(+u)===-1)&&(o=!1);(t.mods.length===0&&!xa[16]&&!xa[18]&&!xa[17]&&!xa[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function UM(e,t){var n=vi["*"],i=e.keyCode||e.which||e.charCode;if(!!us.filter.call(this,e)){if((i===93||i===224)&&(i=91),Pr.indexOf(i)===-1&&i!==229&&Pr.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(T){var A=R8[T];e[T]&&Pr.indexOf(A)===-1?Pr.push(A):!e[T]&&Pr.indexOf(A)>-1?Pr.splice(Pr.indexOf(A),1):T==="metaKey"&&e[T]&&Pr.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Pr=Pr.slice(Pr.indexOf(A))))}),i in xa){xa[i]=!0;for(var o in ud)ud[o]===i&&(us[o]=!0);if(!n)return}for(var u in xa)Object.prototype.hasOwnProperty.call(xa,u)&&(xa[u]=e[R8[u]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Pr.indexOf(17)===-1&&Pr.push(17),Pr.indexOf(18)===-1&&Pr.push(18),xa[17]=!0,xa[18]=!0);var c=nb();if(n)for(var p=0;p-1}function us(e,t,n){Pr=[];var i=TU(e),o=[],u="all",c=document,p=0,h=!1,v=!0,b="+",x=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(u=t.scope),t.element&&(c=t.element),t.keyup&&(h=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(x=t.capture),typeof t.splitKey=="string"&&(b=t.splitKey)),typeof t=="string"&&(u=t);p1&&(o=EU(ud,e)),e=e[e.length-1],e=e==="*"?"*":f3(e),e in vi||(vi[e]=[]),vi[e].push({keyup:h,keydown:v,scope:u,mods:o,shortcut:i[p],method:n,key:i[p],splitKey:b,element:c});typeof c<"u"&&!B0e(c)&&window&&(AU.push(c),R6(c,"keydown",function(N){UM(N,c)},x),zM||(zM=!0,R6(window,"focus",function(){Pr=[]},x)),R6(c,"keyup",function(N){UM(N,c),F0e(N)},x))}function U0e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(vi).forEach(function(n){var i=vi[n].find(function(o){return o.scope===t&&o.shortcut===e});i&&i.method&&i.method()})}var k6={setScope:kU,getScope:nb,deleteScope:I0e,getPressedKeyCodes:M0e,isPressed:P0e,filter:D0e,trigger:U0e,unbind:z0e,keyMap:ME,modifier:ud,modifierMap:R8};for(var L6 in k6)Object.prototype.hasOwnProperty.call(k6,L6)&&(us[L6]=k6[L6]);if(typeof window<"u"){var $0e=window.hotkeys;us.noConflict=function(e){return e&&window.hotkeys===us&&(window.hotkeys=$0e),us},window.hotkeys=us}us.filter=function(){return!0};var LU=function(t,n){var i=t.target,o=i&&i.tagName;return Boolean(o&&n&&n.includes(o))},j0e=function(t){return LU(t,["INPUT","TEXTAREA","SELECT"])};function ii(e,t,n,i){n instanceof Array&&(i=n,n=void 0);var o=n||{},u=o.enableOnTags,c=o.filter,p=o.keyup,h=o.keydown,v=o.filterPreventDefault,b=v===void 0?!0:v,x=o.enabled,N=x===void 0?!0:x,_=o.enableOnContentEditable,T=_===void 0?!1:_,A=k.exports.useRef(null),M=k.exports.useCallback(function(z,P){var I,F;return c&&!c(z)?!b:j0e(z)&&!LU(z,u)||(I=z.target)!=null&&I.isContentEditable&&!T?!0:A.current===null||document.activeElement===A.current||(F=A.current)!=null&&F.contains(document.activeElement)?(t(z,P),!0):!1},i?[A,u,c].concat(i):[A,u,c]);return k.exports.useEffect(function(){if(!N){us.unbind(e,M);return}return p&&h!==!0&&(n.keydown=!1),us(e,n||{},M),function(){return us.unbind(e,M)}},[M,e,N]),A}us.isPressed;var O6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/InpaintingWIP.tsx";function V0e(){return C("div",{className:"work-in-progress inpainting-work-in-progress",children:[C("h1",{children:"Inpainting"},void 0,!1,{fileName:O6,lineNumber:6,columnNumber:7},this),C("p",{children:"Inpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."},void 0,!1,{fileName:O6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:O6,lineNumber:5,columnNumber:5},this)}var M6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/NodesWIP.tsx";function H0e(){return C("div",{className:"work-in-progress nodes-work-in-progress",children:[C("h1",{children:"Nodes"},void 0,!1,{fileName:M6,lineNumber:6,columnNumber:7},this),C("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."},void 0,!1,{fileName:M6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:M6,lineNumber:5,columnNumber:5},this)}var D6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/OutpaintingWIP.tsx";function W0e(){return C("div",{className:"work-in-progress outpainting-work-in-progress",children:[C("h1",{children:"Outpainting"},void 0,!1,{fileName:D6,lineNumber:6,columnNumber:7},this),C("p",{children:"Outpainting is available as a part of the Invoke AI Command Line Interface. A dedicated WebUI interface will be released in the near future."},void 0,!1,{fileName:D6,lineNumber:7,columnNumber:7},this)]},void 0,!0,{fileName:D6,lineNumber:5,columnNumber:5},this)}var s4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/WorkInProgress/PostProcessingWIP.tsx";const G0e=()=>C("div",{className:"work-in-progress post-processing-work-in-progress",children:[C("h1",{children:"Post Processing"},void 0,!1,{fileName:s4,lineNumber:6,columnNumber:7},void 0),C("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image tab. A dedicated UI will be released soon."},void 0,!1,{fileName:s4,lineNumber:7,columnNumber:7},void 0),C("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen, High Resolution Fixing and more."},void 0,!1,{fileName:s4,lineNumber:13,columnNumber:7},void 0)]},void 0,!0,{fileName:s4,lineNumber:5,columnNumber:5},void 0);var $M="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/ImageToImageIcon.tsx";const Y0e=kv({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:C("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"},void 0,!1,{fileName:$M,lineNumber:8,columnNumber:7},void 0)},void 0,!1,{fileName:$M,lineNumber:7,columnNumber:5},void 0)});var q0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/InpaintIcon.tsx";const Z0e=kv({displayName:"InpaintIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593C0,768.593 0,2774.71 0,2774.71C0,3025.98 203.999,3229.98 455.269,3229.98L3088.04,3229.98C3339.31,3229.98 3543.31,3025.98 3543.31,2774.71C3543.31,2774.71 3543.31,768.593 3543.31,768.593ZM3446.56,2252.63L3446.56,768.593C3446.56,570.718 3285.91,410.068 3088.04,410.068C3088.04,410.068 455.269,410.068 455.269,410.068C257.394,410.068 96.745,570.718 96.745,768.593L96.745,2061.49L988.344,1051.01L1326.63,1423.12C1281.74,1438.3 1227.39,1454.93 1158.26,1480.89C995.738,1541.9 944.356,1613.28 911.834,1718.7C884.979,1805.76 875.814,1922.93 811.322,2093.5C763.918,2218.87 765.18,2304.83 790.606,2364.87C817.014,2427.22 869.858,2467.73 941.71,2493.83C1023.86,2523.67 1134.43,2534.25 1242.45,2557.97C1365.72,2585.04 1455.23,2643.2 1532.76,2665.96C1587.03,2681.89 1637.04,2683.6 1686.56,2663.56C1731.54,2645.36 1777.95,2607.64 1825.43,2535.92C1874.9,2461.2 1979.98,2369.94 2102.8,2276.91L2241.64,2429.63L2739.91,1850.53C2754.47,1841.35 2767.47,1833.12 2778.66,1825.94C2832.6,1791.35 2866.82,1742.41 2884.38,1682.61L2898.06,1666.72L3446.56,2252.63ZM1680.71,2559.9C1666.7,2570.37 1652.86,2577.22 1638.81,2580.95L1610.62,2588.45L1625.61,2644.82L1653.8,2637.33C1674.48,2631.83 1695.02,2622.04 1715.64,2606.61L1739,2589.14L1704.06,2542.43L1680.71,2559.9ZM1541.62,2570.42C1524.94,2564.58 1507.63,2557.37 1489.49,2549.48L1462.75,2537.84L1439.48,2591.33L1466.22,2602.97C1485.74,2611.46 1504.38,2619.18 1522.33,2625.47L1549.86,2635.12L1569.15,2580.07L1541.62,2570.42ZM1381.21,2503.1C1363.08,2496.04 1344.17,2489.24 1324.38,2483.03L1296.55,2474.29L1279.07,2529.94L1306.9,2538.68C1325.41,2544.49 1343.09,2550.86 1360.05,2557.46L1387.23,2568.04L1408.39,2513.68L1381.21,2503.1ZM1788.46,2430.83C1773.91,2447.61 1761.19,2463.86 1750.55,2479.44L1734.09,2503.52L1782.25,2536.43L1798.71,2512.35C1808.2,2498.46 1819.56,2484 1832.53,2469.04L1851.64,2447.01L1807.57,2408.79L1788.46,2430.83ZM1262.54,2466.49C1243.17,2462.24 1223.71,2458.43 1204.35,2454.87L1175.67,2449.6L1165.12,2506.97L1193.81,2512.24C1212.52,2515.68 1231.32,2519.35 1250.03,2523.46L1278.52,2529.72L1291.03,2472.74L1262.54,2466.49ZM1089.5,2434.66C1070.28,2431.1 1051.6,2427.35 1033.72,2423.15L1005.32,2416.49L992.002,2473.28L1020.4,2479.94C1039.14,2484.34 1058.71,2488.28 1078.86,2492.02L1107.54,2497.34L1118.18,2439.99L1089.5,2434.66ZM932.182,2386.94C917.545,2378.53 904.788,2368.71 894.532,2356.8L875.504,2334.69L831.294,2372.75L850.322,2394.85C864.755,2411.62 882.513,2425.67 903.11,2437.51L928.396,2452.05L957.469,2401.48L932.182,2386.94ZM1917.04,2306.1C1901.59,2319.37 1886.77,2332.5 1872.67,2345.44L1851.18,2365.17L1890.64,2408.14L1912.12,2388.41C1925.76,2375.89 1940.1,2363.19 1955.04,2350.36L1977.17,2331.36L1939.17,2287.1L1917.04,2306.1ZM866.485,2267.79C866.715,2251.85 868.706,2234.39 872.54,2215.21L878.257,2186.61L821.055,2175.17L815.338,2203.77C810.733,2226.81 808.434,2247.8 808.158,2266.94L807.737,2296.11L866.064,2296.95L866.485,2267.79ZM2055.08,2195.63C2039.24,2207.6 2023.66,2219.55 2008.43,2231.46L1985.45,2249.43L2021.38,2295.38L2044.36,2277.42C2059.34,2265.7 2074.66,2253.95 2090.23,2242.18L2113.51,2224.61L2078.35,2178.06L2055.08,2195.63ZM2197.62,2092.3C2181.57,2103.52 2165.6,2114.82 2149.74,2126.16L2126.02,2143.12L2159.95,2190.57L2183.67,2173.61C2199.36,2162.38 2215.18,2151.21 2231.05,2140.1L2254.95,2123.38L2221.52,2075.58L2197.62,2092.3ZM905.788,2108.14C912.858,2088.7 919.236,2069.96 925.03,2051.88L933.93,2024.1L878.378,2006.3L869.478,2034.08C863.905,2051.47 857.769,2069.5 850.968,2088.2L840.998,2115.61L895.817,2135.55L905.788,2108.14ZM2342.87,1993.45C2326.76,2004.15 2310.52,2015.01 2294.22,2026L2270.04,2042.31L2302.65,2090.67L2326.83,2074.37C2343.01,2063.45 2359.14,2052.67 2375.14,2042.04L2399.44,2025.91L2367.17,1977.31L2342.87,1993.45ZM2489.92,1897.67C2473.88,1907.94 2457.46,1918.5 2440.74,1929.32L2416.26,1945.16L2447.95,1994.14L2472.44,1978.29C2489.07,1967.53 2505.41,1957.02 2521.37,1946.8L2545.93,1931.07L2514.48,1881.94L2489.92,1897.67ZM956.972,1937.49C961.849,1917.31 966.133,1898.15 970.079,1879.93L976.253,1851.43L919.241,1839.08L913.067,1867.59C909.215,1885.38 905.033,1904.08 900.271,1923.79L893.42,1952.13L950.121,1965.84L956.972,1937.49ZM2638.01,1803.95C2622.5,1813.69 2605.98,1824.08 2588.59,1835.04L2563.91,1850.59L2595.02,1899.94L2619.69,1884.38C2637.05,1873.44 2653.55,1863.08 2669.03,1853.35L2693.73,1837.84L2662.71,1788.44L2638.01,1803.95ZM2769.59,1708.14C2760.26,1721.07 2748.81,1732.54 2735.03,1742.4L2711.31,1759.37L2745.25,1806.81L2768.97,1789.84C2788.08,1776.17 2803.93,1760.22 2816.88,1742.3L2833.95,1718.65L2786.67,1684.5L2769.59,1708.14ZM995.304,1767.43C1000.24,1748.86 1005.64,1731.66 1012.23,1715.62L1023.31,1688.64L969.359,1666.47L958.273,1693.45C950.767,1711.72 944.551,1731.29 938.928,1752.44L931.436,1780.63L987.812,1795.62L995.304,1767.43ZM1071.42,1633.09C1083.85,1622.63 1098.26,1612.75 1115.07,1603.23L1140.45,1588.86L1111.71,1538.1L1086.33,1552.47C1066.11,1563.92 1048.82,1575.88 1033.86,1588.46L1011.55,1607.24L1049.11,1651.87L1071.42,1633.09ZM2804.87,1559.28C2805.5,1578.06 2804.95,1596.1 2803,1613.27L2799.72,1642.25L2857.68,1648.81L2860.97,1619.83C2863.22,1599.96 2863.9,1579.07 2863.17,1557.33L2862.2,1528.18L2803.9,1530.12L2804.87,1559.28ZM1217.5,1558.88C1236.87,1551.88 1254.98,1545.61 1271.98,1539.88L1299.62,1530.55L1280.97,1475.28L1253.33,1484.6C1235.96,1490.46 1217.45,1496.87 1197.66,1504.02L1170.23,1513.94L1190.07,1568.8L1217.5,1558.88ZM1383.15,1502.63C1403.9,1495.17 1422.61,1487.67 1439.93,1479.27L1466.18,1466.54L1440.73,1414.06L1414.48,1426.78C1398.91,1434.33 1382.06,1441.03 1363.41,1447.74L1335.96,1457.62L1355.71,1512.51L1383.15,1502.63ZM2777.41,1393.4C2782.33,1412.11 2786.73,1430.56 2790.49,1448.67L2796.42,1477.23L2853.54,1465.37L2847.6,1436.81C2843.64,1417.72 2839.01,1398.28 2833.83,1378.57L2826.41,1350.36L2770,1365.19L2777.41,1393.4ZM1541.19,1401.64C1553.52,1387.35 1565.77,1370.94 1578.31,1351.79L1594.28,1327.39L1545.48,1295.44L1529.5,1319.84C1518.52,1336.62 1507.83,1351.02 1497.03,1363.53L1477.97,1385.61L1522.14,1423.72L1541.19,1401.64ZM2725.02,1229.27C2731.61,1247.45 2738.01,1265.61 2744.12,1283.7L2753.45,1311.33L2808.72,1292.66L2799.38,1265.03C2793.13,1246.53 2786.6,1227.96 2779.85,1209.37L2769.9,1181.95L2715.07,1201.86L2725.02,1229.27ZM1636.99,1247.12C1644.26,1232.56 1651.77,1217.04 1659.58,1200.45C1660.59,1198.3 1661.61,1196.15 1662.61,1194.02L1675.08,1167.65L1622.34,1142.72L1609.88,1169.09C1608.86,1171.25 1607.83,1173.42 1606.81,1175.59C1599.2,1191.75 1591.88,1206.88 1584.8,1221.06L1571.77,1247.16L1623.96,1273.21L1636.99,1247.12ZM2251.58,766.326C2320.04,672.986 2430.48,612.355 2554.96,612.355C2762.48,612.355 2930.95,780.83 2930.95,988.344C2930.95,1087.56 2892.44,1177.85 2829.58,1245.06C2804.67,1171.95 2775.67,1097.93 2747.18,1026.98C2699.54,908.311 2654.38,849.115 2602.9,816.501C2565.59,792.868 2523.88,781.903 2471.8,777.274C2416.47,772.355 2346.53,774.829 2251.58,766.326ZM2662.3,1066.95C2669.46,1084.79 2676.66,1102.83 2683.81,1120.98L2694.51,1148.12L2748.78,1126.72L2738.08,1099.59C2730.88,1081.32 2723.64,1063.18 2716.44,1045.23L2705.58,1018.16L2651.44,1039.88L2662.3,1066.95ZM1713.81,1090.65C1723.08,1073.13 1732.27,1056.54 1741.52,1040.87L1756.33,1015.74L1706.08,986.113L1691.27,1011.24C1681.59,1027.65 1671.95,1045.03 1662.25,1063.39L1648.61,1089.17L1700.18,1116.44L1713.81,1090.65ZM2584.06,922.671C2594.47,934.345 2604.5,948.467 2614.55,965.492L2629.38,990.608L2679.62,960.949L2664.79,935.834C2652.56,915.134 2640.26,898.042 2627.6,883.849L2608.19,862.079L2564.65,900.901L2584.06,922.671ZM1805.33,949.853C1817.51,935.859 1830.16,923.259 1843.5,912.06L1865.85,893.314L1828.36,848.625L1806.01,867.372C1790.4,880.469 1775.59,895.178 1761.34,911.545L1742.18,933.541L1786.17,971.849L1805.33,949.853ZM2446.47,869.303C2466.17,870.516 2483.98,872.335 2500.35,875.649L2528.94,881.438L2540.51,824.265L2511.93,818.476C2493.13,814.67 2472.68,812.474 2450.05,811.08L2420.94,809.287L2417.35,867.51L2446.47,869.303ZM1935.15,861.305C1951.44,856.036 1968.78,851.999 1987.35,849.144L2016.18,844.713L2007.32,787.057L1978.49,791.488C1956.68,794.84 1936.32,799.616 1917.19,805.802L1889.44,814.778L1907.39,870.28L1935.15,861.305ZM2271.35,861.832C2292.28,863.33 2311.95,864.351 2330.47,865.114L2359.61,866.316L2362.01,808.032L2332.87,806.83C2314.9,806.09 2295.82,805.1 2275.51,803.648L2246.42,801.567L2242.26,859.751L2271.35,861.832ZM2097.81,844.858C2115.7,845.771 2134.46,847.337 2154.17,849.543L2183.16,852.787L2189.65,794.816L2160.66,791.572C2139.72,789.228 2119.79,787.57 2100.78,786.6L2071.65,785.114L2068.68,843.372L2097.81,844.858Z"},void 0,!1,{fileName:q0e,lineNumber:7,columnNumber:5},void 0)});var K0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/NodesIcon.tsx";const X0e=kv({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"},void 0,!1,{fileName:K0e,lineNumber:7,columnNumber:5},void 0)});var Q0e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/OutpaintIcon.tsx";const J0e=kv({displayName:"OutpaintIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,766.352C3543.31,516.705 3340.63,314.024 3090.98,314.024L452.328,314.024C202.681,314.024 0,516.705 0,766.352L0,2776.95C0,3026.6 202.681,3229.28 452.328,3229.28C452.328,3229.28 3090.98,3229.28 3090.98,3229.28C3340.63,3229.28 3543.31,3026.6 3543.31,2776.95C3543.31,2776.95 3543.31,766.352 3543.31,766.352ZM3454.26,766.352L3454.26,2776.95C3454.26,2977.46 3291.48,3140.24 3090.98,3140.24L452.328,3140.24C251.825,3140.24 89.043,2977.46 89.043,2776.95C89.043,2776.95 89.043,766.352 89.043,766.352C89.043,565.849 251.825,403.067 452.328,403.067C452.328,403.067 3090.98,403.067 3090.98,403.067C3291.48,403.067 3454.26,565.849 3454.26,766.352ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265Z"},void 0,!1,{fileName:Q0e,lineNumber:7,columnNumber:5},void 0)});var e1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/PostprocessingIcon.tsx";const t1e=kv({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:C("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"},void 0,!1,{fileName:e1e,lineNumber:7,columnNumber:5},void 0)});var jM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/icons/TextToImageIcon.tsx";const n1e=kv({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:C("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:C("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"},void 0,!1,{fileName:jM,lineNumber:13,columnNumber:7},void 0)},void 0,!1,{fileName:jM,lineNumber:7,columnNumber:5},void 0)});var zl=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e))(zl||{});const r1e={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"ImageToImage allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}};var l4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAISwitch.tsx";const pm=e=>{const{label:t,isDisabled:n=!1,fontSize:i="md",size:o="md",width:u="auto",...c}=e;return C(fd,{isDisabled:n,width:u,children:C(Sr,{justifyContent:"space-between",alignItems:"center",children:[t&&C(sm,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:l4,lineNumber:30,columnNumber:11},void 0),C(s3,{size:o,className:"switch-button",...c},void 0,!1,{fileName:l4,lineNumber:39,columnNumber:9},void 0)]},void 0,!0,{fileName:l4,lineNumber:28,columnNumber:7},void 0)},void 0,!1,{fileName:l4,lineNumber:27,columnNumber:5},void 0)};var P6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestore.tsx";function OU(){const e=gt(o=>o.system.isGFPGANAvailable),t=gt(o=>o.options.shouldRunFacetool),n=Sn();return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Restore Face"},void 0,!1,{fileName:P6,lineNumber:32,columnNumber:7},this),C(pm,{isDisabled:!e,isChecked:t,onChange:o=>n(Qhe(o.target.checked))},void 0,!1,{fileName:P6,lineNumber:33,columnNumber:7},this)]},void 0,!0,{fileName:P6,lineNumber:26,columnNumber:5},this)}var Ip="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAINumberInput.tsx";const VM=/^-?(0\.)?\.?$/,Vl=e=>{const{label:t,styleClass:n,isDisabled:i=!1,showStepper:o=!0,fontSize:u="1rem",size:c="sm",width:p,textAlign:h,isInvalid:v,value:b,onChange:x,min:N,max:_,isInteger:T=!0,...A}=e,[M,z]=k.exports.useState(String(b));k.exports.useEffect(()=>{!M.match(VM)&&b!==Number(M)&&z(String(b))},[b,M]);const P=F=>{z(F),F.match(VM)||x(T?Math.floor(Number(F)):Number(F))},I=F=>{const $=tb.clamp(T?Math.floor(Number(F.target.value)):Number(F.target.value),N,_);z(String($)),x($)};return C(fd,{isDisabled:i,isInvalid:v,className:`number-input ${n}`,children:[t&&C(sm,{fontSize:u,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"number-input-label",children:t},void 0,!1,{fileName:Ip,lineNumber:103,columnNumber:9},void 0),C(Rz,{size:c,...A,className:"number-input-field",value:M,keepWithinRange:!0,clampValueOnBlur:!1,onChange:P,onBlur:I,children:[C(Az,{fontSize:u,className:"number-input-entry",width:p,textAlign:h},void 0,!1,{fileName:Ip,lineNumber:123,columnNumber:9},void 0),C("div",{className:"number-input-stepper",style:o?{display:"block"}:{display:"none"},children:[C(Oz,{className:"number-input-stepper-button"},void 0,!1,{fileName:Ip,lineNumber:133,columnNumber:11},void 0),C(Lz,{className:"number-input-stepper-button"},void 0,!1,{fileName:Ip,lineNumber:134,columnNumber:11},void 0)]},void 0,!0,{fileName:Ip,lineNumber:129,columnNumber:9},void 0)]},void 0,!0,{fileName:Ip,lineNumber:113,columnNumber:7},void 0)]},void 0,!0,{fileName:Ip,lineNumber:97,columnNumber:5},void 0)};var og="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAISelect.tsx";const Rb=e=>{const{label:t,isDisabled:n,validValues:i,size:o="sm",fontSize:u="md",styleClass:c,...p}=e;return C(fd,{isDisabled:n,className:`iai-select ${c}`,children:[C(sm,{fontSize:u,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",className:"iai-select-label",children:t},void 0,!1,{fileName:og,lineNumber:25,columnNumber:7},void 0),C(Iz,{fontSize:u,size:o,...p,className:"iai-select-picker",children:i.map(h=>typeof h=="string"||typeof h=="number"?C("option",{value:h,className:"iai-select-option",children:h},h,!1,{fileName:og,lineNumber:42,columnNumber:13},void 0):C("option",{value:h.value,children:h.key},h.value,!1,{fileName:og,lineNumber:46,columnNumber:13},void 0))},void 0,!1,{fileName:og,lineNumber:34,columnNumber:7},void 0)]},void 0,!0,{fileName:og,lineNumber:24,columnNumber:5},void 0)};var u4="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx";const i1e=Ga(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),a1e=Ga(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),DE=()=>{const e=Sn(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:i}=gt(i1e),{isGFPGANAvailable:o}=gt(a1e),u=h=>e(L4(h)),c=h=>e(eU(h)),p=h=>e(O4(h.target.value));return C(Sr,{direction:"column",gap:2,children:[C(Rb,{label:"Type",validValues:k0e.concat(),value:n,onChange:p},void 0,!1,{fileName:u4,lineNumber:71,columnNumber:7},void 0),C(Vl,{isDisabled:!o,label:"Strength",step:.05,min:0,max:1,onChange:u,value:t,width:"90px",isInteger:!1},void 0,!1,{fileName:u4,lineNumber:77,columnNumber:7},void 0),n==="codeformer"&&C(Vl,{isDisabled:!o,label:"Fidelity",step:.05,min:0,max:1,onChange:c,value:i,width:"90px",isInteger:!1},void 0,!1,{fileName:u4,lineNumber:89,columnNumber:9},void 0)]},void 0,!0,{fileName:u4,lineNumber:70,columnNumber:5},void 0)};var o1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageFit.tsx";function s1e(){const e=Sn(),t=gt(i=>i.options.shouldFitToWidthHeight);return C(pm,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:i=>e(tU(i.target.checked))},void 0,!1,{fileName:o1e,lineNumber:21,columnNumber:5},this)}var l1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx";function u1e(e){const{label:t="Strength",styleClass:n}=e,i=gt(c=>c.options.img2imgStrength),o=Sn();return C(Vl,{label:t,step:.01,min:.01,max:.99,onChange:c=>o(JB(c)),value:i,width:"90px",isInteger:!1,styleClass:n},void 0,!1,{fileName:l1e,lineNumber:26,columnNumber:5},this)}var c1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/RandomizeSeed.tsx";function f1e(){const e=Sn(),t=gt(i=>i.options.shouldRandomizeSeed);return C(pm,{label:"Randomize Seed",isChecked:t,onChange:i=>e(eve(i.target.checked))},void 0,!1,{fileName:c1e,lineNumber:22,columnNumber:5},this)}var d1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Seed.tsx";function p1e(){const e=gt(u=>u.options.seed),t=gt(u=>u.options.shouldRandomizeSeed),n=gt(u=>u.options.shouldGenerateVariations),i=Sn(),o=u=>i(Tb(u));return C(Vl,{label:"Seed",step:1,precision:0,flexGrow:1,min:LE,max:OE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"10rem"},void 0,!1,{fileName:d1e,lineNumber:25,columnNumber:5},this)}var HM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/ShuffleSeed.tsx";function m1e(){const e=Sn(),t=gt(i=>i.options.shouldRandomizeSeed);return C(Du,{size:"sm",isDisabled:t,onClick:()=>e(Tb(_U(LE,OE))),children:C("p",{children:"Shuffle"},void 0,!1,{fileName:HM,lineNumber:27,columnNumber:7},this)},void 0,!1,{fileName:HM,lineNumber:22,columnNumber:5},this)}var h1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Threshold.tsx";function v1e(){const e=Sn(),t=gt(i=>i.options.threshold);return C(Vl,{label:"Threshold",min:0,max:1e3,step:.1,onChange:i=>e(qhe(i)),value:t,isInteger:!1},void 0,!1,{fileName:h1e,lineNumber:19,columnNumber:5},this)}var g1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/Perlin.tsx";function b1e(){const e=Sn(),t=gt(i=>i.options.perlin);return C(Vl,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:i=>e(Zhe(i)),value:t,isInteger:!1},void 0,!1,{fileName:g1e,lineNumber:17,columnNumber:5},this)}var Ec="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Seed/SeedOptions.tsx";const MU=()=>C(Sr,{gap:2,direction:"column",children:[C(f1e,{},void 0,!1,{fileName:Ec,lineNumber:14,columnNumber:7},void 0),C(Sr,{gap:2,children:[C(p1e,{},void 0,!1,{fileName:Ec,lineNumber:16,columnNumber:9},void 0),C(m1e,{},void 0,!1,{fileName:Ec,lineNumber:17,columnNumber:9},void 0)]},void 0,!0,{fileName:Ec,lineNumber:15,columnNumber:7},void 0),C(Sr,{gap:2,children:C(v1e,{},void 0,!1,{fileName:Ec,lineNumber:20,columnNumber:9},void 0)},void 0,!1,{fileName:Ec,lineNumber:19,columnNumber:7},void 0),C(Sr,{gap:2,children:C(b1e,{},void 0,!1,{fileName:Ec,lineNumber:23,columnNumber:9},void 0)},void 0,!1,{fileName:Ec,lineNumber:22,columnNumber:7},void 0)]},void 0,!0,{fileName:Ec,lineNumber:13,columnNumber:5},void 0);var I6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Upscale/Upscale.tsx";function DU(){const e=gt(o=>o.system.isESRGANAvailable),t=gt(o=>o.options.shouldRunESRGAN),n=Sn();return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Upscale"},void 0,!1,{fileName:I6,lineNumber:30,columnNumber:7},this),C(pm,{isDisabled:!e,isChecked:t,onChange:o=>n(Jhe(o.target.checked))},void 0,!1,{fileName:I6,lineNumber:31,columnNumber:7},this)]},void 0,!0,{fileName:I6,lineNumber:24,columnNumber:5},this)}var F6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Upscale/UpscaleOptions.tsx";const y1e=Ga(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),S1e=Ga(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),PE=()=>{const e=Sn(),{upscalingLevel:t,upscalingStrength:n}=gt(y1e),{isESRGANAvailable:i}=gt(S1e);return C("div",{className:"upscale-options",children:[C(Rb,{isDisabled:!i,label:"Scale",value:t,onChange:c=>e(y8(Number(c.target.value))),validValues:A0e},void 0,!1,{fileName:F6,lineNumber:64,columnNumber:7},void 0),C(Vl,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:c=>e(S8(c)),value:n,isInteger:!1},void 0,!1,{fileName:F6,lineNumber:71,columnNumber:7},void 0)]},void 0,!0,{fileName:F6,lineNumber:63,columnNumber:5},void 0)};var x1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/GenerateVariations.tsx";function C1e(){const e=gt(i=>i.options.shouldGenerateVariations),t=Sn();return C(pm,{isChecked:e,width:"auto",onChange:i=>t(Khe(i.target.checked))},void 0,!1,{fileName:x1e,lineNumber:22,columnNumber:5},this)}var z6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/Variations.tsx";function PU(){return C(Sr,{justifyContent:"space-between",alignItems:"center",width:"100%",mr:2,children:[C("p",{children:"Variations"},void 0,!1,{fileName:z6,lineNumber:13,columnNumber:7},this),C(C1e,{},void 0,!1,{fileName:z6,lineNumber:14,columnNumber:7},this)]},void 0,!0,{fileName:z6,lineNumber:7,columnNumber:5},this)}var B6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIInput.tsx";function N1e(e){const{label:t,styleClass:n,isDisabled:i=!1,fontSize:o="1rem",width:u,isInvalid:c,...p}=e;return C(fd,{className:`input ${n}`,isInvalid:c,isDisabled:i,flexGrow:1,children:[C(sm,{fontSize:o,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t},void 0,!1,{fileName:B6,lineNumber:30,columnNumber:7},this),C(M_,{...p,className:"input-entry",size:"sm",width:u},void 0,!1,{fileName:B6,lineNumber:38,columnNumber:7},this)]},void 0,!0,{fileName:B6,lineNumber:24,columnNumber:5},this)}var w1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/SeedWeights.tsx";function _1e(){const e=gt(o=>o.options.seedWeights),t=gt(o=>o.options.shouldGenerateVariations),n=Sn(),i=o=>n(nU(o.target.value));return C(N1e,{label:"Seed Weights",value:e,isInvalid:t&&!(RE(e)||e===""),isDisabled:!t,onChange:i},void 0,!1,{fileName:w1e,lineNumber:26,columnNumber:5},this)}var E1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/VariationAmount.tsx";function T1e(){const e=gt(o=>o.options.variationAmount),t=gt(o=>o.options.shouldGenerateVariations),n=Sn();return C(Vl,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>n(Xhe(o)),isInteger:!1},void 0,!1,{fileName:E1e,lineNumber:24,columnNumber:5},this)}var U6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AdvancedOptions/Variations/VariationsOptions.tsx";const IU=()=>C(Sr,{gap:2,direction:"column",children:[C(T1e,{},void 0,!1,{fileName:U6,lineNumber:11,columnNumber:7},void 0),C(_1e,{},void 0,!1,{fileName:U6,lineNumber:12,columnNumber:7},void 0)]},void 0,!0,{fileName:U6,lineNumber:10,columnNumber:5},void 0);var $6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainAdvancedOptions.tsx";function FU(){const e=gt(i=>i.options.showAdvancedOptions),t=Sn();return C("div",{className:"advanced_options_checker",children:[C("input",{type:"checkbox",name:"advanced_options",id:"",onChange:i=>t(tve(i.target.checked)),checked:e},void 0,!1,{fileName:$6,lineNumber:16,columnNumber:7},this),C("label",{htmlFor:"advanced_options",children:"Advanced Options"},void 0,!1,{fileName:$6,lineNumber:23,columnNumber:7},this)]},void 0,!0,{fileName:$6,lineNumber:15,columnNumber:5},this)}var R1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainCFGScale.tsx";function A1e(){const e=Sn(),t=gt(i=>i.options.cfgScale);return C(Vl,{label:"CFG Scale",step:.5,min:1,max:30,onChange:i=>e(YB(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center",isInteger:!1},void 0,!1,{fileName:R1e,lineNumber:14,columnNumber:5},this)}var k1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainHeight.tsx";function L1e(){const e=gt(i=>i.options.height),t=Sn();return C(Rb,{label:"Height",value:e,flexGrow:1,onChange:i=>t(qB(Number(i.target.value))),validValues:R0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:k1e,lineNumber:16,columnNumber:5},this)}var O1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainIterations.tsx";function M1e(){const e=Sn(),t=gt(i=>i.options.iterations);return C(Vl,{label:"Images",step:1,min:1,max:9999,onChange:i=>e(Yhe(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center"},void 0,!1,{fileName:O1e,lineNumber:16,columnNumber:5},this)}var D1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainSampler.tsx";function P1e(){const e=gt(i=>i.options.sampler),t=Sn();return C(Rb,{label:"Sampler",value:e,onChange:i=>t(KB(i.target.value)),validValues:E0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:D1e,lineNumber:16,columnNumber:5},this)}var I1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainSteps.tsx";function F1e(){const e=Sn(),t=gt(i=>i.options.steps);return C(Vl,{label:"Steps",min:1,max:9999,step:1,onChange:i=>e(GB(i)),value:t,width:IE,fontSize:Bv,styleClass:"main-option-block",textAlign:"center"},void 0,!1,{fileName:I1e,lineNumber:14,columnNumber:5},this)}var z1e="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainWidth.tsx";function B1e(){const e=gt(i=>i.options.width),t=Sn();return C(Rb,{label:"Width",value:e,flexGrow:1,onChange:i=>t(ZB(Number(i.target.value))),validValues:T0e,fontSize:Bv,styleClass:"main-option-block"},void 0,!1,{fileName:z1e,lineNumber:16,columnNumber:5},this)}var gu="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/MainOptions/MainOptions.tsx";const Bv="0.9rem",IE="auto";function zU(){return C("div",{className:"main-options",children:C("div",{className:"main-options-list",children:[C("div",{className:"main-options-row",children:[C(M1e,{},void 0,!1,{fileName:gu,lineNumber:16,columnNumber:11},this),C(F1e,{},void 0,!1,{fileName:gu,lineNumber:17,columnNumber:11},this),C(A1e,{},void 0,!1,{fileName:gu,lineNumber:18,columnNumber:11},this)]},void 0,!0,{fileName:gu,lineNumber:15,columnNumber:9},this),C("div",{className:"main-options-row",children:[C(B1e,{},void 0,!1,{fileName:gu,lineNumber:21,columnNumber:11},this),C(L1e,{},void 0,!1,{fileName:gu,lineNumber:22,columnNumber:11},this),C(P1e,{},void 0,!1,{fileName:gu,lineNumber:23,columnNumber:11},this)]},void 0,!0,{fileName:gu,lineNumber:20,columnNumber:9},this)]},void 0,!0,{fileName:gu,lineNumber:14,columnNumber:7},this)},void 0,!1,{fileName:gu,lineNumber:13,columnNumber:5},this)}var BU={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},WM=Ae.createContext&&Ae.createContext(BU),F4="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/react-icons/lib/esm/iconBase.js",nd=globalThis&&globalThis.__assign||function(){return nd=Object.assign||function(e){for(var t,n=1,i=arguments.length;ne.system,e=>e.shouldDisplayGuides),Q1e=({children:e,feature:t})=>{const n=gt(X1e),{text:i}=r1e[t];return n?C(aE,{trigger:"hover",children:[C(uE,{children:C(Xs,{children:e},void 0,!1,{fileName:Yh,lineNumber:31,columnNumber:9},void 0)},void 0,!1,{fileName:Yh,lineNumber:30,columnNumber:7},void 0),C(lE,{className:"guide-popover-content",maxWidth:"400px",onClick:o=>o.preventDefault(),cursor:"initial",children:[C(oE,{className:"guide-popover-arrow"},void 0,!1,{fileName:Yh,lineNumber:39,columnNumber:9},void 0),C("div",{className:"guide-popover-guide-content",children:i},void 0,!1,{fileName:Yh,lineNumber:40,columnNumber:9},void 0)]},void 0,!0,{fileName:Yh,lineNumber:33,columnNumber:7},void 0)]},void 0,!0,{fileName:Yh,lineNumber:29,columnNumber:5},void 0):C(Ui,{},void 0,!1)};var j6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/GuideIcon.tsx";const J1e=qe(({feature:e,icon:t=$U},n)=>C(Q1e,{feature:e,children:C(Xs,{ref:n,children:C(ms,{as:t},void 0,!1,{fileName:j6,lineNumber:16,columnNumber:9},void 0)},void 0,!1,{fileName:j6,lineNumber:15,columnNumber:7},void 0)},void 0,!1,{fileName:j6,lineNumber:14,columnNumber:5},void 0));var qh="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/AccordionItems/InvokeAccordionItem.tsx";function ege(e){const{header:t,feature:n,options:i}=e;return C(VI,{className:"advanced-settings-item",children:[C("h2",{children:C($I,{className:"advanced-settings-header",children:[t,C(J1e,{feature:n},void 0,!1,{fileName:qh,lineNumber:25,columnNumber:11},this),C(jI,{},void 0,!1,{fileName:qh,lineNumber:26,columnNumber:11},this)]},void 0,!0,{fileName:qh,lineNumber:23,columnNumber:9},this)},void 0,!1,{fileName:qh,lineNumber:22,columnNumber:7},this),C(HI,{className:"advanced-settings-panel",children:i},void 0,!1,{fileName:qh,lineNumber:29,columnNumber:7},this)]},void 0,!0,{fileName:qh,lineNumber:21,columnNumber:5},this)}var YM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OptionsAccordion.tsx";const VU=e=>{const{accordionInfo:t}=e,n=gt(c=>c.system.openAccordions),i=Sn();return C(WI,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:c=>i(pve(c)),className:"advanced-settings",children:(()=>{const c=[];return t&&Object.keys(t).forEach(p=>{c.push(C(ege,{header:t[p].header,feature:t[p].feature,options:t[p].options},p,!1,{fileName:YM,lineNumber:40,columnNumber:11},void 0))}),c})()},void 0,!1,{fileName:YM,lineNumber:53,columnNumber:5},void 0)};var qM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/HiresOptions.tsx";const tge=()=>{const e=Sn(),t=gt(i=>i.options.hiresFix);return C(Sr,{gap:2,direction:"column",children:C(pm,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:i=>e(QB(i.target.checked))},void 0,!1,{fileName:qM,lineNumber:22,columnNumber:7},void 0)},void 0,!1,{fileName:qM,lineNumber:21,columnNumber:5},void 0)};var ZM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SeamlessOptions.tsx";const nge=()=>{const e=Sn(),t=gt(i=>i.options.seamless);return C(Sr,{gap:2,direction:"column",children:C(pm,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:i=>e(XB(i.target.checked))},void 0,!1,{fileName:ZM,lineNumber:18,columnNumber:7},void 0)},void 0,!1,{fileName:ZM,lineNumber:17,columnNumber:5},void 0)};var V6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OutputOptions.tsx";const HU=()=>C(Sr,{gap:2,direction:"column",children:[C(nge,{},void 0,!1,{fileName:V6,lineNumber:10,columnNumber:7},void 0),C(tge,{},void 0,!1,{fileName:V6,lineNumber:11,columnNumber:7},void 0)]},void 0,!0,{fileName:V6,lineNumber:9,columnNumber:5},void 0);var KM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIButton.tsx";const vg=e=>{const{label:t,tooltip:n="",size:i="sm",...o}=e;return C(Ca,{label:n,children:C(Du,{size:i,...o,children:t},void 0,!1,{fileName:KM,lineNumber:17,columnNumber:7},void 0)},void 0,!1,{fileName:KM,lineNumber:16,columnNumber:5},void 0)},XM=Ga(e=>e.options,e=>({prompt:e.prompt,shouldGenerateVariations:e.shouldGenerateVariations,seedWeights:e.seedWeights,maskPath:e.maskPath,initialImagePath:e.initialImagePath,seed:e.seed,activeTab:e.activeTab}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),FE=Ga(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),WU=()=>{const{prompt:e}=gt(XM),{shouldGenerateVariations:t,seedWeights:n,maskPath:i,initialImagePath:o,seed:u,activeTab:c}=gt(XM),{isProcessing:p,isConnected:h}=gt(FE);return k.exports.useMemo(()=>!(!e||Boolean(e.match(/^[\s\r\n]+$/))||e&&!o&&c===1||i&&!o||p||!h||t&&(!(RE(n)||n==="")||u===-1)),[e,i,o,p,h,t,n,u,c])};var rge="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/InvokeButton.tsx";function ige(){const e=Sn(),t=WU();return C(vg,{label:"Invoke","aria-label":"Invoke",type:"submit",isDisabled:!t,onClick:()=>{e(T8())},className:"invoke-btn"},void 0,!1,{fileName:rge,lineNumber:16,columnNumber:5},this)}var QM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/IAIIconButton.tsx";const Wp=e=>{const{tooltip:t="",tooltipPlacement:n="bottom",onClick:i,...o}=e;return C(Ca,{label:t,hasArrow:!0,placement:n,children:C(bi,{...o,cursor:i?"pointer":"unset",onClick:i},void 0,!1,{fileName:QM,lineNumber:22,columnNumber:7},void 0)},void 0,!1,{fileName:QM,lineNumber:21,columnNumber:5},void 0)};var JM="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/CancelButton.tsx";function age(){const e=Sn(),{isProcessing:t,isConnected:n}=gt(FE),i=()=>e(C0e());return ii("shift+x",()=>{(n||t)&&i()},[n,t]),C(Wp,{icon:C(K1e,{},void 0,!1,{fileName:JM,lineNumber:26,columnNumber:13},this),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!n||!t,onClick:i,className:"cancel-btn"},void 0,!1,{fileName:JM,lineNumber:25,columnNumber:5},this)}var H6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ProcessButtons/ProcessButtons.tsx";const GU=()=>C("div",{className:"process-buttons",children:[C(ige,{},void 0,!1,{fileName:H6,lineNumber:10,columnNumber:7},void 0),C(age,{},void 0,!1,{fileName:H6,lineNumber:11,columnNumber:7},void 0)]},void 0,!0,{fileName:H6,lineNumber:9,columnNumber:5},void 0);var W6="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/PromptInput/PromptInput.tsx";const oge=Ga(e=>e.options,e=>({prompt:e.prompt}),{memoizeOptions:{resultEqualityCheck:Wa.exports.isEqual}}),YU=()=>{const e=k.exports.useRef(null),{prompt:t}=gt(oge),{isProcessing:n}=gt(FE),i=Sn(),o=WU(),u=p=>{i(WB(p.target.value))};ii("ctrl+enter",()=>{o&&i(T8())},[o]),ii("alt+a",()=>{e.current?.focus()},[]);const c=p=>{p.key==="Enter"&&p.shiftKey===!1&&o&&(p.preventDefault(),i(T8()))};return C("div",{className:"prompt-bar",children:C(fd,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),isDisabled:n,children:C(Wz,{id:"prompt",name:"prompt",placeholder:"I'm dreaming of...",size:"lg",value:t,onChange:u,onKeyDown:c,resize:"vertical",height:30,ref:e},void 0,!1,{fileName:W6,lineNumber:73,columnNumber:9},void 0)},void 0,!1,{fileName:W6,lineNumber:69,columnNumber:7},void 0)},void 0,!1,{fileName:W6,lineNumber:68,columnNumber:5},void 0)};var Xi="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/tabs/ImageToImage/ImageToImagePanel.tsx";function sge(){const e=gt(n=>n.options.showAdvancedOptions),t={seed:{header:C(Xs,{flex:"1",textAlign:"left",children:"Seed"},void 0,!1,{fileName:Xi,lineNumber:29,columnNumber:9},this),feature:zl.SEED,options:C(MU,{},void 0,!1,{fileName:Xi,lineNumber:34,columnNumber:16},this)},variations:{header:C(PU,{},void 0,!1,{fileName:Xi,lineNumber:37,columnNumber:15},this),feature:zl.VARIATIONS,options:C(IU,{},void 0,!1,{fileName:Xi,lineNumber:39,columnNumber:16},this)},face_restore:{header:C(OU,{},void 0,!1,{fileName:Xi,lineNumber:42,columnNumber:15},this),feature:zl.FACE_CORRECTION,options:C(DE,{},void 0,!1,{fileName:Xi,lineNumber:44,columnNumber:16},this)},upscale:{header:C(DU,{},void 0,!1,{fileName:Xi,lineNumber:47,columnNumber:15},this),feature:zl.UPSCALE,options:C(PE,{},void 0,!1,{fileName:Xi,lineNumber:49,columnNumber:16},this)},other:{header:C(Xs,{flex:"1",textAlign:"left",children:"Other"},void 0,!1,{fileName:Xi,lineNumber:53,columnNumber:9},this),feature:zl.OTHER,options:C(HU,{},void 0,!1,{fileName:Xi,lineNumber:58,columnNumber:16},this)}};return C("div",{className:"image-to-image-panel",children:[C(YU,{},void 0,!1,{fileName:Xi,lineNumber:64,columnNumber:7},this),C(GU,{},void 0,!1,{fileName:Xi,lineNumber:65,columnNumber:7},this),C(zU,{},void 0,!1,{fileName:Xi,lineNumber:66,columnNumber:7},this),C(u1e,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"},void 0,!1,{fileName:Xi,lineNumber:67,columnNumber:7},this),C(s1e,{},void 0,!1,{fileName:Xi,lineNumber:71,columnNumber:7},this),C(FU,{},void 0,!1,{fileName:Xi,lineNumber:72,columnNumber:7},this),e?C(VU,{accordionInfo:t},void 0,!1,{fileName:Xi,lineNumber:74,columnNumber:9},this):null]},void 0,!0,{fileName:Xi,lineNumber:63,columnNumber:5},this)}function lge(e){return hr({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function uge(e){return hr({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function cge(e){return hr({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function fge(e){return hr({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function dge(e){return hr({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function pge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function mge(e){return hr({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function hge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function vge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function gge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function bge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function yge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function Sge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function xge(e){return hr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function Cge(e){return hr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}var Nge=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ab(e,t){var n=wge(e);if(typeof n.path!="string"){var i=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof i=="string"&&i.length>0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function wge(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var i=t.split(".").pop().toLowerCase(),o=Nge.get(i);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var _ge=[".DS_Store","Thumbs.db"];function Ege(e){return Ov(this,void 0,void 0,function(){return Mv(this,function(t){return CS(e)&&Tge(e.dataTransfer)?[2,Lge(e.dataTransfer,e.type)]:Rge(e)?[2,Age(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,kge(e)]:[2,[]]})})}function Tge(e){return CS(e)}function Rge(e){return CS(e)&&CS(e.target)}function CS(e){return typeof e=="object"&&e!==null}function Age(e){return A8(e.target.files).map(function(t){return Ab(t)})}function kge(e){return Ov(this,void 0,void 0,function(){var t;return Mv(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(i){return Ab(i)})]}})})}function Lge(e,t){return Ov(this,void 0,void 0,function(){var n,i;return Mv(this,function(o){switch(o.label){case 0:return e.items?(n=A8(e.items).filter(function(u){return u.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Oge))]):[3,2];case 1:return i=o.sent(),[2,eD(qU(i))];case 2:return[2,eD(A8(e.files).map(function(u){return Ab(u)}))]}})})}function eD(e){return e.filter(function(t){return _ge.indexOf(t.name)===-1})}function A8(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);nn)return[!1,aD(n)];if(e.sizen)return[!1,aD(n)]}return[!0,null]}function Gp(e){return e!=null}function qge(e){var t=e.files,n=e.accept,i=e.minSize,o=e.maxSize,u=e.multiple,c=e.maxFiles,p=e.validator;return!u&&t.length>1||u&&c>=1&&t.length>c?!1:t.every(function(h){var v=QU(h,n),b=rb(v,1),x=b[0],N=JU(h,i,o),_=rb(N,1),T=_[0],A=p?p(h):null;return x&&T&&!A})}function NS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function c4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function sD(e){e.preventDefault()}function Zge(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Kge(e){return e.indexOf("Edge/")!==-1}function Xge(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Zge(e)||Kge(e)}function bu(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),c=1;c InvokeAI - A Stable Diffusion Toolkit - + @@ -15,4 +15,4 @@ - + \ No newline at end of file diff --git a/frontend/src/features/gallery/gallerySlice.ts b/frontend/src/features/gallery/gallerySlice.ts index 415b80d326..cc9341fd81 100644 --- a/frontend/src/features/gallery/gallerySlice.ts +++ b/frontend/src/features/gallery/gallerySlice.ts @@ -72,7 +72,13 @@ export const gallerySlice = createSlice({ }, addImage: (state, action: PayloadAction) => { const newImage = action.payload; - const { uuid, mtime } = newImage; + const { uuid, url, mtime } = newImage; + + // Do not add duplicate images + if (state.images.find((i) => i.url === url && i.mtime === mtime)) { + return; + } + state.images.unshift(newImage); state.currentImageUuid = uuid; state.intermediateImage = undefined; @@ -120,8 +126,15 @@ export const gallerySlice = createSlice({ ) => { const { images, areMoreImagesAvailable } = action.payload; if (images.length > 0) { + // Filter images that already exist in the gallery + const newImages = images.filter( + (newImage) => + !state.images.find( + (i) => i.url === newImage.url && i.mtime === newImage.mtime + ) + ); state.images = state.images - .concat(images) + .concat(newImages) .sort((a, b) => b.mtime - a.mtime); if (!state.currentImage) { diff --git a/ldm/generate.py b/ldm/generate.py index 45ed2e73d1..f83a732816 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -729,7 +729,7 @@ class Generate: seed_everything(random.randrange(0, np.iinfo(np.uint32).max)) if self.embedding_path is not None: - model.embedding_manager.load( + self.model.embedding_manager.load( self.embedding_path, self.precision == 'float32' or self.precision == 'autocast' ) @@ -806,6 +806,23 @@ class Generate: else: r[0] = image + def apply_textmask(self, image_path:str, prompt:str, callback, threshold:float=0.5): + assert os.path.exists(image_path), '** "{image_path}" not found. Please enter the name of an existing image file to mask **' + basename,_ = os.path.splitext(os.path.basename(image_path)) + if self.txt2mask is None: + self.txt2mask = Txt2Mask(device = self.device) + segmented = self.txt2mask.segment(image_path,prompt) + trans = segmented.to_transparent() + inverse = segmented.to_transparent(invert=True) + mask = segmented.to_mask(threshold) + + path_filter = re.compile(r'[<>:"/\\|?*]') + safe_prompt = path_filter.sub('_', prompt)[:50].rstrip(' .') + + callback(trans,f'{safe_prompt}.deselected',use_prefix=basename) + callback(inverse,f'{safe_prompt}.selected',use_prefix=basename) + callback(mask,f'{safe_prompt}.masked',use_prefix=basename) + # to help WebGUI - front end to generator util function def sample_to_image(self, samples): return self._make_base().sample_to_image(samples) diff --git a/ldm/invoke/readline.py b/ldm/invoke/readline.py index 0a79894029..df2e1a1e5b 100644 --- a/ldm/invoke/readline.py +++ b/ldm/invoke/readline.py @@ -56,6 +56,7 @@ COMMANDS = ( '--png_compression','-z', '--text_mask','-tm', '!fix','!fetch','!history','!search','!clear', + '!mask', '!models','!switch','!import_model','!edit_model' ) MODEL_COMMANDS = ( @@ -71,6 +72,7 @@ IMG_PATH_COMMANDS = ( IMG_FILE_COMMANDS=( '!fix', '!fetch', + '!mask', '--init_img[=\s]','-I', '--init_mask[=\s]','-M', '--init_color[=\s]', diff --git a/ldm/invoke/restoration/codeformer.py b/ldm/invoke/restoration/codeformer.py index 0d13ae0a36..325f1b1d94 100644 --- a/ldm/invoke/restoration/codeformer.py +++ b/ldm/invoke/restoration/codeformer.py @@ -41,10 +41,12 @@ class CodeFormerRestoration(): cf.eval() image = image.convert('RGB') + # Codeformer expects a BGR np array; make array and flip channels + bgr_image_array = np.array(image, dtype=np.uint8)[...,::-1] face_helper = FaceRestoreHelper(upscale_factor=1, use_parse=True, device=device) face_helper.clean_all() - face_helper.read_image(np.array(image, dtype=np.uint8)) + face_helper.read_image(bgr_image_array) face_helper.get_face_landmarks_5(resize=640, eye_dist_threshold=5) face_helper.align_warp_face() @@ -71,7 +73,8 @@ class CodeFormerRestoration(): restored_img = face_helper.paste_faces_to_input_image() - res = Image.fromarray(restored_img) + # Flip the channels back to RGB + res = Image.fromarray(restored_img[...,::-1]) if strength < 1.0: # Resize the image to the new image if the sizes have changed diff --git a/ldm/invoke/restoration/gfpgan.py b/ldm/invoke/restoration/gfpgan.py index 473d708961..9042de5d6c 100644 --- a/ldm/invoke/restoration/gfpgan.py +++ b/ldm/invoke/restoration/gfpgan.py @@ -55,13 +55,18 @@ class GFPGAN(): image = image.convert('RGB') + # GFPGAN expects a BGR np array; make array and flip channels + bgr_image_array = np.array(image, dtype=np.uint8)[...,::-1] + _, _, restored_img = self.gfpgan.enhance( - np.array(image, dtype=np.uint8), + bgr_image_array, has_aligned=False, only_center_face=False, paste_back=True, ) - res = Image.fromarray(restored_img) + + # Flip the channels back to RGB + res = Image.fromarray(restored_img[...,::-1]) if strength < 1.0: # Resize the image to the new image if the sizes have changed diff --git a/ldm/invoke/restoration/realesrgan.py b/ldm/invoke/restoration/realesrgan.py index dc3eebd912..4b83fcbb10 100644 --- a/ldm/invoke/restoration/realesrgan.py +++ b/ldm/invoke/restoration/realesrgan.py @@ -60,14 +60,18 @@ class ESRGAN(): print( f'>> Real-ESRGAN Upscaling seed:{seed} : scale:{upsampler_scale}x' ) + + # REALSRGAN expects a BGR np array; make array and flip channels + bgr_image_array = np.array(image, dtype=np.uint8)[...,::-1] output, _ = upsampler.enhance( - np.array(image, dtype=np.uint8), + bgr_image_array, outscale=upsampler_scale, alpha_upsampler='realesrgan', ) - res = Image.fromarray(output) + # Flip the channels back to RGB + res = Image.fromarray(output[...,::-1]) if strength < 1.0: # Resize the image to the new image if the sizes have changed diff --git a/ldm/invoke/txt2mask.py b/ldm/invoke/txt2mask.py index 01d93546e3..bc8251abde 100644 --- a/ldm/invoke/txt2mask.py +++ b/ldm/invoke/txt2mask.py @@ -29,9 +29,9 @@ work fine. import torch import numpy as np -from models.clipseg import CLIPDensePredT +from clipseg_models.clipseg import CLIPDensePredT from einops import rearrange, repeat -from PIL import Image +from PIL import Image, ImageOps from torchvision import transforms CLIP_VERSION = 'ViT-B/16' @@ -50,9 +50,14 @@ class SegmentedGrayscale(object): discrete_heatmap = self.heatmap.lt(threshold).int() return self._rescale(Image.fromarray(np.uint8(discrete_heatmap*255),mode='L')) - def to_transparent(self)->Image: + def to_transparent(self,invert:bool=False)->Image: transparent_image = self.image.copy() - transparent_image.putalpha(self.to_grayscale()) + gs = self.to_grayscale() + # The following line looks like a bug, but isn't. + # For img2img, we want the selected regions to be transparent, + # but to_grayscale() returns the opposite. + gs = ImageOps.invert(gs) if not invert else gs + transparent_image.putalpha(gs) return transparent_image # unscales and uncrops the 352x352 heatmap so that it matches the image again @@ -79,7 +84,7 @@ class Txt2Mask(object): self.model.load_state_dict(torch.load(CLIPSEG_WEIGHTS, map_location=torch.device('cpu')), strict=False) @torch.no_grad() - def segment(self, image:Image, prompt:str) -> SegmentedGrayscale: + def segment(self, image, prompt:str) -> SegmentedGrayscale: ''' Given a prompt string such as "a bagel", tries to identify the object in the provided image and returns a SegmentedGrayscale object in which the brighter @@ -94,6 +99,10 @@ class Txt2Mask(object): transforms.Resize((CLIPSEG_SIZE, CLIPSEG_SIZE)), # must be multiple of 64... ]) + if type(image) is str: + image = Image.open(image).convert('RGB') + + image = ImageOps.exif_transpose(image) img = self._scale_and_crop(image) img = transform(img).unsqueeze(0) diff --git a/requirements-linux-arm64.txt b/requirements-linux-arm64.txt index 3a6ab888c9..5ee4df2399 100644 --- a/requirements-linux-arm64.txt +++ b/requirements-linux-arm64.txt @@ -22,5 +22,5 @@ transformers==4.21.3 -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers -e git+https://github.com/lstein/k-diffusion.git@master#egg=k-diffusion -e git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan --3 git+https://github.com/invoke-ai/clipseg.git#egg=clipseg +-e git+https://github.com/invoke-ai/clipseg.git@models-rename#egg=clipseg -e . diff --git a/requirements.txt b/requirements.txt index 3517e48177..2e85166841 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,4 +35,4 @@ realesrgan git+https://github.com/openai/CLIP.git@main#egg=clip git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan -git+https://github.com/invoke-ai/clipseg.git#egg=clipseg +git+https://github.com/invoke-ai/clipseg.git@models-rename#egg=clipseg diff --git a/scripts/invoke.py b/scripts/invoke.py index 8ea71c0de5..754ee1fad0 100644 --- a/scripts/invoke.py +++ b/scripts/invoke.py @@ -225,9 +225,13 @@ def main_loop(gen, opt, infile): os.makedirs(opt.outdir) current_outdir = opt.outdir - # write out the history at this point + # Write out the history at this point. + # TODO: Fix the parsing of command-line parameters + # so that !operations don't need to be stripped and readded if operation == 'postprocess': completer.add_history(f'!fix {command}') + elif operation == 'mask': + completer.add_history(f'!mask {command}') else: completer.add_history(command) @@ -247,13 +251,28 @@ def main_loop(gen, opt, infile): # when the -v switch is used to generate variations nonlocal prior_variations nonlocal prefix - if use_prefix is not None: - prefix = use_prefix path = None if opt.grid: grid_images[seed] = image + + elif operation == 'mask': + filename = f'{prefix}.{use_prefix}.{seed}.png' + tm = opt.text_mask[0] + th = opt.text_mask[1] if len(opt.text_mask)>1 else 0.5 + formatted_dream_prompt = f'!mask {opt.prompt} -tm {tm} {th}' + path = file_writer.save_image_and_prompt_to_png( + image = image, + dream_prompt = formatted_dream_prompt, + metadata = {}, + name = filename, + compress_level = opt.png_compression, + ) + results.append([path, formatted_dream_prompt]) + else: + if use_prefix is not None: + prefix = use_prefix postprocessed = upscaled if upscaled else operation=='postprocess' filename, formatted_dream_prompt = prepare_image_metadata( opt, @@ -292,7 +311,7 @@ def main_loop(gen, opt, infile): results.append([path, formatted_dream_prompt]) # so that the seed autocompletes (on linux|mac when -S or --seed specified - if completer: + if completer and operation == 'generate': completer.add_seed(seed) completer.add_seed(first_seed) last_results.append([path, seed]) @@ -310,6 +329,10 @@ def main_loop(gen, opt, infile): print(f'>> fixing {opt.prompt}') opt.last_operation = do_postprocess(gen,opt,image_writer) + elif operation == 'mask': + print(f'>> generating masks from {opt.prompt}') + do_textmask(gen, opt, image_writer) + if opt.grid and len(grid_images) > 0: grid_img = make_grid(list(grid_images.values())) grid_seeds = list(grid_images.keys()) @@ -355,6 +378,10 @@ def do_command(command:str, gen, opt:Args, completer) -> tuple: command = command.replace('!fix ','',1) operation = 'postprocess' + elif command.startswith('!mask'): + command = command.replace('!mask ','',1) + operation = 'mask' + elif command.startswith('!switch'): model_name = command.replace('!switch ','',1) gen.set_model(model_name) @@ -363,6 +390,7 @@ def do_command(command:str, gen, opt:Args, completer) -> tuple: elif command.startswith('!models'): gen.model_cache.print_models() + completer.add_history(command) operation = None elif command.startswith('!import'): @@ -494,6 +522,19 @@ def write_config_file(conf_path, gen, model_name, new_config, clobber=False): os.rename(tmpfile,conf_path) return True +def do_textmask(gen, opt, callback): + image_path = opt.prompt + assert os.path.exists(image_path), '** "{image_path}" not found. Please enter the name of an existing image file to mask **' + assert opt.text_mask is not None and len(opt.text_mask) >= 1, '** Please provide a text mask with -tm **' + tm = opt.text_mask[0] + threshold = float(opt.text_mask[1]) if len(opt.text_mask) > 1 else 0.5 + gen.apply_textmask( + image_path = image_path, + prompt = tm, + threshold = threshold, + callback = callback, + ) + def do_postprocess (gen, opt, callback): file_path = opt.prompt # treat the prompt as the file pathname if os.path.dirname(file_path) == '': #basename given @@ -670,7 +711,7 @@ def load_face_restoration(opt): print(traceback.format_exc(), file=sys.stderr) print('>> You may need to install the ESRGAN and/or GFPGAN modules') return gfpgan,codeformer,esrgan - + def make_step_callback(gen, opt, prefix): destination = os.path.join(opt.outdir,'intermediates',prefix) os.makedirs(destination,exist_ok=True) diff --git a/scripts/preload_models.py b/scripts/preload_models.py index 97b79e1845..1b0ad80e5c 100644 --- a/scripts/preload_models.py +++ b/scripts/preload_models.py @@ -107,25 +107,27 @@ except Exception: print(traceback.format_exc()) print('...success') -print('Loading clipseq model for text-based masking...',end='') +print('Loading clipseg model for text-based masking...',end='') try: model_url = 'https://owncloud.gwdg.de/index.php/s/ioHbRzFx6th32hn/download' model_dest = 'src/clipseg/clipseg_weights.zip' - if not os.path.exists(model_dest): + weights_dir = 'src/clipseg/weights' + if not os.path.exists(weights_dir): os.makedirs(os.path.dirname(model_dest), exist_ok=True) urllib.request.urlretrieve(model_url,model_dest) with zipfile.ZipFile(model_dest,'r') as zip: zip.extractall('src/clipseg') os.rename('src/clipseg/clipseg_weights','src/clipseg/weights') - from models.clipseg import CLIPDensePredT + os.remove(model_dest) + from clipseg_models.clipseg import CLIPDensePredT model = CLIPDensePredT(version='ViT-B/16', reduce_dim=64, ) model.eval() model.load_state_dict( - torch.load('src/clipseg/weights/rd64-uni-refined.pth'), - model.load_state_dict(torch.load('src/clipseg/weights/rd64-uni-refined.pth'), - map_location=torch.device('cpu'), - strict=False, - ) + torch.load( + 'src/clipseg/weights/rd64-uni-refined.pth', + map_location=torch.device('cpu') + ), + strict=False, ) except Exception: print('Error installing clipseg model:')