From 81bb44319a11951bdd6cb152b44de803192b149f Mon Sep 17 00:00:00 2001 From: Travis Palmer Date: Tue, 13 Sep 2022 17:24:04 -0400 Subject: [PATCH 02/46] Hopefully fix embiggen for CPU users, change embiggen seeding behavior, tweak gradient corner --- ldm/dream/generator/embiggen.py | 48 ++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/ldm/dream/generator/embiggen.py b/ldm/dream/generator/embiggen.py index cb9c029a66..64ba181346 100644 --- a/ldm/dream/generator/embiggen.py +++ b/ldm/dream/generator/embiggen.py @@ -5,9 +5,10 @@ and generates with ldm.dream.generator.img2img import torch import numpy as np -from PIL import Image +from tqdm import trange +from PIL import Image +from ldm.dream.devices import choose_autocast_device from ldm.dream.generator.base import Generator -from ldm.models.diffusion.ddim import DDIMSampler from ldm.dream.generator.img2img import Img2Img class Embiggen(Generator): @@ -15,6 +16,29 @@ class Embiggen(Generator): super().__init__(model) self.init_latent = None + # Replace generate because Embiggen doesn't need/use most of what it does normallly + def generate(self,prompt,iterations=1,seed=None, + image_callback=None, step_callback=None, + **kwargs): + device_type,scope = choose_autocast_device(self.model.device) + make_image = self.get_make_image( + prompt, + step_callback = step_callback, + **kwargs + ) + results = [] + seed = seed if seed else self.new_seed() + # Noise will be generated by the Img2Img generator when called + with scope(device_type), self.model.ema_scope(): + for n in trange(iterations, desc='Generating'): + # make_image will call Img2Img which will do the equivalent of get_noise itself + image = make_image() + results.append([image, seed]) + if image_callback is not None: + image_callback(image, seed) + seed = self.new_seed() + return results + @torch.no_grad() def get_make_image( self, @@ -143,7 +167,7 @@ class Embiggen(Generator): if distanceToLR > 255: distanceToLR = 255 #Place the pixel as invert of distance - agradientC.putpixel((x, y), int(255 - distanceToLR)) + agradientC.putpixel((x, y), round(255 - distanceToLR)) # Create alpha layers default fully white alphaLayerL = Image.new("L", (width, height), 255) @@ -213,7 +237,7 @@ class Embiggen(Generator): del agradientT del agradientC - def make_image(x_T): + def make_image(): # Make main tiles ------------------------------------------------- if embiggen_tiles: print(f'>> Making {len(embiggen_tiles)} Embiggen tiles...') @@ -221,7 +245,20 @@ class Embiggen(Generator): print(f'>> Making {(emb_tiles_x * emb_tiles_y)} Embiggen tiles ({emb_tiles_x}x{emb_tiles_y})...') emb_tile_store = [] + # Although we could use the same seed for every tile for determinism, at higher strengths this may + # produce duplicated structures for each tile and make the tiling effect more obvious + # instead track and iterate a local seed we pass to Img2Img + seed = self.seed + seedintlimit = np.iinfo(np.uint32).max - 1 # only retreive this one from numpy + for tile in range(emb_tiles_x * emb_tiles_y): + # Don't iterate on first tile + if tile != 0: + if seed < seedintlimit: + seed += 1 + else: + seed = 0 + # Determine if this is a re-run and replace if embiggen_tiles and not tile in embiggen_tiles: continue @@ -262,7 +299,7 @@ class Embiggen(Generator): tile_results = gen_img2img.generate( prompt, iterations = 1, - seed = self.seed, + seed = seed, sampler = sampler, steps = steps, cfg_scale = cfg_scale, @@ -272,7 +309,6 @@ class Embiggen(Generator): step_callback = step_callback, # called after each intermediate image is generated width = width, height = height, - init_img = init_img, # img2img doesn't need this, but it might in the future init_image = newinitimage, # notice that init_image is different from init_img mask_image = None, strength = strength, From 96d7639d2a923baa3cecfdec6fc8f8976be32032 Mon Sep 17 00:00:00 2001 From: Travis Palmer Date: Thu, 15 Sep 2022 17:26:53 -0400 Subject: [PATCH 03/46] Fix visible trailing semi-transparent hard edge in normal tiling mode (when img2img diverges between tiles) using an asymmetric alpha mask in the corner. (LTaC fix) --- ldm/dream/generator/embiggen.py | 35 +++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/ldm/dream/generator/embiggen.py b/ldm/dream/generator/embiggen.py index 64ba181346..731380e3c0 100644 --- a/ldm/dream/generator/embiggen.py +++ b/ldm/dream/generator/embiggen.py @@ -168,6 +168,17 @@ class Embiggen(Generator): distanceToLR = 255 #Place the pixel as invert of distance agradientC.putpixel((x, y), round(255 - distanceToLR)) + + # Create alternative asymmetric diagonal corner to use on "tailing" intersections to prevent hard edges + # Fits for a left-fading gradient on the bottom side and full opacity on the right side. + agradientAsymC = Image.new('L', (256, 256)) + for y in range(256): + for x in range(256): + value = round(max(0, x-(255-y)) * (255 / max(1,y))) + #Clamp values + value = max(0, value) + value = min(255, value) + agradientAsymC.putpixel((x, y), value) # Create alpha layers default fully white alphaLayerL = Image.new("L", (width, height), 255) @@ -179,6 +190,12 @@ class Embiggen(Generator): alphaLayerLTC.paste(agradientL, (0, 0)) alphaLayerLTC.paste(agradientT, (0, 0)) alphaLayerLTC.paste(agradientC.resize((overlap_size_x, overlap_size_y)), (0, 0)) + # make masks with an asymmetric upper-right corner so when the curved transparent corner of the next tile + # to its right is placed it doesn't reveal a hard trailing semi-transparent edge in the overlapping space + alphaLayerTaC = alphaLayerT.copy() + alphaLayerTaC.paste(agradientAsymC.rotate(270).resize((overlap_size_x, overlap_size_y)), (width - overlap_size_x, 0)) + alphaLayerLTaC = alphaLayerLTC.copy() + alphaLayerLTaC.paste(agradientAsymC.rotate(270).resize((overlap_size_x, overlap_size_y)), (width - overlap_size_x, 0)) if embiggen_tiles: # Individual unconnected sides @@ -382,7 +399,7 @@ class Embiggen(Generator): elif emb_row_i == emb_tiles_y - 1: if emb_column_i == 0: if (tile+1) in embiggen_tiles: # Look-ahead right - intileimage.putalpha(alphaLayerT) + intileimage.putalpha(alphaLayerTaC) else: intileimage.putalpha(alphaLayerRTC) elif emb_column_i == emb_tiles_x - 1: @@ -390,7 +407,7 @@ class Embiggen(Generator): intileimage.putalpha(alphaLayerLTC) else: if (tile+1) in embiggen_tiles: # Look-ahead right - intileimage.putalpha(alphaLayerLTC) + intileimage.putalpha(alphaLayerLTaC) else: intileimage.putalpha(alphaLayerABB) # vertical middle of image @@ -398,7 +415,7 @@ class Embiggen(Generator): if emb_column_i == 0: if (tile+1) in embiggen_tiles: # Look-ahead right if (tile+emb_tiles_x) in embiggen_tiles: # Look-ahead down - intileimage.putalpha(alphaLayerT) + intileimage.putalpha(alphaLayerTaC) else: intileimage.putalpha(alphaLayerTB) elif (tile+emb_tiles_x) in embiggen_tiles: # Look-ahead down only @@ -413,7 +430,7 @@ class Embiggen(Generator): else: if (tile+1) in embiggen_tiles: # Look-ahead right if (tile+emb_tiles_x) in embiggen_tiles: # Look-ahead down - intileimage.putalpha(alphaLayerLTC) + intileimage.putalpha(alphaLayerLTaC) else: intileimage.putalpha(alphaLayerABR) elif (tile+emb_tiles_x) in embiggen_tiles: # Look-ahead down only @@ -425,9 +442,15 @@ class Embiggen(Generator): if emb_row_i == 0 and emb_column_i >= 1: intileimage.putalpha(alphaLayerL) elif emb_row_i >= 1 and emb_column_i == 0: - intileimage.putalpha(alphaLayerT) + if emb_column_i + 1 == emb_tiles_x: # If we don't have anything that can be placed to the right + intileimage.putalpha(alphaLayerT) + else: + intileimage.putalpha(alphaLayerTaC) else: - intileimage.putalpha(alphaLayerLTC) + if emb_column_i + 1 == emb_tiles_x: # If we don't have anything that can be placed to the right + intileimage.putalpha(alphaLayerLTC) + else: + intileimage.putalpha(alphaLayerLTaC) # Layer tile onto final image outputsuperimage.alpha_composite(intileimage, (left, top)) else: From a1739a73b48bfe98b6abcb67f5a0197a9ad270e0 Mon Sep 17 00:00:00 2001 From: techicode Date: Wed, 21 Sep 2022 03:18:47 -0300 Subject: [PATCH 04/46] linux instructions update to /InvokeAI folder name --- docs/installation/INSTALL_LINUX.md | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/installation/INSTALL_LINUX.md b/docs/installation/INSTALL_LINUX.md index b7a6cd8ff0..2a64f1eb41 100644 --- a/docs/installation/INSTALL_LINUX.md +++ b/docs/installation/INSTALL_LINUX.md @@ -16,27 +16,27 @@ After installing anaconda, you should log out of your system and log back in. If the installation worked, your command prompt will be prefixed by the name of the current anaconda environment - `(base)`. -3. Copy the stable-diffusion source code from GitHub: +3. Copy the InvokeAI source code from GitHub: ``` -(base) ~$ git clone https://github.com/lstein/stable-diffusion.git +(base) ~$ git clone https://github.com/invoke-ai/InvokeAI.git ``` -This will create stable-diffusion folder where you will follow the rest of the steps. +This will create InvokeAI folder where you will follow the rest of the steps. -4. Enter the newly-created stable-diffusion folder. From this step forward make sure that you are working in the stable-diffusion directory! +4. Enter the newly-created InvokeAI folder. From this step forward make sure that you are working in the InvokeAI directory! ``` -(base) ~$ cd stable-diffusion -(base) ~/stable-diffusion$ +(base) ~$ cd InvokeAI +(base) ~/InvokeAI$ ``` 5. Use anaconda to copy necessary python packages, create a new python environment named `ldm` and activate the environment. ``` -(base) ~/stable-diffusion$ conda env create -f environment.yaml -(base) ~/stable-diffusion$ conda activate ldm -(ldm) ~/stable-diffusion$ +(base) ~/InvokeAI$ conda env create -f environment.yaml +(base) ~/InvokeAI$ conda activate ldm +(ldm) ~/InvokeAI$ ``` After these steps, your command prompt will be prefixed by `(ldm)` as shown above. @@ -44,7 +44,7 @@ After these steps, your command prompt will be prefixed by `(ldm)` as shown abov 6. Load a couple of small machine-learning models required by stable diffusion: ``` -(ldm) ~/stable-diffusion$ python3 scripts/preload_models.py +(ldm) ~/InvokeAI$ python3 scripts/preload_models.py ``` Note that this step is necessary because I modified the original just-in-time model loading scheme to allow the script to work on GPU machines that are not internet connected. See [Preload Models](../features/OTHER.md#preload-models) @@ -59,31 +59,31 @@ Note that this step is necessary because I modified the original just-in-time mo Now run the following commands from within the stable-diffusion directory. This will create a symbolic link from the stable-diffusion model.ckpt file, to the true location of the sd-v1-4.ckpt file. ``` -(ldm) ~/stable-diffusion$ mkdir -p models/ldm/stable-diffusion-v1 -(ldm) ~/stable-diffusion$ ln -sf /path/to/sd-v1-4.ckpt models/ldm/stable-diffusion-v1/model.ckpt +(ldm) ~/InvokeAI$ mkdir -p models/ldm/stable-diffusion-v1 +(ldm) ~/InvokeAI$ ln -sf /path/to/sd-v1-4.ckpt models/ldm/stable-diffusion-v1/model.ckpt ``` 8. Start generating images! ``` # for the pre-release weights use the -l or --liaon400m switch -(ldm) ~/stable-diffusion$ python3 scripts/dream.py -l +(ldm) ~/InvokeAI$ python3 scripts/dream.py -l # for the post-release weights do not use the switch -(ldm) ~/stable-diffusion$ python3 scripts/dream.py +(ldm) ~/InvokeAI$ python3 scripts/dream.py # for additional configuration switches and arguments, use -h or --help -(ldm) ~/stable-diffusion$ python3 scripts/dream.py -h +(ldm) ~/InvokeAI$ python3 scripts/dream.py -h ``` -9. Subsequently, to relaunch the script, be sure to run "conda activate ldm" (step 5, second command), enter the `stable-diffusion` directory, and then launch the dream script (step 8). If you forget to activate the ldm environment, the script will fail with multiple `ModuleNotFound` errors. +9. Subsequently, to relaunch the script, be sure to run "conda activate ldm" (step 5, second command), enter the `InvokeAI` directory, and then launch the dream script (step 8). If you forget to activate the ldm environment, the script will fail with multiple `ModuleNotFound` errors. ### Updating to newer versions of the script -This distribution is changing rapidly. If you used the `git clone` method (step 5) to download the stable-diffusion directory, then to update to the latest and greatest version, launch the Anaconda window, enter `stable-diffusion` and type: +This distribution is changing rapidly. If you used the `git clone` method (step 5) to download the InvokeAI directory, then to update to the latest and greatest version, launch the Anaconda window, enter `InvokeAI` and type: ``` -(ldm) ~/stable-diffusion$ git pull +(ldm) ~/InvokeAI$ git pull ``` This will bring your local copy into sync with the remote one. From 72dd5b18ee070e2bfedd209615973785dde41e7d Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 21 Sep 2022 19:00:19 +1200 Subject: [PATCH 05/46] Bug Fix Patch --- .gitignore | 2 +- ldm/dream/args.py | 4 ++-- ldm/dream/restoration/base.py | 2 +- scripts/dream.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4c0ec37174..da74df3a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # ignore default image save location and model symbolic link outputs/ models/ldm/stable-diffusion-v1/model.ckpt -ldm/restoration/codeformer/weights +ldm/dream/restoration/codeformer/weights # ignore the Anaconda/Miniconda installer used while building Docker image anaconda.sh diff --git a/ldm/dream/args.py b/ldm/dream/args.py index eb1913d1cf..2cb42d82a7 100644 --- a/ldm/dream/args.py +++ b/ldm/dream/args.py @@ -573,14 +573,14 @@ class Args(object): '-G', '--gfpgan_strength', type=float, - help='The strength at which to apply the GFPGAN model to the result, in order to improve faces.', + help='The strength at which to apply the face restoration to the result.', default=0.0, ) postprocessing_group.add_argument( '-cf', '--codeformer_fidelity', type=float, - help='Takes values between 0 and 1. 0 produces high quality but low accuracy. 1 produces high accuracy but low quality.', + help='Used along with CodeFormer. Takes values between 0 and 1. 0 produces high quality but low accuracy. 1 produces high accuracy but low quality.', default=0.75 ) postprocessing_group.add_argument( diff --git a/ldm/dream/restoration/base.py b/ldm/dream/restoration/base.py index 539301d802..9037bc40cb 100644 --- a/ldm/dream/restoration/base.py +++ b/ldm/dream/restoration/base.py @@ -27,7 +27,7 @@ class Restoration(): return CodeFormerRestoration() # Upscale Models - def load_ersgan(self): + def load_esrgan(self): from ldm.dream.restoration.realesrgan import ESRGAN esrgan = ESRGAN(self.esrgan_bg_tile) print('>> ESRGAN Initialized') diff --git a/scripts/dream.py b/scripts/dream.py index dc1757dce2..9efa1829c6 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -47,14 +47,14 @@ def main(): # Loading Face Restoration and ESRGAN Modules try: gfpgan, codeformer, esrgan = None, None, None - from ldm.dream.restoration import Restoration + from ldm.dream.restoration.base import Restoration restoration = Restoration(opt.gfpgan_dir, opt.gfpgan_model_path, opt.esrgan_bg_tile) if opt.restore: gfpgan, codeformer = restoration.load_face_restore_models() else: print('>> Face restoration disabled') if opt.esrgan: - esrgan = restoration.load_ersgan() + esrgan = restoration.load_esrgan() else: print('>> Upscaling disabled') except (ModuleNotFoundError, ImportError): From 7cf7ba42fb58a7094e59d65adb6504087f2fd32f Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 22 Sep 2022 00:32:26 +1000 Subject: [PATCH 06/46] Adds Restoration module, variations fix, cli args --- backend/modules/create_cmd_parser.py | 49 ++++++++++ backend/server.py | 95 ++++++++++++++----- .../{index.727a397b.js => index.632c341a.js} | 2 +- frontend/dist/index.html | 4 +- .../features/gallery/CurrentImageButtons.tsx | 4 +- .../src/features/gallery/HoverableImage.tsx | 6 +- .../features/gallery/ImageMetadataViewer.tsx | 17 ++-- .../features/options/SeedVariationOptions.tsx | 1 + 8 files changed, 132 insertions(+), 46 deletions(-) create mode 100644 backend/modules/create_cmd_parser.py rename frontend/dist/assets/{index.727a397b.js => index.632c341a.js} (96%) diff --git a/backend/modules/create_cmd_parser.py b/backend/modules/create_cmd_parser.py new file mode 100644 index 0000000000..06f2f4025c --- /dev/null +++ b/backend/modules/create_cmd_parser.py @@ -0,0 +1,49 @@ +import argparse +import os +from ldm.dream.args import PRECISION_CHOICES + + +def create_cmd_parser(): + parser = argparse.ArgumentParser(description="InvokeAI web UI") + parser.add_argument( + "--host", + type=str, + help="The host to serve on", + default="localhost", + ) + parser.add_argument("--port", type=int, help="The port to serve on", default=9090) + parser.add_argument( + "--cors", + nargs="*", + type=str, + help="Additional allowed origins, comma-separated", + ) + parser.add_argument( + "--embedding_path", + type=str, + help="Path to a pre-trained embedding manager checkpoint - can only be set on command line", + ) + # TODO: Can't get flask to serve images from any dir (saving to the dir does work when specified) + # parser.add_argument( + # "--output_dir", + # default="outputs/", + # type=str, + # help="Directory for output images", + # ) + parser.add_argument( + "-v", + "--verbose", + action="store_true", + help="Enables verbose logging", + ) + parser.add_argument( + "--precision", + dest="precision", + type=str, + choices=PRECISION_CHOICES, + metavar="PRECISION", + help=f'Set model precision. Defaults to auto selected based on device. Options: {", ".join(PRECISION_CHOICES)}', + default="auto", + ) + + return parser diff --git a/backend/server.py b/backend/server.py index 11d6c61502..b5a04a6e9b 100644 --- a/backend/server.py +++ b/backend/server.py @@ -8,6 +8,16 @@ import glob import shlex import math import shutil +import sys + +sys.path.append(".") + +from argparse import ArgumentTypeError +from modules.create_cmd_parser import create_cmd_parser + +parser = create_cmd_parser() +opt = parser.parse_args() + from flask_socketio import SocketIO from flask import Flask, send_from_directory, url_for, jsonify @@ -18,9 +28,9 @@ from threading import Event from uuid import uuid4 from send2trash import send2trash -from ldm.gfpgan.gfpgan_tools import real_esrgan_upscale -from ldm.gfpgan.gfpgan_tools import run_gfpgan + from ldm.generate import Generate +from ldm.dream.restoration import Restoration from ldm.dream.pngwriter import PngWriter, retrieve_metadata from ldm.dream.args import APP_ID, APP_VERSION, calculate_init_img_hash from ldm.dream.conditioning import split_weighted_subprompts @@ -31,15 +41,19 @@ from modules.parameters import parameters_to_command """ USER CONFIG """ +if opt.cors and "*" in opt.cors: + raise ArgumentTypeError('"*" is not an allowed CORS origin') + output_dir = "outputs/" # Base output directory for images -# host = 'localhost' # Web & socket.io host -host = "localhost" # Web & socket.io host -port = 9090 # Web & socket.io port -verbose = False # enables copious socket.io logging -additional_allowed_origins = [ - "http://localhost:5173" -] # additional CORS allowed origins +host = opt.host # Web & socket.io host +port = opt.port # Web & socket.io port +verbose = opt.verbose # enables copious socket.io logging +precision = opt.precision +embedding_path = opt.embedding_path +additional_allowed_origins = ( + opt.cors if opt.cors else [] +) # additional CORS allowed origins model = "stable-diffusion-1.4" """ @@ -47,6 +61,9 @@ END USER CONFIG """ +print("* Initializing, be patient...\n") + + """ SERVER SETUP """ @@ -103,6 +120,20 @@ class CanceledException(Exception): pass +try: + gfpgan, codeformer, esrgan = None, None, None + from ldm.dream.restoration.base import Restoration + + restoration = Restoration() + gfpgan, codeformer = restoration.load_face_restore_models() + esrgan = restoration.load_esrgan() + + # coreformer.process(self, image, strength, device, seed=None, fidelity=0.75) + +except (ModuleNotFoundError, ImportError): + print(traceback.format_exc(), file=sys.stderr) + print(">> You may need to install the ESRGAN and/or GFPGAN modules") + canceled = Event() # reduce logging outputs to error @@ -110,7 +141,11 @@ transformers.logging.set_verbosity_error() logging.getLogger("pytorch_lightning").setLevel(logging.ERROR) # Initialize and load model -generate = Generate(model) +generate = Generate( + model, + precision=precision, + embedding_path=embedding_path, +) generate.load_model() @@ -204,7 +239,7 @@ def handle_run_esrgan_event(original_image, esrgan_parameters): socketio.emit("progressUpdate", progress) eventlet.sleep(0) - image = real_esrgan_upscale( + image = esrgan.process( image=image, upsampler_scale=esrgan_parameters["upscale"][0], strength=esrgan_parameters["upscale"][1], @@ -275,11 +310,8 @@ def handle_run_gfpgan_event(original_image, gfpgan_parameters): socketio.emit("progressUpdate", progress) eventlet.sleep(0) - image = run_gfpgan( - image=image, - strength=gfpgan_parameters["gfpgan_strength"], - seed=seed, - upsampler_scale=1, + image = gfpgan.process( + image=image, strength=gfpgan_parameters["gfpgan_strength"], seed=seed ) progress["currentStatus"] = "Saving image" @@ -537,7 +569,11 @@ def generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters) canceled.clear() step_index = 1 - + prior_variations = ( + generation_parameters["with_variations"] + if "with_variations" in generation_parameters + else [] + ) """ If a result image is used as an init image, and then deleted, we will want to be able to use it as an init image in the future. Need to copy it. @@ -611,13 +647,14 @@ def generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters) socketio.emit("progressUpdate", progress) eventlet.sleep(0) - def image_done(image, seed): + def image_done(image, seed, first_seed): nonlocal generation_parameters nonlocal esrgan_parameters nonlocal gfpgan_parameters nonlocal progress step_index = 1 + nonlocal prior_variations progress["currentStatus"] = "Generation complete" socketio.emit("progressUpdate", progress) @@ -626,18 +663,27 @@ def generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters) all_parameters = generation_parameters postprocessing = False + if ( + "variation_amount" in all_parameters + and all_parameters["variation_amount"] > 0 + ): + first_seed = first_seed or seed + this_variation = [[seed, all_parameters["variation_amount"]]] + all_parameters["with_variations"] = prior_variations + this_variation + if esrgan_parameters: progress["currentStatus"] = "Upscaling" progress["currentStatusHasSteps"] = False socketio.emit("progressUpdate", progress) eventlet.sleep(0) - image = real_esrgan_upscale( + image = esrgan.process( image=image, - strength=esrgan_parameters["strength"], upsampler_scale=esrgan_parameters["level"], + strength=esrgan_parameters["strength"], seed=seed, ) + postprocessing = True all_parameters["upscale"] = [ esrgan_parameters["level"], @@ -650,16 +696,13 @@ def generate_images(generation_parameters, esrgan_parameters, gfpgan_parameters) socketio.emit("progressUpdate", progress) eventlet.sleep(0) - image = run_gfpgan( - image=image, - strength=gfpgan_parameters["strength"], - seed=seed, - upsampler_scale=1, + image = gfpgan.process( + image=image, strength=gfpgan_parameters["strength"], seed=seed ) postprocessing = True all_parameters["gfpgan_strength"] = gfpgan_parameters["strength"] - all_parameters["seed"] = seed + all_parameters["seed"] = first_seed progress["currentStatus"] = "Saving image" socketio.emit("progressUpdate", progress) eventlet.sleep(0) diff --git a/frontend/dist/assets/index.727a397b.js b/frontend/dist/assets/index.632c341a.js similarity index 96% rename from frontend/dist/assets/index.727a397b.js rename to frontend/dist/assets/index.632c341a.js index cc3b6e6fca..7328ca2fb4 100644 --- a/frontend/dist/assets/index.727a397b.js +++ b/frontend/dist/assets/index.632c341a.js @@ -682,7 +682,7 @@ __p += '`),Rn&&(Me+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Me+`return __p -}`;var dn=B1(function(){return Yn(j,pt+"return "+Me).apply(r,Y)});if(dn.source=Me,$l(dn))throw dn;return dn}function B_(l){return Kn(l).toLowerCase()}function Dg(l){return Kn(l).toUpperCase()}function U_(l,d,g){if(l=Kn(l),l&&(g||d===r))return hs(l);if(!l||!(d=qa(d)))return l;var N=Vo(l),M=Vo(d),j=ud(N,M),Y=Qy(N,M)+1;return xs(N,j,Y).join("")}function Mg(l,d,g){if(l=Kn(l),l&&(g||d===r))return l.slice(0,nb(l)+1);if(!l||!(d=qa(d)))return l;var N=Vo(l),M=Qy(N,Vo(d))+1;return xs(N,0,M).join("")}function z1(l,d,g){if(l=Kn(l),l&&(g||d===r))return l.replace(Pa,"");if(!l||!(d=qa(d)))return l;var N=Vo(l),M=ud(N,Vo(d));return xs(N,M).join("")}function j_(l,d){var g=se,N=Se;if(wr(d)){var M="separator"in d?d.separator:M;g="length"in d?rn(d.length):g,N="omission"in d?qa(d.omission):N}l=Kn(l);var j=l.length;if(Ec(l)){var Y=Vo(l);j=Y.length}if(g>=j)return l;var X=g-Ru(N);if(X<1)return N;var ie=Y?xs(Y,0,X).join(""):l.slice(0,X);if(M===r)return ie+N;if(Y&&(X+=ie.length-X),Gh(M)){if(l.slice(X).search(M)){var De,Ae=ie;for(M.global||(M=qs(M.source,Kn(jn.exec(M))+"g")),M.lastIndex=0;De=M.exec(Ae);)var Me=De.index;ie=ie.slice(0,Me===r?X:Me)}}else if(l.indexOf(qa(M),X)!=X){var Ze=ie.lastIndexOf(M);Ze>-1&&(ie=ie.slice(0,Ze))}return ie+N}function $_(l){return l=Kn(l),l&&ma.test(l)?l.replace(Un,TC):l}var V_=Kc(function(l,d,g){return l+(g?" ":"")+d.toUpperCase()}),Pg=Mb("toUpperCase");function Lg(l,d,g){return l=Kn(l),d=g?r:d,d===r?EC(l)?kC(l):vv(l):l.match(d)||[]}var B1=yn(function(l,d){try{return ht(l,r,d)}catch(g){return $l(g)?g:new nn(g)}}),H_=il(function(l,d){return _t(d,function(g){g=_i(g),gs(l,g,$h(l[g],l))}),l});function W_(l){var d=l==null?0:l.length,g=Ot();return l=d?On(l,function(N){if(typeof N[1]!="function")throw new Ui(u);return[g(N[0]),N[1]]}):[],yn(function(N){for(var M=-1;++Mxe)return[];var g=we,N=ia(l,we);d=Ot(d),l-=we;for(var M=rh(N,d);++g0||d<0)?new Tn(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),d!==r&&(d=rn(d),g=d<0?g.dropRight(-d):g.take(d-l)),g)},Tn.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Tn.prototype.toArray=function(){return this.take(we)},hr(Tn.prototype,function(l,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),N=/^(?:head|last)$/.test(d),M=I[N?"take"+(d=="last"?"Right":""):d],j=N||/^find/.test(d);!M||(I.prototype[d]=function(){var Y=this.__wrapped__,X=N?[1]:arguments,ie=Y instanceof Tn,De=X[0],Ae=ie||on(Y),Me=function(bn){var Rn=M.apply(I,xi([bn],X));return N&&Ze?Rn[0]:Rn};Ae&&g&&typeof De=="function"&&De.length!=1&&(ie=Ae=!1);var Ze=this.__chain__,pt=!!this.__actions__.length,Dt=j&&!Ze,dn=ie&&!pt;if(!j&&Ae){Y=dn?Y:new Tn(this);var Lt=l.apply(Y,X);return Lt.__actions__.push({func:Uh,args:[Me],thisArg:r}),new lo(Lt,Ze)}return Dt&&dn?l.apply(this,X):(Lt=this.thru(Me),Dt?N?Lt.value()[0]:Lt.value():Lt)})}),_t(["pop","push","shift","sort","splice","unshift"],function(l){var d=Ks[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",N=/^(?:pop|shift)$/.test(l);I.prototype[l]=function(){var M=arguments;if(N&&!this.__chain__){var j=this.value();return d.apply(on(j)?j:[],M)}return this[g](function(Y){return d.apply(on(Y)?Y:[],M)})}}),hr(Tn.prototype,function(l,d){var g=I[d];if(g){var N=g.name+"";Qn.call(Ic,N)||(Ic[N]=[]),Ic[N].push({name:d,func:g})}}),Ic[Zc(r,U).name]=[{name:"wrapper",func:r}],Tn.prototype.clone=Mt,Tn.prototype.reverse=Bc,Tn.prototype.value=Ur,I.prototype.at=kw,I.prototype.chain=Ow,I.prototype.commit=Dw,I.prototype.next=i1,I.prototype.plant=Yd,I.prototype.reverse=Mw,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=o1,I.prototype.first=I.prototype.head,hd&&(I.prototype[hd]=pg),I},Rc=OC();A?((A.exports=Rc)._=Rc,b._=Rc):Wt._=Rc}).call(hc)})(Wr,Wr.exports);const Hfe={currentImageUuid:"",images:[]},PF=Jk({name:"gallery",initialState:Hfe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const r=t.payload,i=e.images.filter(o=>o.uuid!==r);if(r===e.currentImageUuid){const o=e.images.findIndex(u=>u.uuid===r),c=Wr.exports.clamp(o-1,0,i.length-1);e.currentImage=i.length?i[c]:void 0,e.currentImageUuid=i.length?i[c].uuid:""}e.images=i},addImage:(e,t)=>{e.images.push(t.payload),e.currentImageUuid=t.payload.uuid,e.intermediateImage=void 0,e.currentImage=t.payload},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},setGalleryImages:(e,t)=>{const r=t.payload;if(r.length){const i=r[r.length-1];e.images=r,e.currentImage=i,e.currentImageUuid=i.uuid}}}}),{addImage:Cx,clearIntermediateImage:q6,removeImage:Wfe,setCurrentImage:Gfe,setGalleryImages:Yfe,setIntermediateImage:qfe}=PF.actions,Kfe=PF.reducer,Zfe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:""},Xfe=Zfe,LF=Jk({name:"system",initialState:Xfe,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)=>{const r=!t.payload.isProcessing&&e.isConnected?"Connected":t.payload.currentStatus;return{...e,...t.payload,currentStatus:r}},addLogEntry:(e,t)=>{const{timestamp:r,message:i,level:o}=t.payload,u={timestamp:r,message:i,level:o||"info"};e.log.push(u)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload},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})}}),{setShouldDisplayInProgress:Qfe,setIsProcessing:ou,addLogEntry:Ji,setShouldShowLogViewer:Jfe,setIsConnected:K6,setSocketId:Bme,setShouldConfirmOnDelete:IF,setOpenAccordions:ede,setSystemStatus:tde,setCurrentStatus:Z6,setSystemConfig:nde}=LF.actions,rde=LF.reducer,xu=Object.create(null);xu.open="0";xu.close="1";xu.ping="2";xu.pong="3";xu.message="4";xu.upgrade="5";xu.noop="6";const Gx=Object.create(null);Object.keys(xu).forEach(e=>{Gx[xu[e]]=e});const ade={type:"error",data:"parser error"},ide=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ode=typeof ArrayBuffer=="function",sde=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,FF=({type:e,data:t},r,i)=>ide&&t instanceof Blob?r?i(t):X6(t,i):ode&&(t instanceof ArrayBuffer||sde(t))?r?i(t):X6(new Blob([t]),i):i(xu[e]+(t||"")),X6=(e,t)=>{const r=new FileReader;return r.onload=function(){const i=r.result.split(",")[1];t("b"+i)},r.readAsDataURL(e)},Q6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$0=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,i,o=0,c,u,h,m;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const v=new ArrayBuffer(t),S=new Uint8Array(v);for(i=0;i>4,S[o++]=(u&15)<<4|h>>2,S[o++]=(h&3)<<6|m&63;return v},ude=typeof ArrayBuffer=="function",zF=(e,t)=>{if(typeof e!="string")return{type:"message",data:BF(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:cde(e.substring(1),t)}:Gx[r]?e.length>1?{type:Gx[r],data:e.substring(1)}:{type:Gx[r]}:ade},cde=(e,t)=>{if(ude){const r=lde(e);return BF(r,t)}else return{base64:!0,data:e}},BF=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},UF=String.fromCharCode(30),fde=(e,t)=>{const r=e.length,i=new Array(r);let o=0;e.forEach((c,u)=>{FF(c,!1,h=>{i[u]=h,++o===r&&t(i.join(UF))})})},dde=(e,t)=>{const r=e.split(UF),i=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function $F(e,...t){return t.reduce((r,i)=>(e.hasOwnProperty(i)&&(r[i]=e[i]),r),{})}const hde=setTimeout,mde=clearTimeout;function bC(e,t){t.useNativeTimers?(e.setTimeoutFn=hde.bind($f),e.clearTimeoutFn=mde.bind($f)):(e.setTimeoutFn=setTimeout.bind($f),e.clearTimeoutFn=clearTimeout.bind($f))}const vde=1.33;function gde(e){return typeof e=="string"?yde(e):Math.ceil((e.byteLength||e.size)*vde)}function yde(e){let t=0,r=0;for(let i=0,o=e.length;i=57344?r+=3:(i++,r+=4);return r}class bde extends Error{constructor(t,r,i){super(t),this.description=r,this.context=i,this.type="TransportError"}}class VF extends pa{constructor(t){super(),this.writable=!1,bC(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,r,i){return super.emitReserved("error",new bde(t,r,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 r=zF(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const HF="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),oA=64,Sde={};let J6=0,wx=0,eL;function tL(e){let t="";do t=HF[e%oA]+t,e=Math.floor(e/oA);while(e>0);return t}function WF(){const e=tL(+new Date);return e!==eL?(J6=0,eL=e):e+"."+tL(J6++)}for(;wx{this.readyState="paused",t()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||r()})),this.writable||(i++,this.once("drain",function(){--i||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=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)};dde(t,this.socket.binaryType).forEach(r),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,fde(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const r=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=WF()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(r==="https"&&Number(this.opts.port)!==443||r==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=GF(t),c=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(c?"["+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 gu(this.uri(),t)}doWrite(t,r){const i=this.request({method:"POST",data:t});i.on("success",r),i.on("error",(o,c)=>{this.onError("xhr post error",o,c)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,i)=>{this.onError("xhr poll error",r,i)}),this.pollXhr=t}}class gu extends pa{constructor(t,r){super(),bC(this,r),this.opts=r,this.method=r.method||"GET",this.uri=t,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.create()}create(){const t=$F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const r=this.xhr=new qF(t);try{r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=gu.requestsCount++,gu.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=wde,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete gu.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()}}gu.requestsCount=0;gu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nL);else if(typeof addEventListener=="function"){const e="onpagehide"in $f?"pagehide":"unload";addEventListener(e,nL,!1)}}function nL(){for(let e in gu.requests)gu.requests.hasOwnProperty(e)&&gu.requests[e].abort()}const Ede=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0))(),_x=$f.WebSocket||$f.MozWebSocket,rL=!0,Tde="arraybuffer",aL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Rde extends VF{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),r=this.opts.protocols,i=aL?{}:$F(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=rL&&!aL?r?new _x(t,r):new _x(t):new _x(t,r,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||Tde,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 r=0;r{const u={};try{rL&&this.ws.send(c)}catch{}o&&Ede(()=>{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 r=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(r==="wss"&&Number(this.opts.port)!==443||r==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=WF()),this.supportsBinary||(t.b64=1);const o=GF(t),c=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(c?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!_x}}const Ade={websocket:Rde,polling:Nde},kde=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ode=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sA(e){const t=e,r=e.indexOf("["),i=e.indexOf("]");r!=-1&&i!=-1&&(e=e.substring(0,r)+e.substring(r,i).replace(/:/g,";")+e.substring(i,e.length));let o=kde.exec(e||""),c={},u=14;for(;u--;)c[Ode[u]]=o[u]||"";return r!=-1&&i!=-1&&(c.source=t,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Dde(c,c.path),c.queryKey=Mde(c,c.query),c}function Dde(e,t){const r=/\/{2,9}/g,i=t.replace(r,"/").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 Mde(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,c){o&&(r[o]=c)}),r}class Ff extends pa{constructor(t,r={}){super(),t&&typeof t=="object"&&(r=t,t=null),t?(t=sA(t),r.hostname=t.host,r.secure=t.protocol==="https"||t.protocol==="wss",r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=sA(r.host).host),bC(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=xde(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 r=Object.assign({},this.opts.query);r.EIO=jF,r.transport=t,this.id&&(r.sid=this.id);const i=Object.assign({},this.opts.transportOptions[t],this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Ade[t](i)}open(){let t;if(this.opts.rememberUpgrade&&Ff.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",r=>this.onClose("transport close",r))}probe(t){let r=this.createTransport(t),i=!1;Ff.priorWebsocketSuccess=!1;const o=()=>{i||(r.send([{type:"ping",data:"probe"}]),r.once("packet",x=>{if(!i)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Ff.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(S(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function c(){i||(i=!0,S(),r.close(),r=null)}const u=x=>{const w=new Error("probe error: "+x);w.transport=r.name,c(),this.emitReserved("upgradeError",w)};function h(){u("transport closed")}function m(){u("socket closed")}function v(x){r&&x.name!==r.name&&c()}const S=()=>{r.removeListener("open",o),r.removeListener("error",u),r.removeListener("close",h),this.off("close",m),this.off("upgrading",v)};r.once("open",o),r.once("error",u),r.once("close",h),this.once("close",m),this.once("upgrading",v),r.open()}onOpen(){if(this.readyState="open",Ff.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const r=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 r=1;for(let i=0;i0&&r>this.maxPayload)return this.writeBuffer.slice(0,i);r+=2}return this.writeBuffer}write(t,r,i){return this.sendPacket("message",t,r,i),this}send(t,r,i){return this.sendPacket("message",t,r,i),this}sendPacket(t,r,i,o){if(typeof r=="function"&&(o=r,r=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const c={type:t,data:r,options:i};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},i=()=>{this.once("upgrade",r),this.once("upgradeError",r)};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){Ff.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,r){(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,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const r=[];let i=0;const o=t.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,KF=Object.prototype.toString,Fde=typeof Blob=="function"||typeof Blob<"u"&&KF.call(Blob)==="[object BlobConstructor]",zde=typeof File=="function"||typeof File<"u"&&KF.call(File)==="[object FileConstructor]";function lO(e){return Lde&&(e instanceof ArrayBuffer||Ide(e))||Fde&&e instanceof Blob||zde&&e instanceof File}function Yx(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,i=e.length;r=0&&e.num0;case Gn.ACK:case Gn.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Vde{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=Ude(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Hde=Object.freeze(Object.defineProperty({__proto__:null,protocol:jde,get PacketType(){return Gn},Encoder:$de,Decoder:uO},Symbol.toStringTag,{value:"Module"}));function Nl(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const Wde=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ZF extends pa{constructor(t,r,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,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=[Nl(t,"open",this.onopen.bind(this)),Nl(t,"packet",this.onpacket.bind(this)),Nl(t,"error",this.onerror.bind(this)),Nl(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,...r){if(Wde.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');r.unshift(t);const i={type:Gn.EVENT,data:r};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,h=r.pop();this._registerAckCallback(u,h),i.id=u}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,r){const i=this.flags.timeout;if(i===void 0){this.acks[t]=r;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c{this.io.clearTimeoutFn(o),r.apply(this,[null,...c])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:Gn.CONNECT,data:t})}):this.packet({type:Gn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Gn.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 Gn.EVENT:case Gn.BINARY_EVENT:this.onevent(t);break;case Gn.ACK:case Gn.BINARY_ACK:this.onack(t);break;case Gn.DISCONNECT:this.ondisconnect();break;case Gn.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 r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const i of r)i.apply(this,t)}super.emit.apply(this,t)}ack(t){const r=this;let i=!1;return function(...o){i||(i=!0,r.packet({type:Gn.ACK,id:t,data:o}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(r.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:Gn.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 r=this._anyListeners;for(let i=0;i0&&e.jitter<=1?e.jitter:0,this.attempts=0}hv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};hv.prototype.reset=function(){this.attempts=0};hv.prototype.setMin=function(e){this.ms=e};hv.prototype.setMax=function(e){this.max=e};hv.prototype.setJitter=function(e){this.jitter=e};class cA extends pa{constructor(t,r){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,bC(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((i=r.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new hv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const o=r.parser||Hde;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.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 r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.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 Ff(this.uri,this.opts);const r=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Nl(r,"open",function(){i.onopen(),t&&t()}),c=Nl(r,"error",u=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",u),t?t(u):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const u=this._timeout;u===0&&o();const h=this.setTimeoutFn(()=>{o(),r.close(),r.emit("error",new Error("timeout"))},u);this.opts.autoUnref&&h.unref(),this.subs.push(function(){clearTimeout(h)})}return this.subs.push(o),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nl(t,"ping",this.onping.bind(this)),Nl(t,"data",this.ondata.bind(this)),Nl(t,"error",this.onerror.bind(this)),Nl(t,"close",this.onclose.bind(this)),Nl(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,r){let i=this.nsps[t];return i||(i=new ZF(this,t,r),this.nsps[t]=i),i}_destroy(t){const r=Object.keys(this.nsps);for(const i of r)if(this.nsps[i].active)return;this._close()}_packet(t){const r=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,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),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 r=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()}))},r);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 P0={};function qx(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=Pde(e,t.path||"/socket.io"),i=r.source,o=r.id,c=r.path,u=P0[o]&&c in P0[o].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let m;return h?m=new cA(i,t):(P0[o]||(P0[o]=new cA(i,t)),m=P0[o]),r.query&&!t.query&&(t.query=r.queryKey),m.socket(r.path,t)}Object.assign(qx,{Manager:cA,Socket:ZF,io:qx,connect:qx});let Nx;const Gde=new Uint8Array(16);function Yde(){if(!Nx&&(Nx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nx(Gde)}const ui=[];for(let e=0;e<256;++e)ui.push((e+256).toString(16).slice(1));function qde(e,t=0){return(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase()}const Kde=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iL={randomUUID:Kde};function L0(e,t,r){if(iL.randomUUID&&!t&&!e)return iL.randomUUID();e=e||{};const i=e.random||(e.rng||Yde)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=i[o];return t}return qde(i)}var Zde=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Xde=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Qde=/[^-+\dA-Z]/g;function eo(e,t,r,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(oL[t]||t||oL.default);var o=t.slice(0,4);(o==="UTC:"||o==="GMT:")&&(t=t.slice(4),r=!0,o==="GMT:"&&(i=!0));var c=function(){return r?"getUTC":"get"},u=function(){return e[c()+"Date"]()},h=function(){return e[c()+"Day"]()},m=function(){return e[c()+"Month"]()},v=function(){return e[c()+"FullYear"]()},S=function(){return e[c()+"Hours"]()},x=function(){return e[c()+"Minutes"]()},w=function(){return e[c()+"Seconds"]()},_=function(){return e[c()+"Milliseconds"]()},R=function(){return r?0:e.getTimezoneOffset()},k=function(){return Jde(e)},P=function(){return epe(e)},U={d:function(){return u()},dd:function(){return Zo(u())},ddd:function(){return yo.dayNames[h()]},DDD:function(){return sL({y:v(),m:m(),d:u(),_:c(),dayName:yo.dayNames[h()],short:!0})},dddd:function(){return yo.dayNames[h()+7]},DDDD:function(){return sL({y:v(),m:m(),d:u(),_:c(),dayName:yo.dayNames[h()+7]})},m:function(){return m()+1},mm:function(){return Zo(m()+1)},mmm:function(){return yo.monthNames[m()]},mmmm:function(){return yo.monthNames[m()+12]},yy:function(){return String(v()).slice(2)},yyyy:function(){return Zo(v(),4)},h:function(){return S()%12||12},hh:function(){return Zo(S()%12||12)},H:function(){return S()},HH:function(){return Zo(S())},M:function(){return x()},MM:function(){return Zo(x())},s:function(){return w()},ss:function(){return Zo(w())},l:function(){return Zo(_(),3)},L:function(){return Zo(Math.floor(_()/10))},t:function(){return S()<12?yo.timeNames[0]:yo.timeNames[1]},tt:function(){return S()<12?yo.timeNames[2]:yo.timeNames[3]},T:function(){return S()<12?yo.timeNames[4]:yo.timeNames[5]},TT:function(){return S()<12?yo.timeNames[6]:yo.timeNames[7]},Z:function(){return i?"GMT":r?"UTC":tpe(e)},o:function(){return(R()>0?"-":"+")+Zo(Math.floor(Math.abs(R())/60)*100+Math.abs(R())%60,4)},p:function(){return(R()>0?"-":"+")+Zo(Math.floor(Math.abs(R())/60),2)+":"+Zo(Math.floor(Math.abs(R())%60),2)},S:function(){return["th","st","nd","rd"][u()%10>3?0:(u()%100-u()%10!=10)*u()%10]},W:function(){return k()},WW:function(){return Zo(k())},N:function(){return P()}};return t.replace(Zde,function(L){return L in U?U[L]():L.slice(1,L.length-1)})}var oL={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"},yo={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"]},Zo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(r,"0")},sL=function(t){var r=t.y,i=t.m,o=t.d,c=t._,u=t.dayName,h=t.short,m=h===void 0?!1:h,v=new Date,S=new Date;S.setDate(S[c+"Date"]()-1);var x=new Date;x.setDate(x[c+"Date"]()+1);var w=function(){return v[c+"Date"]()},_=function(){return v[c+"Month"]()},R=function(){return v[c+"FullYear"]()},k=function(){return S[c+"Date"]()},P=function(){return S[c+"Month"]()},U=function(){return S[c+"FullYear"]()},L=function(){return x[c+"Date"]()},F=function(){return x[c+"Month"]()},B=function(){return x[c+"FullYear"]()};return R()===r&&_()===i&&w()===o?m?"Tdy":"Today":U()===r&&P()===i&&k()===o?m?"Ysd":"Yesterday":B()===r&&F()===i&&L()===o?m?"Tmw":"Tomorrow":u},Jde=function(t){var r=new Date(t.getFullYear(),t.getMonth(),t.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=new Date(r.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var o=r.getTimezoneOffset()-i.getTimezoneOffset();r.setHours(r.getHours()-o);var c=(r-i)/(864e5*7);return 1+Math.floor(c)},epe=function(t){var r=t.getDay();return r===0&&(r=7),r},tpe=function(t){return(String(t).match(Xde)||[""]).pop().replace(Qde,"").replace(/GMT\+0000/g,"UTC")};const npe=e=>{const{dispatch:t,getState:r}=e;return{onConnect:()=>{try{t(K6(!0)),t(Z6("Connected"))}catch(i){console.error(i)}},onDisconnect:()=>{try{t(K6(!1)),t(ou(!1)),t(Z6("Disconnected")),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(i){console.error(i)}},onGenerationResult:i=>{try{const{url:o,metadata:c}=i,u=L0();t(Cx({uuid:u,url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image generated: ${o}`})),t(ou(!1))}catch(o){console.error(o)}},onIntermediateResult:i=>{try{const o=L0(),{url:c,metadata:u}=i;t(qfe({uuid:o,url:c,metadata:u})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Intermediate image generated: ${c}`})),t(ou(!1))}catch(o){console.error(o)}},onESRGANResult:i=>{try{const{url:o,metadata:c}=i;t(Cx({uuid:L0(),url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Upscaled: ${o}`})),t(ou(!1))}catch(o){console.error(o)}},onGFPGANResult:i=>{try{const{url:o,metadata:c}=i;t(Cx({uuid:L0(),url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Fixed faces: ${o}`}))}catch(o){console.error(o)}},onProgressUpdate:i=>{try{t(ou(!0)),t(tde(i))}catch(o){console.error(o)}},onError:i=>{const{message:o,additionalData:c}=i;try{t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Server error: ${o}`,level:"error"})),t(ou(!1)),t(q6())}catch(u){console.error(u)}},onGalleryImages:i=>{const{images:o}=i,c=o.map(u=>{const{url:h,metadata:m}=u;return{uuid:L0(),url:h,metadata:m}});t(Yfe(c)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Loaded ${o.length} images`}))},onProcessingCanceled:()=>{t(ou(!1));const{intermediateImage:i}=r().gallery;i&&(t(Cx(i)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Intermediate image saved: ${i.url}`})),t(q6())),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:i=>{const{url:o,uuid:c}=i;t(Wfe(c)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image deleted: ${o}`}))},onInitialImageUploaded:i=>{const{url:o}=i;t(yC(o)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Initial image uploaded: ${o}`}))},onMaskImageUploaded:i=>{const{url:o}=i;t(sO(o)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Mask image uploaded: ${o}`}))},onSystemConfig:i=>{t(nde(i))}}},rpe=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],ape=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024],ipe=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024],ope=[{key:"2x",value:2},{key:"4x",value:4}],fA=0,dA=4294967295,XF=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),spe=(e,t)=>{const{prompt:r,iterations:i,steps:o,cfgScale:c,height:u,width:h,sampler:m,seed:v,seamless:S,shouldUseInitImage:x,img2imgStrength:w,initialImagePath:_,maskPath:R,shouldFitToWidthHeight:k,shouldGenerateVariations:P,variationAmount:U,seedWeights:L,shouldRunESRGAN:F,upscalingLevel:B,upscalingStrength:$,shouldRunGFPGAN:K,gfpganStrength:Z,shouldRandomizeSeed:fe}=e,{shouldDisplayInProgress:me}=t,se={prompt:r,iterations:i,steps:o,cfg_scale:c,height:u,width:h,sampler_name:m,seed:v,seamless:S,progress_images:me};se.seed=fe?XF(fA,dA):v,x&&(se.init_img=_,se.strength=w,se.fit=k,R&&(se.init_mask=R)),P?(se.variation_amount=U,L&&(se.with_variations=Mfe(L))):se.variation_amount=0;let Se=!1,Ke=!1;return F&&(Se={level:B,strength:$}),K&&(Ke={strength:Z}),{generationParameters:se,esrganParameters:Se,gfpganParameters:Ke}},lpe=(e,t)=>{const{dispatch:r,getState:i}=e;return{emitGenerateImage:()=>{r(ou(!0));const{generationParameters:o,esrganParameters:c,gfpganParameters:u}=spe(i().options,i().system);t.emit("generateImage",o,c,u),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...o,...c,...u})}`}))},emitRunESRGAN:o=>{r(ou(!0));const{upscalingLevel:c,upscalingStrength:u}=i().options,h={upscale:[c,u]};t.emit("runESRGAN",o,h),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:o.url,...h})}`}))},emitRunGFPGAN:o=>{r(ou(!0));const{gfpganStrength:c}=i().options,u={gfpgan_strength:c};t.emit("runGFPGAN",o,u),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`GFPGAN fix faces requested: ${JSON.stringify({file:o.url,...u})}`}))},emitDeleteImage:o=>{const{url:c,uuid:u}=o;t.emit("deleteImage",c,u)},emitRequestAllImages:()=>{t.emit("requestAllImages")},emitCancelProcessing:()=>{t.emit("cancel")},emitUploadInitialImage:o=>{t.emit("uploadInitialImage",o,o.name)},emitUploadMaskImage:o=>{t.emit("uploadMaskImage",o,o.name)},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")}}},upe=()=>{const{hostname:e,port:t}=new URL(window.location.href),r=qx(`http://${e}:9090`);let i=!1;return c=>u=>h=>{const{onConnect:m,onDisconnect:v,onError:S,onESRGANResult:x,onGFPGANResult:w,onGenerationResult:_,onIntermediateResult:R,onProgressUpdate:k,onGalleryImages:P,onProcessingCanceled:U,onImageDeleted:L,onInitialImageUploaded:F,onMaskImageUploaded:B,onSystemConfig:$}=npe(c),{emitGenerateImage:K,emitRunESRGAN:Z,emitRunGFPGAN:fe,emitDeleteImage:me,emitRequestAllImages:se,emitCancelProcessing:Se,emitUploadInitialImage:Ke,emitUploadMaskImage:ae,emitRequestSystemConfig:ce}=lpe(c,r);switch(i||(r.on("connect",()=>m()),r.on("disconnect",()=>v()),r.on("error",ge=>S(ge)),r.on("generationResult",ge=>_(ge)),r.on("esrganResult",ge=>x(ge)),r.on("gfpganResult",ge=>w(ge)),r.on("intermediateResult",ge=>R(ge)),r.on("progressUpdate",ge=>k(ge)),r.on("galleryImages",ge=>P(ge)),r.on("processingCanceled",()=>{U()}),r.on("imageDeleted",ge=>{L(ge)}),r.on("initialImageUploaded",ge=>{F(ge)}),r.on("maskImageUploaded",ge=>{B(ge)}),r.on("systemConfig",ge=>{$(ge)}),i=!0),h.type){case"socketio/generateImage":{K();break}case"socketio/runESRGAN":{Z(h.payload);break}case"socketio/runGFPGAN":{fe(h.payload);break}case"socketio/deleteImage":{me(h.payload);break}case"socketio/requestAllImages":{se();break}case"socketio/cancelProcessing":{Se();break}case"socketio/uploadInitialImage":{Ke(h.payload);break}case"socketio/uploadMaskImage":{ae(h.payload);break}case"socketio/requestSystemConfig":{ce();break}}u(h)}},cpe={key:"root",storage:iO,blacklist:["gallery","system"]},fpe={key:"system",storage:iO,blacklist:["isConnected","isProcessing","currentStep","socketId","isESRGANAvailable","isGFPGANAvailable","currentStep","totalSteps","currentIteration","totalIterations","currentStatus"]},dpe=J8({options:Vfe,gallery:Kfe,system:xF(fpe,rde)}),ppe=xF(cpe,dpe),QF=Lce({reducer:ppe,middleware:e=>e({serializableCheck:!1}).concat(upe())}),pi=nfe,yr=Gce;function Kx(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kx=function(r){return typeof r}:Kx=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Kx(e)}function hpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lL(e,t){for(var r=0;r({textColor:e.colorMode==="dark"?"gray.800":"gray.100"})},Accordion:{baseStyle:e=>({button:{fontWeight:"bold",_hover:{bgColor:e.colorMode==="dark"?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"}},panel:{paddingBottom:2}})},FormLabel:{baseStyle:{fontWeight:"light"}},Button:{variants:{imageHoverIconButton:e=>({bg:e.colorMode==="dark"?"blackAlpha.700":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.700":"blackAlpha.700",_hover:{bg:e.colorMode==="dark"?"blackAlpha.800":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.900":"blackAlpha.900"}})}}}});var cL="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/Loading.tsx";const ez=()=>E(An,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:E(sC,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"},void 0,!1,{fileName:cL,lineNumber:11,columnNumber:13},void 0)},void 0,!1,{fileName:cL,lineNumber:5,columnNumber:9},void 0);var jm="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/@chakra-ui/icons/node_modules/@chakra-ui/icon/dist/index.esm.js",fL={path:E("g",{stroke:"currentColor",strokeWidth:"1.5",children:[E("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"},void 0,!1,{fileName:jm,lineNumber:14,columnNumber:22},globalThis),E("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"},void 0,!1,{fileName:jm,lineNumber:18,columnNumber:23},globalThis),E("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"},void 0,!1,{fileName:jm,lineNumber:22,columnNumber:23},globalThis)]},void 0,!0,{fileName:jm,lineNumber:11,columnNumber:25},globalThis),viewBox:"0 0 24 24"},tz=et((e,t)=>{const{as:r,viewBox:i,color:o="currentColor",focusable:c=!1,children:u,className:h,__css:m,...v}=e,S=Gr("chakra-icon",h),x={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...m},w={ref:t,focusable:c,className:S,__css:x},_=i??fL.viewBox;if(r&&typeof r!="string")return Be.createElement(Ge.svg,{as:r,...w,...v});const R=u??fL.path;return Be.createElement(Ge.svg,{verticalAlign:"middle",viewBox:_,...w,...v},R)});tz.displayName="Icon";function xt(e){const{viewBox:t="0 0 24 24",d:r,displayName:i,defaultProps:o={}}=e,c=D.exports.Children.toArray(e.path),u=et((h,m)=>E(tz,{ref:m,viewBox:t,...o,...h,children:c.length?c:E("path",{fill:"currentColor",d:r},void 0,!1,{fileName:jm,lineNumber:93,columnNumber:43},this)},void 0,!1,{fileName:jm,lineNumber:88,columnNumber:60},this));return u.displayName=i,u}var ut="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/@chakra-ui/icons/dist/index.esm.js";xt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});xt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});xt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});xt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});xt({displayName:"SunIcon",path:E("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[E("circle",{cx:"12",cy:"12",r:"5"},void 0,!1,{fileName:ut,lineNumber:42,columnNumber:22},globalThis),E("path",{d:"M12 1v2"},void 0,!1,{fileName:ut,lineNumber:46,columnNumber:23},globalThis),E("path",{d:"M12 21v2"},void 0,!1,{fileName:ut,lineNumber:48,columnNumber:23},globalThis),E("path",{d:"M4.22 4.22l1.42 1.42"},void 0,!1,{fileName:ut,lineNumber:50,columnNumber:23},globalThis),E("path",{d:"M18.36 18.36l1.42 1.42"},void 0,!1,{fileName:ut,lineNumber:52,columnNumber:23},globalThis),E("path",{d:"M1 12h2"},void 0,!1,{fileName:ut,lineNumber:54,columnNumber:23},globalThis),E("path",{d:"M21 12h2"},void 0,!1,{fileName:ut,lineNumber:56,columnNumber:23},globalThis),E("path",{d:"M4.22 19.78l1.42-1.42"},void 0,!1,{fileName:ut,lineNumber:58,columnNumber:23},globalThis),E("path",{d:"M18.36 5.64l1.42-1.42"},void 0,!1,{fileName:ut,lineNumber:60,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:36,columnNumber:25},globalThis)});xt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});xt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:E("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"},void 0,!1,{fileName:ut,lineNumber:77,columnNumber:25},globalThis)});xt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});xt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});xt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});xt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});xt({displayName:"ViewIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"},void 0,!1,{fileName:ut,lineNumber:119,columnNumber:22},globalThis),E("circle",{cx:"12",cy:"12",r:"2"},void 0,!1,{fileName:ut,lineNumber:121,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:117,columnNumber:25},globalThis)});xt({displayName:"ViewOffIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"},void 0,!1,{fileName:ut,lineNumber:134,columnNumber:22},globalThis),E("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"},void 0,!1,{fileName:ut,lineNumber:136,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:132,columnNumber:25},globalThis)});xt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});xt({displayName:"DeleteIcon",path:E("g",{fill:"currentColor",children:E("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"},void 0,!1,{fileName:ut,lineNumber:155,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:153,columnNumber:25},globalThis)});xt({displayName:"RepeatIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"},void 0,!1,{fileName:ut,lineNumber:166,columnNumber:22},globalThis),E("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"},void 0,!1,{fileName:ut,lineNumber:168,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:164,columnNumber:25},globalThis)});xt({displayName:"RepeatClockIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"},void 0,!1,{fileName:ut,lineNumber:179,columnNumber:22},globalThis),E("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"},void 0,!1,{fileName:ut,lineNumber:181,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:177,columnNumber:25},globalThis)});xt({displayName:"EditIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"},void 0,!1,{fileName:ut,lineNumber:195,columnNumber:22},globalThis),E("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"},void 0,!1,{fileName:ut,lineNumber:197,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:190,columnNumber:25},globalThis)});xt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});xt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});xt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});xt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});xt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});xt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});xt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});xt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});xt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var nz=xt({displayName:"ExternalLinkIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},void 0,!1,{fileName:ut,lineNumber:275,columnNumber:22},globalThis),E("path",{d:"M15 3h6v6"},void 0,!1,{fileName:ut,lineNumber:277,columnNumber:23},globalThis),E("path",{d:"M10 14L21 3"},void 0,!1,{fileName:ut,lineNumber:279,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:270,columnNumber:25},globalThis)});xt({displayName:"LinkIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"},void 0,!1,{fileName:ut,lineNumber:290,columnNumber:22},globalThis),E("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"},void 0,!1,{fileName:ut,lineNumber:292,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:288,columnNumber:25},globalThis)});xt({displayName:"PlusSquareIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"},void 0,!1,{fileName:ut,lineNumber:306,columnNumber:22},globalThis),E("path",{d:"M12 8v8"},void 0,!1,{fileName:ut,lineNumber:313,columnNumber:23},globalThis),E("path",{d:"M8 12h8"},void 0,!1,{fileName:ut,lineNumber:315,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:301,columnNumber:25},globalThis)});xt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});xt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});xt({displayName:"TimeIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"},void 0,!1,{fileName:ut,lineNumber:342,columnNumber:22},globalThis),E("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"},void 0,!1,{fileName:ut,lineNumber:344,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:340,columnNumber:25},globalThis)});xt({displayName:"ArrowRightIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"},void 0,!1,{fileName:ut,lineNumber:355,columnNumber:22},globalThis),E("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"},void 0,!1,{fileName:ut,lineNumber:357,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:353,columnNumber:25},globalThis)});xt({displayName:"ArrowLeftIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"},void 0,!1,{fileName:ut,lineNumber:368,columnNumber:22},globalThis),E("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"},void 0,!1,{fileName:ut,lineNumber:370,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:366,columnNumber:25},globalThis)});xt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});xt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});xt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});xt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});xt({displayName:"EmailIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"},void 0,!1,{fileName:ut,lineNumber:410,columnNumber:22},globalThis),E("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"},void 0,!1,{fileName:ut,lineNumber:412,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:408,columnNumber:25},globalThis)});xt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});xt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});xt({displayName:"SpinnerIcon",path:E(Li,{children:[E("defs",{children:E("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[E("stop",{stopColor:"currentColor",offset:"0%"},void 0,!1,{fileName:ut,lineNumber:443,columnNumber:22},globalThis),E("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"},void 0,!1,{fileName:ut,lineNumber:446,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:437,columnNumber:133},globalThis)},void 0,!1,{fileName:ut,lineNumber:437,columnNumber:83},globalThis),E("g",{transform:"translate(2)",fill:"none",children:[E("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"},void 0,!1,{fileName:ut,lineNumber:453,columnNumber:22},globalThis),E("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"},void 0,!1,{fileName:ut,lineNumber:459,columnNumber:23},globalThis),E("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"},void 0,!1,{fileName:ut,lineNumber:463,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:450,columnNumber:25},globalThis)]},void 0,!0)});xt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});xt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:E("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"},void 0,!1,{fileName:ut,lineNumber:484,columnNumber:25},globalThis)});xt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});xt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});xt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});xt({displayName:"InfoOutlineIcon",path:E("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[E("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"},void 0,!1,{fileName:ut,lineNumber:521,columnNumber:22},globalThis),E("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"},void 0,!1,{fileName:ut,lineNumber:527,columnNumber:23},globalThis),E("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"},void 0,!1,{fileName:ut,lineNumber:533,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:516,columnNumber:25},globalThis)});xt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});xt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});xt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});xt({displayName:"QuestionOutlineIcon",path:E("g",{stroke:"currentColor",strokeWidth:"1.5",children:[E("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"},void 0,!1,{fileName:ut,lineNumber:568,columnNumber:22},globalThis),E("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"},void 0,!1,{fileName:ut,lineNumber:572,columnNumber:23},globalThis),E("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"},void 0,!1,{fileName:ut,lineNumber:576,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:565,columnNumber:25},globalThis)});xt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});xt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});xt({viewBox:"0 0 14 14",path:E("g",{fill:"currentColor",children:E("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"},void 0,!1,{fileName:ut,lineNumber:605,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:603,columnNumber:25},globalThis)});xt({displayName:"MinusIcon",path:E("g",{fill:"currentColor",children:E("rect",{height:"4",width:"20",x:"2",y:"10"},void 0,!1,{fileName:ut,lineNumber:616,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:614,columnNumber:25},globalThis)});xt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});var rz={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dL=Be.createContext&&Be.createContext(rz),Qx="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/react-icons/lib/esm/iconBase.js",Yf=globalThis&&globalThis.__assign||function(){return Yf=Object.assign||function(e){for(var t,r=1,i=arguments.length;rE(An,{gap:2,children:[r&&E(Gf,{label:`Recall ${e}`,children:E(Co,{"aria-label":"Use this parameter",icon:E(iz,{},void 0,!1,{fileName:pn,lineNumber:54,columnNumber:19},void 0),size:"xs",variant:"ghost",fontSize:20,onClick:r},void 0,!1,{fileName:pn,lineNumber:52,columnNumber:11},void 0)},void 0,!1,{fileName:pn,lineNumber:51,columnNumber:9},void 0),E(Hr,{fontWeight:"semibold",whiteSpace:"nowrap",children:[e,":"]},void 0,!0,{fileName:pn,lineNumber:62,columnNumber:7},void 0),i?E(by,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",E(nz,{mx:"2px"},void 0,!1,{fileName:pn,lineNumber:67,columnNumber:30},void 0)]},void 0,!0,{fileName:pn,lineNumber:66,columnNumber:9},void 0):E(Hr,{maxHeight:100,overflowY:"scroll",wordBreak:"break-all",children:t.toString()},void 0,!1,{fileName:pn,lineNumber:70,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:49,columnNumber:5},void 0),kpe=(e,t)=>e.image.uuid===t.image.uuid,Ope=D.exports.memo(({image:e})=>{const t=pi(),r=Vf("blackAlpha.100","whiteAlpha.100"),i=e.metadata.image,{type:o,postprocessing:c,sampler:u,prompt:h,seed:m,variations:v,steps:S,cfg_scale:x,seamless:w,width:_,height:R,strength:k,fit:P,init_image_path:U,mask_image_path:L,orig_path:F,scale:B}=i,$=JSON.stringify(i,null,2);return E(An,{gap:1,direction:"column",overflowY:"scroll",width:"100%",children:[E(An,{gap:2,children:[E(Hr,{fontWeight:"semibold",children:"File:"},void 0,!1,{fileName:pn,lineNumber:129,columnNumber:9},void 0),E(by,{href:e.url,isExternal:!0,children:[e.url,E(nz,{mx:"2px"},void 0,!1,{fileName:pn,lineNumber:132,columnNumber:11},void 0)]},void 0,!0,{fileName:pn,lineNumber:130,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:128,columnNumber:7},void 0),Object.keys(i).length?E(Li,{children:[o&&E(ta,{label:"Type",value:o},void 0,!1,{fileName:pn,lineNumber:137,columnNumber:20},void 0),["esrgan","gfpgan"].includes(o)&&E(ta,{label:"Original image",value:F,isLink:!0},void 0,!1,{fileName:pn,lineNumber:139,columnNumber:13},void 0),o==="gfpgan"&&k&&E(ta,{label:"Fix faces strength",value:k,onClick:()=>t(rA(k))},void 0,!1,{fileName:pn,lineNumber:142,columnNumber:13},void 0),o==="esrgan"&&B&&E(ta,{label:"Upscaling scale",value:B,onClick:()=>t(aA(B))},void 0,!1,{fileName:pn,lineNumber:149,columnNumber:13},void 0),o==="esrgan"&&k&&E(ta,{label:"Upscaling strength",value:k,onClick:()=>t(iA(k))},void 0,!1,{fileName:pn,lineNumber:156,columnNumber:13},void 0),h&&E(ta,{label:"Prompt",value:eA(h),onClick:()=>t(NF(h))},void 0,!1,{fileName:pn,lineNumber:163,columnNumber:13},void 0),m&&E(ta,{label:"Seed",value:m,onClick:()=>t(Ay(m))},void 0,!1,{fileName:pn,lineNumber:170,columnNumber:13},void 0),u&&E(ta,{label:"Sampler",value:u,onClick:()=>t(AF(u))},void 0,!1,{fileName:pn,lineNumber:177,columnNumber:13},void 0),S&&E(ta,{label:"Steps",value:S,onClick:()=>t(EF(S))},void 0,!1,{fileName:pn,lineNumber:184,columnNumber:13},void 0),x&&E(ta,{label:"CFG scale",value:x,onClick:()=>t(TF(x))},void 0,!1,{fileName:pn,lineNumber:191,columnNumber:13},void 0),v&&v.length>0&&E(ta,{label:"Seed-weight pairs",value:tA(v),onClick:()=>t(DF(tA(v)))},void 0,!1,{fileName:pn,lineNumber:198,columnNumber:13},void 0),w&&E(ta,{label:"Seamless",value:w,onClick:()=>t(nA(w))},void 0,!1,{fileName:pn,lineNumber:207,columnNumber:13},void 0),_&&E(ta,{label:"Width",value:_,onClick:()=>t(nA(_))},void 0,!1,{fileName:pn,lineNumber:214,columnNumber:13},void 0),R&&E(ta,{label:"Height",value:R,onClick:()=>t(RF(R))},void 0,!1,{fileName:pn,lineNumber:221,columnNumber:13},void 0),U&&E(ta,{label:"Initial image",value:U,isLink:!0,onClick:()=>t(yC(U))},void 0,!1,{fileName:pn,lineNumber:228,columnNumber:13},void 0),L&&E(ta,{label:"Mask image",value:L,isLink:!0,onClick:()=>t(sO(L))},void 0,!1,{fileName:pn,lineNumber:236,columnNumber:13},void 0),o==="img2img"&&k&&E(ta,{label:"Image to image strength",value:k,onClick:()=>t(kF(k))},void 0,!1,{fileName:pn,lineNumber:244,columnNumber:13},void 0),P&&E(ta,{label:"Image to image fit",value:P,onClick:()=>t(OF(P))},void 0,!1,{fileName:pn,lineNumber:251,columnNumber:13},void 0),c&&c.length>0&&c.map(K=>{if(K.type==="esrgan"){const{scale:Z,strength:fe}=K;return E(Li,{children:[E(ta,{label:"Upscaling scale",value:Z,onClick:()=>t(aA(Z))},void 0,!1,{fileName:pn,lineNumber:265,columnNumber:23},void 0),E(ta,{label:"Upscaling strength",value:fe,onClick:()=>t(iA(fe))},void 0,!1,{fileName:pn,lineNumber:270,columnNumber:23},void 0)]},void 0,!0)}else if(K.type==="gfpgan"){const{strength:Z}=K;return E(ta,{label:"Fix faces strength",value:Z,onClick:()=>t(rA(Z))},void 0,!1,{fileName:pn,lineNumber:280,columnNumber:21},void 0)}}),E(An,{gap:2,direction:"column",children:[E(An,{gap:2,children:[E(Gf,{label:"Copy JSON",children:E(Co,{"aria-label":"Copy JSON",icon:E(_pe,{},void 0,!1,{fileName:pn,lineNumber:294,columnNumber:25},void 0),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)},void 0,!1,{fileName:pn,lineNumber:292,columnNumber:17},void 0)},void 0,!1,{fileName:pn,lineNumber:291,columnNumber:15},void 0),E(Hr,{fontWeight:"semibold",children:"JSON:"},void 0,!1,{fileName:pn,lineNumber:301,columnNumber:15},void 0)]},void 0,!0,{fileName:pn,lineNumber:290,columnNumber:13},void 0),E(bc,{overflow:"scroll",flexGrow:3,wordBreak:"break-all",bgColor:r,padding:2,children:E("pre",{children:$},void 0,!1,{fileName:pn,lineNumber:311,columnNumber:15},void 0)},void 0,!1,{fileName:pn,lineNumber:303,columnNumber:13},void 0)]},void 0,!0,{fileName:pn,lineNumber:289,columnNumber:11},void 0)]},void 0,!0):E(yy,{width:"100%",pt:10,children:E(Hr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"},void 0,!1,{fileName:pn,lineNumber:317,columnNumber:11},void 0)},void 0,!1,{fileName:pn,lineNumber:316,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:122,columnNumber:5},void 0)},kpe),oz=To("socketio/generateImage"),Dpe=To("socketio/runESRGAN"),Mpe=To("socketio/runGFPGAN"),Ppe=To("socketio/deleteImage"),Lpe=To("socketio/requestAllImages"),Ipe=To("socketio/cancelProcessing"),Fpe=To("socketio/uploadInitialImage"),zpe=To("socketio/uploadMaskImage"),Bpe=To("socketio/requestSystemConfig");var bo="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/DeleteImageModal.tsx";const Upe=Yr(e=>e.system,e=>e.shouldConfirmOnDelete),sz=D.exports.forwardRef(({image:e,children:t},r)=>{const{isOpen:i,onOpen:o,onClose:c}=_5(),u=pi(),h=yr(Upe),m=D.exports.useRef(null),v=w=>{w.stopPropagation(),h?o():S()},S=()=>{u(Ppe(e)),c()},x=w=>u(IF(!w.target.checked));return E(Li,{children:[D.exports.cloneElement(t,{onClick:v,ref:r}),E(Ene,{isOpen:i,leastDestructiveRef:m,onClose:c,children:E(w2,{children:E(Tne,{children:[E(Uk,{fontSize:"lg",fontWeight:"bold",children:"Delete image"},void 0,!1,{fileName:bo,lineNumber:89,columnNumber:15},void 0),E(x2,{children:E(An,{direction:"column",gap:5,children:[E(Hr,{children:"Are you sure? You can't undo this action afterwards."},void 0,!1,{fileName:bo,lineNumber:95,columnNumber:19},void 0),E(Xf,{children:E(An,{alignItems:"center",children:[E(Qf,{mb:0,children:"Don't ask me again"},void 0,!1,{fileName:bo,lineNumber:100,columnNumber:23},void 0),E(Wf,{checked:!h,onChange:x},void 0,!1,{fileName:bo,lineNumber:101,columnNumber:23},void 0)]},void 0,!0,{fileName:bo,lineNumber:99,columnNumber:21},void 0)},void 0,!1,{fileName:bo,lineNumber:98,columnNumber:19},void 0)]},void 0,!0,{fileName:bo,lineNumber:94,columnNumber:17},void 0)},void 0,!1,{fileName:bo,lineNumber:93,columnNumber:15},void 0),E(Bk,{children:[E(bu,{ref:m,onClick:c,children:"Cancel"},void 0,!1,{fileName:bo,lineNumber:110,columnNumber:17},void 0),E(bu,{colorScheme:"red",onClick:S,ml:3,children:"Delete"},void 0,!1,{fileName:bo,lineNumber:113,columnNumber:17},void 0)]},void 0,!0,{fileName:bo,lineNumber:109,columnNumber:15},void 0)]},void 0,!0,{fileName:bo,lineNumber:88,columnNumber:13},void 0)},void 0,!1,{fileName:bo,lineNumber:87,columnNumber:11},void 0)},void 0,!1,{fileName:bo,lineNumber:82,columnNumber:9},void 0)]},void 0,!0)});var jpe="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDButton.tsx";const pc=e=>{const{label:t,size:r="sm",...i}=e;return E(bu,{size:r,...i,children:t},void 0,!1,{fileName:jpe,lineNumber:15,columnNumber:5},void 0)};var fc="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/CurrentImageButtons.tsx";const $pe=Yr(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isGFPGANAvailable:e.isGFPGANAvailable,isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),Vpe=({image:e,shouldShowImageDetails:t,setShouldShowImageDetails:r})=>{const i=pi(),{intermediateImage:o}=yr(U=>U.gallery),{upscalingLevel:c,gfpganStrength:u}=yr(U=>U.options),{isProcessing:h,isConnected:m,isGFPGANAvailable:v,isESRGANAvailable:S}=yr($pe),x=()=>i(yC(e.url)),w=()=>i(MF(e.metadata)),_=()=>i(Ay(e.metadata.image.seed)),R=()=>i(Dpe(e)),k=()=>i(Mpe(e)),P=()=>r(!t);return E(An,{gap:2,children:[E(pc,{label:"Use as initial image",colorScheme:"gray",flexGrow:1,variant:"outline",onClick:x},void 0,!1,{fileName:fc,lineNumber:82,columnNumber:7},void 0),E(pc,{label:"Use all",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!["txt2img","img2img"].includes(e.metadata.image.type),onClick:w},void 0,!1,{fileName:fc,lineNumber:90,columnNumber:7},void 0),E(pc,{label:"Use seed",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!e.metadata.image.seed,onClick:_},void 0,!1,{fileName:fc,lineNumber:99,columnNumber:7},void 0),E(pc,{label:"Upscale",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!S||Boolean(o)||!(m&&!h)||!c,onClick:R},void 0,!1,{fileName:fc,lineNumber:108,columnNumber:7},void 0),E(pc,{label:"Fix faces",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!v||Boolean(o)||!(m&&!h)||!u,onClick:k},void 0,!1,{fileName:fc,lineNumber:121,columnNumber:7},void 0),E(pc,{label:"Details",colorScheme:"gray",variant:t?"solid":"outline",borderWidth:1,flexGrow:1,onClick:P},void 0,!1,{fileName:fc,lineNumber:134,columnNumber:7},void 0),E(sz,{image:e,children:E(pc,{label:"Delete",colorScheme:"red",flexGrow:1,variant:"outline",isDisabled:Boolean(o)},void 0,!1,{fileName:fc,lineNumber:143,columnNumber:9},void 0)},void 0,!1,{fileName:fc,lineNumber:142,columnNumber:7},void 0)]},void 0,!0,{fileName:fc,lineNumber:81,columnNumber:5},void 0)};var Af="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/CurrentImageDisplay.tsx";const Hpe="calc(100vh - 238px)",Wpe=()=>{const{currentImage:e,intermediateImage:t}=yr(u=>u.gallery),r=Vf("rgba(255, 255, 255, 0.85)","rgba(0, 0, 0, 0.8)"),[i,o]=D.exports.useState(!1),c=t||e;return c?E(An,{direction:"column",borderWidth:1,rounded:"md",p:2,gap:2,children:[E(Vpe,{image:c,shouldShowImageDetails:i,setShouldShowImageDetails:o},void 0,!1,{fileName:Af,lineNumber:31,columnNumber:7},void 0),E(yy,{height:Hpe,position:"relative",children:[E(gy,{src:c.url,fit:"contain",maxWidth:"100%",maxHeight:"100%"},void 0,!1,{fileName:Af,lineNumber:37,columnNumber:9},void 0),i&&E(An,{width:"100%",height:"100%",position:"absolute",top:0,left:0,p:3,boxSizing:"border-box",backgroundColor:r,overflow:"scroll",children:E(Ope,{image:c},void 0,!1,{fileName:Af,lineNumber:55,columnNumber:13},void 0)},void 0,!1,{fileName:Af,lineNumber:44,columnNumber:11},void 0)]},void 0,!0,{fileName:Af,lineNumber:36,columnNumber:7},void 0)]},void 0,!0,{fileName:Af,lineNumber:30,columnNumber:5},void 0):E(yy,{height:"100%",position:"relative",children:E(Hr,{size:"xl",children:"No image selected"},void 0,!1,{fileName:Af,lineNumber:62,columnNumber:7},void 0)},void 0,!1,{fileName:Af,lineNumber:61,columnNumber:5},void 0)};var Qi="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/HoverableImage.tsx";const Gpe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,Ype=D.exports.memo(e=>{const[t,r]=D.exports.useState(!1),i=pi(),o=Vf("green.600","green.300"),c=Vf("gray.200","gray.700"),u=Vf("radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.7) 20%, rgba(0,0,0,0) 100%)","radial-gradient(circle, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0) 100%)"),{image:h,isSelected:m}=e,{url:v,uuid:S,metadata:x}=h,w=()=>r(!0),_=()=>r(!1),R=U=>{U.stopPropagation(),i(MF(x))},k=U=>{U.stopPropagation(),i(Ay(h.metadata.image.seed))};return E(bc,{position:"relative",children:[E(gy,{width:120,height:120,objectFit:"cover",rounded:"md",src:v,loading:"lazy",backgroundColor:c},void 0,!1,{fileName:Qi,lineNumber:65,columnNumber:7},void 0),E(An,{cursor:"pointer",position:"absolute",top:0,left:0,rounded:"md",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",background:m?u:void 0,onClick:()=>i(Gfe(h)),onMouseOver:w,onMouseOut:_,children:[m&&E(kl,{fill:o,width:"50%",height:"50%",as:Cpe},void 0,!1,{fileName:Qi,lineNumber:90,columnNumber:11},void 0),t&&E(An,{direction:"column",gap:1,position:"absolute",top:1,right:1,children:[E(Gf,{label:"Delete image",children:E(sz,{image:h,children:E(Co,{colorScheme:"red","aria-label":"Delete image",icon:E(Ape,{},void 0,!1,{fileName:Qi,lineNumber:105,columnNumber:25},void 0),size:"xs",variant:"imageHoverIconButton",fontSize:14},void 0,!1,{fileName:Qi,lineNumber:102,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:101,columnNumber:15},void 0)},void 0,!1,{fileName:Qi,lineNumber:100,columnNumber:13},void 0),["txt2img","img2img"].includes(h.metadata.image.type)&&E(Gf,{label:"Use all parameters",children:E(Co,{"aria-label":"Use all parameters",icon:E(iz,{},void 0,!1,{fileName:Qi,lineNumber:116,columnNumber:25},void 0),size:"xs",fontSize:18,variant:"imageHoverIconButton",onClickCapture:R},void 0,!1,{fileName:Qi,lineNumber:114,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:113,columnNumber:15},void 0),h.metadata.image.seed&&E(Gf,{label:"Use seed",children:E(Co,{"aria-label":"Use seed",icon:E(Tpe,{},void 0,!1,{fileName:Qi,lineNumber:128,columnNumber:25},void 0),size:"xs",fontSize:16,variant:"imageHoverIconButton",onClickCapture:k},void 0,!1,{fileName:Qi,lineNumber:126,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:125,columnNumber:15},void 0)]},void 0,!0,{fileName:Qi,lineNumber:93,columnNumber:11},void 0)]},void 0,!0,{fileName:Qi,lineNumber:74,columnNumber:7},void 0)]},S,!0,{fileName:Qi,lineNumber:64,columnNumber:5},void 0)},Gpe);var Ex="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/ImageGallery.tsx";const qpe=()=>{const{images:e,currentImageUuid:t}=yr(r=>r.gallery);return e.length?E(An,{gap:2,wrap:"wrap",pb:2,children:[...e].reverse().map(r=>{const{uuid:i}=r;return E(Ype,{image:r,isSelected:t===i},i,!1,{fileName:Ex,lineNumber:28,columnNumber:11},void 0)})},void 0,!1,{fileName:Ex,lineNumber:23,columnNumber:5},void 0):E(yy,{height:"100%",position:"relative",children:E(Hr,{size:"xl",children:"No images in gallery"},void 0,!1,{fileName:Ex,lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:Ex,lineNumber:33,columnNumber:5},void 0)};var Kpe="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/ProgressBar.tsx";const Zpe=Yr(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),Xpe=()=>{const{isProcessing:e,currentStep:t,totalSteps:r,currentStatusHasSteps:i}=yr(Zpe),o=t?Math.round(t*100/r):0;return E(C8,{height:"10px",value:o,isIndeterminate:e&&!i},void 0,!1,{fileName:Kpe,lineNumber:30,columnNumber:5},void 0)};function Qpe(e){return ao({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function Jpe(e){return ao({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}var gr="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/SettingsModal.tsx";const ehe=Yr(e=>e.system,e=>{const{shouldDisplayInProgress:t,shouldConfirmOnDelete:r}=e;return{shouldDisplayInProgress:t,shouldConfirmOnDelete:r}},{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),the=({children:e})=>{const{isOpen:t,onOpen:r,onClose:i}=_5(),{isOpen:o,onOpen:c,onClose:u}=_5(),{shouldDisplayInProgress:h,shouldConfirmOnDelete:m}=yr(ehe),v=pi(),S=()=>{bz.purge().then(()=>{i(),c()})};return E(Li,{children:[D.exports.cloneElement(e,{onClick:r}),E(_y,{isOpen:t,onClose:i,children:[E(w2,{},void 0,!1,{fileName:gr,lineNumber:89,columnNumber:9},void 0),E(C2,{children:[E(Uk,{children:"Settings"},void 0,!1,{fileName:gr,lineNumber:91,columnNumber:11},void 0),E(d8,{},void 0,!1,{fileName:gr,lineNumber:92,columnNumber:11},void 0),E(x2,{children:E(An,{gap:5,direction:"column",children:[E(Xf,{children:E(g2,{children:[E(Qf,{marginBottom:1,children:"Display in-progress images (slower)"},void 0,!1,{fileName:gr,lineNumber:97,columnNumber:19},void 0),E(Wf,{isChecked:h,onChange:x=>v(Qfe(x.target.checked))},void 0,!1,{fileName:gr,lineNumber:100,columnNumber:19},void 0)]},void 0,!0,{fileName:gr,lineNumber:96,columnNumber:17},void 0)},void 0,!1,{fileName:gr,lineNumber:95,columnNumber:15},void 0),E(Xf,{children:E(g2,{children:[E(Qf,{marginBottom:1,children:"Confirm on delete"},void 0,!1,{fileName:gr,lineNumber:110,columnNumber:19},void 0),E(Wf,{isChecked:m,onChange:x=>v(IF(x.target.checked))},void 0,!1,{fileName:gr,lineNumber:111,columnNumber:19},void 0)]},void 0,!0,{fileName:gr,lineNumber:109,columnNumber:17},void 0)},void 0,!1,{fileName:gr,lineNumber:108,columnNumber:15},void 0),E(bk,{size:"md",children:"Reset Web UI"},void 0,!1,{fileName:gr,lineNumber:120,columnNumber:15},void 0),E(Hr,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."},void 0,!1,{fileName:gr,lineNumber:121,columnNumber:15},void 0),E(Hr,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."},void 0,!1,{fileName:gr,lineNumber:126,columnNumber:15},void 0),E(bu,{colorScheme:"red",onClick:S,children:"Reset Web UI"},void 0,!1,{fileName:gr,lineNumber:131,columnNumber:15},void 0)]},void 0,!0,{fileName:gr,lineNumber:94,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:93,columnNumber:11},void 0),E(Bk,{children:E(bu,{onClick:i,children:"Close"},void 0,!1,{fileName:gr,lineNumber:138,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:137,columnNumber:11},void 0)]},void 0,!0,{fileName:gr,lineNumber:90,columnNumber:9},void 0)]},void 0,!0,{fileName:gr,lineNumber:88,columnNumber:7},void 0),E(_y,{closeOnOverlayClick:!1,isOpen:o,onClose:u,isCentered:!0,children:[E(w2,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"},void 0,!1,{fileName:gr,lineNumber:149,columnNumber:9},void 0),E(C2,{children:E(x2,{pb:6,pt:6,children:E(An,{justifyContent:"center",children:E(Hr,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."},void 0,!1,{fileName:gr,lineNumber:153,columnNumber:15},void 0)},void 0,!1,{fileName:gr,lineNumber:152,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:151,columnNumber:11},void 0)},void 0,!1,{fileName:gr,lineNumber:150,columnNumber:9},void 0)]},void 0,!0,{fileName:gr,lineNumber:143,columnNumber:7},void 0)]},void 0,!0)};var Di="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/SiteHeader.tsx";const nhe=Yr(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),rhe=()=>{const{colorMode:e,toggleColorMode:t}=z2(),{isConnected:r,isProcessing:i,currentIteration:o,totalIterations:c,currentStatus:u}=yr(nhe),h=r?"green.500":"red.500",m=e=="light"?E(Epe,{},void 0,!1,{fileName:Di,lineNumber:50,columnNumber:48},void 0):E(Rpe,{},void 0,!1,{fileName:Di,lineNumber:50,columnNumber:61},void 0),v=e=="light"?18:20;let S=u;return i&&c>1&&(S+=` [${o}/${c}]`),E(An,{minWidth:"max-content",alignItems:"center",gap:"1",pl:2,pr:1,children:[E(bk,{size:"lg",children:"InvokeUI"},void 0,!1,{fileName:Di,lineNumber:65,columnNumber:7},void 0),E(s7,{},void 0,!1,{fileName:Di,lineNumber:67,columnNumber:7},void 0),E(Hr,{textColor:h,children:S},void 0,!1,{fileName:Di,lineNumber:69,columnNumber:7},void 0),E(the,{children:E(Co,{"aria-label":"Settings",variant:"link",fontSize:24,size:"sm",icon:E(Jpe,{},void 0,!1,{fileName:Di,lineNumber:77,columnNumber:17},void 0)},void 0,!1,{fileName:Di,lineNumber:72,columnNumber:9},void 0)},void 0,!1,{fileName:Di,lineNumber:71,columnNumber:7},void 0),E(Co,{"aria-label":"Link to Github Issues",variant:"link",fontSize:23,size:"sm",icon:E(by,{isExternal:!0,href:"http://github.com/lstein/stable-diffusion/issues",children:E(Qpe,{},void 0,!1,{fileName:Di,lineNumber:91,columnNumber:13},void 0)},void 0,!1,{fileName:Di,lineNumber:87,columnNumber:11},void 0)},void 0,!1,{fileName:Di,lineNumber:81,columnNumber:7},void 0),E(Co,{"aria-label":"Link to Github Repo",variant:"link",fontSize:20,size:"sm",icon:E(by,{isExternal:!0,href:"http://github.com/lstein/stable-diffusion",children:E(Spe,{},void 0,!1,{fileName:Di,lineNumber:103,columnNumber:13},void 0)},void 0,!1,{fileName:Di,lineNumber:102,columnNumber:11},void 0)},void 0,!1,{fileName:Di,lineNumber:96,columnNumber:7},void 0),E(Co,{"aria-label":"Toggle Dark Mode",onClick:t,variant:"link",size:"sm",fontSize:v,icon:m},void 0,!1,{fileName:Di,lineNumber:108,columnNumber:7},void 0)]},void 0,!0,{fileName:Di,lineNumber:64,columnNumber:5},void 0)};var dc="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDNumberInput.tsx";const qf=e=>{const{label:t,isDisabled:r=!1,fontSize:i="md",size:o="sm",width:c,isInvalid:u,...h}=e;return E(Xf,{isDisabled:r,width:c,isInvalid:u,children:E(An,{gap:2,justifyContent:"space-between",alignItems:"center",children:[t&&E(Qf,{marginBottom:1,children:E(Hr,{fontSize:i,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:dc,lineNumber:37,columnNumber:13},void 0)},void 0,!1,{fileName:dc,lineNumber:36,columnNumber:11},void 0),E(v8,{size:o,...h,keepWithinRange:!1,clampValueOnBlur:!0,children:[E(y8,{fontSize:"md"},void 0,!1,{fileName:dc,lineNumber:48,columnNumber:11},void 0),E(g8,{children:[E(x8,{},void 0,!1,{fileName:dc,lineNumber:50,columnNumber:13},void 0),E(S8,{},void 0,!1,{fileName:dc,lineNumber:51,columnNumber:13},void 0)]},void 0,!0,{fileName:dc,lineNumber:49,columnNumber:11},void 0)]},void 0,!0,{fileName:dc,lineNumber:42,columnNumber:9},void 0)]},void 0,!0,{fileName:dc,lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:dc,lineNumber:33,columnNumber:5},void 0)};var Tx="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDSwitch.tsx";const M2=e=>{const{label:t,isDisabled:r=!1,fontSize:i="md",size:o="md",width:c,...u}=e;return E(Xf,{isDisabled:r,width:c,children:E(An,{justifyContent:"space-between",alignItems:"center",children:[t&&E(Qf,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:Tx,lineNumber:30,columnNumber:11},void 0),E(Wf,{size:o,...u},void 0,!1,{fileName:Tx,lineNumber:39,columnNumber:9},void 0)]},void 0,!0,{fileName:Tx,lineNumber:28,columnNumber:7},void 0)},void 0,!1,{fileName:Tx,lineNumber:27,columnNumber:5},void 0)};var So="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SeedVariationOptions.tsx";const ahe=Yr(e=>e.options,e=>({variationAmount:e.variationAmount,seedWeights:e.seedWeights,shouldGenerateVariations:e.shouldGenerateVariations,shouldRandomizeSeed:e.shouldRandomizeSeed,seed:e.seed,iterations:e.iterations}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),ihe=()=>{const{shouldGenerateVariations:e,variationAmount:t,seedWeights:r,shouldRandomizeSeed:i,seed:o,iterations:c}=yr(ahe),u=pi(),h=R=>u(Lfe(Number(R))),m=R=>u($fe(R.target.checked)),v=R=>u(Ay(Number(R))),S=()=>u(Ay(XF(fA,dA))),x=R=>u(zfe(R.target.checked)),w=R=>u(Bfe(Number(R))),_=R=>u(DF(R.target.value));return E(An,{gap:2,direction:"column",children:[E(qf,{label:"Images to generate",step:1,min:1,precision:0,onChange:h,value:c},void 0,!1,{fileName:So,lineNumber:87,columnNumber:7},void 0),E(M2,{label:"Randomize seed on generation",isChecked:i,onChange:m},void 0,!1,{fileName:So,lineNumber:95,columnNumber:7},void 0),E(An,{gap:2,children:[E(qf,{label:"Seed",step:1,precision:0,flexGrow:1,min:fA,max:dA,isDisabled:i,isInvalid:o<0&&e,onChange:v,value:o},void 0,!1,{fileName:So,lineNumber:101,columnNumber:9},void 0),E(bu,{size:"sm",isDisabled:i,onClick:S,children:E(Hr,{pl:2,pr:2,children:"Shuffle"},void 0,!1,{fileName:So,lineNumber:118,columnNumber:11},void 0)},void 0,!1,{fileName:So,lineNumber:113,columnNumber:9},void 0)]},void 0,!0,{fileName:So,lineNumber:100,columnNumber:7},void 0),E(M2,{label:"Generate variations",isChecked:e,width:"auto",onChange:x},void 0,!1,{fileName:So,lineNumber:123,columnNumber:7},void 0),E(qf,{label:"Variation amount",value:t,step:.01,min:0,max:1,onChange:w},void 0,!1,{fileName:So,lineNumber:129,columnNumber:7},void 0),E(Xf,{isInvalid:e&&!(oO(r)||r===""),flexGrow:1,children:E(g2,{children:[E(Qf,{marginInlineEnd:0,marginBottom:1,children:E(Hr,{whiteSpace:"nowrap",children:"Seed Weights"},void 0,!1,{fileName:So,lineNumber:146,columnNumber:13},void 0)},void 0,!1,{fileName:So,lineNumber:145,columnNumber:11},void 0),E(vk,{size:"sm",value:r,onChange:_},void 0,!1,{fileName:So,lineNumber:148,columnNumber:11},void 0)]},void 0,!0,{fileName:So,lineNumber:144,columnNumber:9},void 0)},void 0,!1,{fileName:So,lineNumber:137,columnNumber:7},void 0)]},void 0,!0,{fileName:So,lineNumber:86,columnNumber:5},void 0)};var Rp="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDSelect.tsx";const P2=e=>{const{label:t,isDisabled:r,validValues:i,size:o="sm",fontSize:c="md",marginBottom:u=1,whiteSpace:h="nowrap",...m}=e;return E(Xf,{isDisabled:r,children:E(An,{justifyContent:"space-between",alignItems:"center",children:[E(Qf,{marginBottom:u,children:E(Hr,{fontSize:c,whiteSpace:h,children:t},void 0,!1,{fileName:Rp,lineNumber:34,columnNumber:11},void 0)},void 0,!1,{fileName:Rp,lineNumber:33,columnNumber:9},void 0),E(_8,{fontSize:c,size:o,...m,children:i.map(v=>typeof v=="string"||typeof v=="number"?E("option",{value:v,children:v},v,!1,{fileName:Rp,lineNumber:41,columnNumber:15},void 0):E("option",{value:v.value,children:v.key},v.value,!1,{fileName:Rp,lineNumber:45,columnNumber:15},void 0))},void 0,!1,{fileName:Rp,lineNumber:38,columnNumber:9},void 0)]},void 0,!0,{fileName:Rp,lineNumber:32,columnNumber:7},void 0)},void 0,!1,{fileName:Rp,lineNumber:31,columnNumber:5},void 0)};var Rx="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SamplerOptions.tsx";const ohe=Yr(e=>e.options,e=>({steps:e.steps,cfgScale:e.cfgScale,sampler:e.sampler}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),she=()=>{const e=pi(),{steps:t,cfgScale:r,sampler:i}=yr(ohe);return E(An,{gap:2,direction:"column",children:[E(qf,{label:"Steps",min:1,step:1,precision:0,onChange:h=>e(EF(Number(h))),value:t},void 0,!1,{fileName:Rx,lineNumber:50,columnNumber:7},void 0),E(qf,{label:"CFG scale",step:.5,onChange:h=>e(TF(Number(h))),value:r},void 0,!1,{fileName:Rx,lineNumber:58,columnNumber:7},void 0),E(P2,{label:"Sampler",value:i,onChange:h=>e(AF(h.target.value)),validValues:rpe},void 0,!1,{fileName:Rx,lineNumber:64,columnNumber:7},void 0)]},void 0,!0,{fileName:Rx,lineNumber:49,columnNumber:5},void 0)};var DR="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ESRGANOptions.tsx";const lhe=Yr(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),uhe=Yr(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),che=()=>{const e=pi(),{upscalingLevel:t,upscalingStrength:r}=yr(lhe),{isESRGANAvailable:i}=yr(uhe);return E(An,{direction:"column",gap:2,children:[E(P2,{isDisabled:!i,label:"Scale",value:t,onChange:u=>e(aA(Number(u.target.value))),validValues:ope},void 0,!1,{fileName:DR,lineNumber:67,columnNumber:7},void 0),E(qf,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:u=>e(iA(Number(u))),value:r},void 0,!1,{fileName:DR,lineNumber:74,columnNumber:7},void 0)]},void 0,!0,{fileName:DR,lineNumber:66,columnNumber:5},void 0)};var mL="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/GFPGANOptions.tsx";const fhe=Yr(e=>e.options,e=>({gfpganStrength:e.gfpganStrength}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),dhe=Yr(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),phe=()=>{const e=pi(),{gfpganStrength:t}=yr(fhe),{isGFPGANAvailable:r}=yr(dhe);return E(An,{direction:"column",gap:2,children:E(qf,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:o=>e(rA(Number(o))),value:t},void 0,!1,{fileName:mL,lineNumber:55,columnNumber:7},void 0)},void 0,!1,{fileName:mL,lineNumber:54,columnNumber:5},void 0)};var I0="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OutputOptions.tsx";const hhe=Yr(e=>e.options,e=>({height:e.height,width:e.width,seamless:e.seamless}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),mhe=()=>{const e=pi(),{height:t,width:r,seamless:i}=yr(hhe);return E(An,{gap:2,direction:"column",children:[E(An,{gap:2,children:[E(P2,{label:"Width",value:r,flexGrow:1,onChange:h=>e(nA(Number(h.target.value))),validValues:ape},void 0,!1,{fileName:I0,lineNumber:51,columnNumber:9},void 0),E(P2,{label:"Height",value:t,flexGrow:1,onChange:h=>e(RF(Number(h.target.value))),validValues:ipe},void 0,!1,{fileName:I0,lineNumber:58,columnNumber:9},void 0)]},void 0,!0,{fileName:I0,lineNumber:50,columnNumber:7},void 0),E(M2,{label:"Seamless tiling",fontSize:"md",isChecked:i,onChange:h=>e(Ife(h.target.checked))},void 0,!1,{fileName:I0,lineNumber:66,columnNumber:7},void 0)]},void 0,!0,{fileName:I0,lineNumber:49,columnNumber:5},void 0)};var vhe=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 Ky(e,t){var r=ghe(e);if(typeof r.path!="string"){var i=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof i=="string"&&i.length>0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function ghe(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var i=t.split(".").pop().toLowerCase(),o=vhe.get(i);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var yhe=[".DS_Store","Thumbs.db"];function bhe(e){return uv(this,void 0,void 0,function(){return cv(this,function(t){return L2(e)&&She(e.dataTransfer)?[2,_he(e.dataTransfer,e.type)]:xhe(e)?[2,Che(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,whe(e)]:[2,[]]})})}function She(e){return L2(e)}function xhe(e){return L2(e)&&L2(e.target)}function L2(e){return typeof e=="object"&&e!==null}function Che(e){return mA(e.target.files).map(function(t){return Ky(t)})}function whe(e){return uv(this,void 0,void 0,function(){var t;return cv(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(i){return Ky(i)})]}})})}function _he(e,t){return uv(this,void 0,void 0,function(){var r,i;return cv(this,function(o){switch(o.label){case 0:return e.items?(r=mA(e.items).filter(function(c){return c.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Nhe))]):[3,2];case 1:return i=o.sent(),[2,vL(lz(i))];case 2:return[2,vL(mA(e.files).map(function(c){return Ky(c)}))]}})})}function vL(e){return e.filter(function(t){return yhe.indexOf(t.name)===-1})}function mA(e){if(e===null)return[];for(var t=[],r=0;r=j)return l;var X=g-Ru(N);if(X<1)return N;var ie=Y?xs(Y,0,X).join(""):l.slice(0,X);if(M===r)return ie+N;if(Y&&(X+=ie.length-X),Gh(M)){if(l.slice(X).search(M)){var De,Ae=ie;for(M.global||(M=qs(M.source,Kn(jn.exec(M))+"g")),M.lastIndex=0;De=M.exec(Ae);)var Me=De.index;ie=ie.slice(0,Me===r?X:Me)}}else if(l.indexOf(qa(M),X)!=X){var Ze=ie.lastIndexOf(M);Ze>-1&&(ie=ie.slice(0,Ze))}return ie+N}function $_(l){return l=Kn(l),l&&ma.test(l)?l.replace(Un,TC):l}var V_=Kc(function(l,d,g){return l+(g?" ":"")+d.toUpperCase()}),Pg=Mb("toUpperCase");function Lg(l,d,g){return l=Kn(l),d=g?r:d,d===r?EC(l)?kC(l):vv(l):l.match(d)||[]}var B1=yn(function(l,d){try{return ht(l,r,d)}catch(g){return $l(g)?g:new nn(g)}}),H_=il(function(l,d){return _t(d,function(g){g=_i(g),gs(l,g,$h(l[g],l))}),l});function W_(l){var d=l==null?0:l.length,g=Ot();return l=d?On(l,function(N){if(typeof N[1]!="function")throw new Ui(u);return[g(N[0]),N[1]]}):[],yn(function(N){for(var M=-1;++Mxe)return[];var g=we,N=ia(l,we);d=Ot(d),l-=we;for(var M=rh(N,d);++g0||d<0)?new Tn(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),d!==r&&(d=rn(d),g=d<0?g.dropRight(-d):g.take(d-l)),g)},Tn.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Tn.prototype.toArray=function(){return this.take(we)},hr(Tn.prototype,function(l,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),N=/^(?:head|last)$/.test(d),M=I[N?"take"+(d=="last"?"Right":""):d],j=N||/^find/.test(d);!M||(I.prototype[d]=function(){var Y=this.__wrapped__,X=N?[1]:arguments,ie=Y instanceof Tn,De=X[0],Ae=ie||on(Y),Me=function(bn){var Rn=M.apply(I,xi([bn],X));return N&&Ze?Rn[0]:Rn};Ae&&g&&typeof De=="function"&&De.length!=1&&(ie=Ae=!1);var Ze=this.__chain__,pt=!!this.__actions__.length,Dt=j&&!Ze,dn=ie&&!pt;if(!j&&Ae){Y=dn?Y:new Tn(this);var Lt=l.apply(Y,X);return Lt.__actions__.push({func:Uh,args:[Me],thisArg:r}),new lo(Lt,Ze)}return Dt&&dn?l.apply(this,X):(Lt=this.thru(Me),Dt?N?Lt.value()[0]:Lt.value():Lt)})}),_t(["pop","push","shift","sort","splice","unshift"],function(l){var d=Ks[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",N=/^(?:pop|shift)$/.test(l);I.prototype[l]=function(){var M=arguments;if(N&&!this.__chain__){var j=this.value();return d.apply(on(j)?j:[],M)}return this[g](function(Y){return d.apply(on(Y)?Y:[],M)})}}),hr(Tn.prototype,function(l,d){var g=I[d];if(g){var N=g.name+"";Qn.call(Ic,N)||(Ic[N]=[]),Ic[N].push({name:d,func:g})}}),Ic[Zc(r,U).name]=[{name:"wrapper",func:r}],Tn.prototype.clone=Mt,Tn.prototype.reverse=Bc,Tn.prototype.value=Ur,I.prototype.at=kw,I.prototype.chain=Ow,I.prototype.commit=Dw,I.prototype.next=i1,I.prototype.plant=Yd,I.prototype.reverse=Mw,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=o1,I.prototype.first=I.prototype.head,hd&&(I.prototype[hd]=pg),I},Rc=OC();A?((A.exports=Rc)._=Rc,b._=Rc):Wt._=Rc}).call(hc)})(Wr,Wr.exports);const Hfe={currentImageUuid:"",images:[]},PF=Jk({name:"gallery",initialState:Hfe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const r=t.payload,i=e.images.filter(o=>o.uuid!==r);if(r===e.currentImageUuid){const o=e.images.findIndex(u=>u.uuid===r),c=Wr.exports.clamp(o-1,0,i.length-1);e.currentImage=i.length?i[c]:void 0,e.currentImageUuid=i.length?i[c].uuid:""}e.images=i},addImage:(e,t)=>{e.images.push(t.payload),e.currentImageUuid=t.payload.uuid,e.intermediateImage=void 0,e.currentImage=t.payload},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},setGalleryImages:(e,t)=>{const r=t.payload;if(r.length){const i=r[r.length-1];e.images=r,e.currentImage=i,e.currentImageUuid=i.uuid}}}}),{addImage:Cx,clearIntermediateImage:q6,removeImage:Wfe,setCurrentImage:Gfe,setGalleryImages:Yfe,setIntermediateImage:qfe}=PF.actions,Kfe=PF.reducer,Zfe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgress:!1,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:""},Xfe=Zfe,LF=Jk({name:"system",initialState:Xfe,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)=>{const r=!t.payload.isProcessing&&e.isConnected?"Connected":t.payload.currentStatus;return{...e,...t.payload,currentStatus:r}},addLogEntry:(e,t)=>{const{timestamp:r,message:i,level:o}=t.payload,u={timestamp:r,message:i,level:o||"info"};e.log.push(u)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload},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})}}),{setShouldDisplayInProgress:Qfe,setIsProcessing:ou,addLogEntry:Ji,setShouldShowLogViewer:Jfe,setIsConnected:K6,setSocketId:Bme,setShouldConfirmOnDelete:IF,setOpenAccordions:ede,setSystemStatus:tde,setCurrentStatus:Z6,setSystemConfig:nde}=LF.actions,rde=LF.reducer,xu=Object.create(null);xu.open="0";xu.close="1";xu.ping="2";xu.pong="3";xu.message="4";xu.upgrade="5";xu.noop="6";const Gx=Object.create(null);Object.keys(xu).forEach(e=>{Gx[xu[e]]=e});const ade={type:"error",data:"parser error"},ide=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ode=typeof ArrayBuffer=="function",sde=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,FF=({type:e,data:t},r,i)=>ide&&t instanceof Blob?r?i(t):X6(t,i):ode&&(t instanceof ArrayBuffer||sde(t))?r?i(t):X6(new Blob([t]),i):i(xu[e]+(t||"")),X6=(e,t)=>{const r=new FileReader;return r.onload=function(){const i=r.result.split(",")[1];t("b"+i)},r.readAsDataURL(e)},Q6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$0=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,i,o=0,c,u,h,m;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const v=new ArrayBuffer(t),S=new Uint8Array(v);for(i=0;i>4,S[o++]=(u&15)<<4|h>>2,S[o++]=(h&3)<<6|m&63;return v},ude=typeof ArrayBuffer=="function",zF=(e,t)=>{if(typeof e!="string")return{type:"message",data:BF(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:cde(e.substring(1),t)}:Gx[r]?e.length>1?{type:Gx[r],data:e.substring(1)}:{type:Gx[r]}:ade},cde=(e,t)=>{if(ude){const r=lde(e);return BF(r,t)}else return{base64:!0,data:e}},BF=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},UF=String.fromCharCode(30),fde=(e,t)=>{const r=e.length,i=new Array(r);let o=0;e.forEach((c,u)=>{FF(c,!1,h=>{i[u]=h,++o===r&&t(i.join(UF))})})},dde=(e,t)=>{const r=e.split(UF),i=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function $F(e,...t){return t.reduce((r,i)=>(e.hasOwnProperty(i)&&(r[i]=e[i]),r),{})}const hde=setTimeout,mde=clearTimeout;function bC(e,t){t.useNativeTimers?(e.setTimeoutFn=hde.bind($f),e.clearTimeoutFn=mde.bind($f)):(e.setTimeoutFn=setTimeout.bind($f),e.clearTimeoutFn=clearTimeout.bind($f))}const vde=1.33;function gde(e){return typeof e=="string"?yde(e):Math.ceil((e.byteLength||e.size)*vde)}function yde(e){let t=0,r=0;for(let i=0,o=e.length;i=57344?r+=3:(i++,r+=4);return r}class bde extends Error{constructor(t,r,i){super(t),this.description=r,this.context=i,this.type="TransportError"}}class VF extends pa{constructor(t){super(),this.writable=!1,bC(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,r,i){return super.emitReserved("error",new bde(t,r,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 r=zF(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const HF="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),oA=64,Sde={};let J6=0,wx=0,eL;function tL(e){let t="";do t=HF[e%oA]+t,e=Math.floor(e/oA);while(e>0);return t}function WF(){const e=tL(+new Date);return e!==eL?(J6=0,eL=e):e+"."+tL(J6++)}for(;wx{this.readyState="paused",t()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||r()})),this.writable||(i++,this.once("drain",function(){--i||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=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)};dde(t,this.socket.binaryType).forEach(r),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,fde(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const r=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=WF()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(r==="https"&&Number(this.opts.port)!==443||r==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=GF(t),c=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(c?"["+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 gu(this.uri(),t)}doWrite(t,r){const i=this.request({method:"POST",data:t});i.on("success",r),i.on("error",(o,c)=>{this.onError("xhr post error",o,c)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,i)=>{this.onError("xhr poll error",r,i)}),this.pollXhr=t}}class gu extends pa{constructor(t,r){super(),bC(this,r),this.opts=r,this.method=r.method||"GET",this.uri=t,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.create()}create(){const t=$F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const r=this.xhr=new qF(t);try{r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=gu.requestsCount++,gu.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=wde,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete gu.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()}}gu.requestsCount=0;gu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nL);else if(typeof addEventListener=="function"){const e="onpagehide"in $f?"pagehide":"unload";addEventListener(e,nL,!1)}}function nL(){for(let e in gu.requests)gu.requests.hasOwnProperty(e)&&gu.requests[e].abort()}const Ede=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0))(),_x=$f.WebSocket||$f.MozWebSocket,rL=!0,Tde="arraybuffer",aL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Rde extends VF{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),r=this.opts.protocols,i=aL?{}:$F(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=rL&&!aL?r?new _x(t,r):new _x(t):new _x(t,r,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||Tde,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 r=0;r{const u={};try{rL&&this.ws.send(c)}catch{}o&&Ede(()=>{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 r=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(r==="wss"&&Number(this.opts.port)!==443||r==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=WF()),this.supportsBinary||(t.b64=1);const o=GF(t),c=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(c?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!_x}}const Ade={websocket:Rde,polling:Nde},kde=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ode=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sA(e){const t=e,r=e.indexOf("["),i=e.indexOf("]");r!=-1&&i!=-1&&(e=e.substring(0,r)+e.substring(r,i).replace(/:/g,";")+e.substring(i,e.length));let o=kde.exec(e||""),c={},u=14;for(;u--;)c[Ode[u]]=o[u]||"";return r!=-1&&i!=-1&&(c.source=t,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=Dde(c,c.path),c.queryKey=Mde(c,c.query),c}function Dde(e,t){const r=/\/{2,9}/g,i=t.replace(r,"/").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 Mde(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,c){o&&(r[o]=c)}),r}class Ff extends pa{constructor(t,r={}){super(),t&&typeof t=="object"&&(r=t,t=null),t?(t=sA(t),r.hostname=t.host,r.secure=t.protocol==="https"||t.protocol==="wss",r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=sA(r.host).host),bC(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=xde(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 r=Object.assign({},this.opts.query);r.EIO=jF,r.transport=t,this.id&&(r.sid=this.id);const i=Object.assign({},this.opts.transportOptions[t],this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Ade[t](i)}open(){let t;if(this.opts.rememberUpgrade&&Ff.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",r=>this.onClose("transport close",r))}probe(t){let r=this.createTransport(t),i=!1;Ff.priorWebsocketSuccess=!1;const o=()=>{i||(r.send([{type:"ping",data:"probe"}]),r.once("packet",x=>{if(!i)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Ff.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(S(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function c(){i||(i=!0,S(),r.close(),r=null)}const u=x=>{const w=new Error("probe error: "+x);w.transport=r.name,c(),this.emitReserved("upgradeError",w)};function h(){u("transport closed")}function m(){u("socket closed")}function v(x){r&&x.name!==r.name&&c()}const S=()=>{r.removeListener("open",o),r.removeListener("error",u),r.removeListener("close",h),this.off("close",m),this.off("upgrading",v)};r.once("open",o),r.once("error",u),r.once("close",h),this.once("close",m),this.once("upgrading",v),r.open()}onOpen(){if(this.readyState="open",Ff.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const r=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 r=1;for(let i=0;i0&&r>this.maxPayload)return this.writeBuffer.slice(0,i);r+=2}return this.writeBuffer}write(t,r,i){return this.sendPacket("message",t,r,i),this}send(t,r,i){return this.sendPacket("message",t,r,i),this}sendPacket(t,r,i,o){if(typeof r=="function"&&(o=r,r=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const c={type:t,data:r,options:i};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},i=()=>{this.once("upgrade",r),this.once("upgradeError",r)};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){Ff.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,r){(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,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const r=[];let i=0;const o=t.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,KF=Object.prototype.toString,Fde=typeof Blob=="function"||typeof Blob<"u"&&KF.call(Blob)==="[object BlobConstructor]",zde=typeof File=="function"||typeof File<"u"&&KF.call(File)==="[object FileConstructor]";function lO(e){return Lde&&(e instanceof ArrayBuffer||Ide(e))||Fde&&e instanceof Blob||zde&&e instanceof File}function Yx(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,i=e.length;r=0&&e.num0;case Gn.ACK:case Gn.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Vde{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=Ude(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Hde=Object.freeze(Object.defineProperty({__proto__:null,protocol:jde,get PacketType(){return Gn},Encoder:$de,Decoder:uO},Symbol.toStringTag,{value:"Module"}));function Nl(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const Wde=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ZF extends pa{constructor(t,r,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,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=[Nl(t,"open",this.onopen.bind(this)),Nl(t,"packet",this.onpacket.bind(this)),Nl(t,"error",this.onerror.bind(this)),Nl(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,...r){if(Wde.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');r.unshift(t);const i={type:Gn.EVENT,data:r};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,h=r.pop();this._registerAckCallback(u,h),i.id=u}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,r){const i=this.flags.timeout;if(i===void 0){this.acks[t]=r;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c{this.io.clearTimeoutFn(o),r.apply(this,[null,...c])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:Gn.CONNECT,data:t})}):this.packet({type:Gn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Gn.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 Gn.EVENT:case Gn.BINARY_EVENT:this.onevent(t);break;case Gn.ACK:case Gn.BINARY_ACK:this.onack(t);break;case Gn.DISCONNECT:this.ondisconnect();break;case Gn.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 r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const i of r)i.apply(this,t)}super.emit.apply(this,t)}ack(t){const r=this;let i=!1;return function(...o){i||(i=!0,r.packet({type:Gn.ACK,id:t,data:o}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(r.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:Gn.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 r=this._anyListeners;for(let i=0;i0&&e.jitter<=1?e.jitter:0,this.attempts=0}hv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};hv.prototype.reset=function(){this.attempts=0};hv.prototype.setMin=function(e){this.ms=e};hv.prototype.setMax=function(e){this.max=e};hv.prototype.setJitter=function(e){this.jitter=e};class cA extends pa{constructor(t,r){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,bC(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((i=r.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new hv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const o=r.parser||Hde;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.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 r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.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 Ff(this.uri,this.opts);const r=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Nl(r,"open",function(){i.onopen(),t&&t()}),c=Nl(r,"error",u=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",u),t?t(u):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const u=this._timeout;u===0&&o();const h=this.setTimeoutFn(()=>{o(),r.close(),r.emit("error",new Error("timeout"))},u);this.opts.autoUnref&&h.unref(),this.subs.push(function(){clearTimeout(h)})}return this.subs.push(o),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nl(t,"ping",this.onping.bind(this)),Nl(t,"data",this.ondata.bind(this)),Nl(t,"error",this.onerror.bind(this)),Nl(t,"close",this.onclose.bind(this)),Nl(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,r){let i=this.nsps[t];return i||(i=new ZF(this,t,r),this.nsps[t]=i),i}_destroy(t){const r=Object.keys(this.nsps);for(const i of r)if(this.nsps[i].active)return;this._close()}_packet(t){const r=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,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),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 r=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()}))},r);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 P0={};function qx(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=Pde(e,t.path||"/socket.io"),i=r.source,o=r.id,c=r.path,u=P0[o]&&c in P0[o].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let m;return h?m=new cA(i,t):(P0[o]||(P0[o]=new cA(i,t)),m=P0[o]),r.query&&!t.query&&(t.query=r.queryKey),m.socket(r.path,t)}Object.assign(qx,{Manager:cA,Socket:ZF,io:qx,connect:qx});let Nx;const Gde=new Uint8Array(16);function Yde(){if(!Nx&&(Nx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nx(Gde)}const ui=[];for(let e=0;e<256;++e)ui.push((e+256).toString(16).slice(1));function qde(e,t=0){return(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase()}const Kde=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iL={randomUUID:Kde};function L0(e,t,r){if(iL.randomUUID&&!t&&!e)return iL.randomUUID();e=e||{};const i=e.random||(e.rng||Yde)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=i[o];return t}return qde(i)}var Zde=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Xde=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Qde=/[^-+\dA-Z]/g;function eo(e,t,r,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(oL[t]||t||oL.default);var o=t.slice(0,4);(o==="UTC:"||o==="GMT:")&&(t=t.slice(4),r=!0,o==="GMT:"&&(i=!0));var c=function(){return r?"getUTC":"get"},u=function(){return e[c()+"Date"]()},h=function(){return e[c()+"Day"]()},m=function(){return e[c()+"Month"]()},v=function(){return e[c()+"FullYear"]()},S=function(){return e[c()+"Hours"]()},x=function(){return e[c()+"Minutes"]()},w=function(){return e[c()+"Seconds"]()},_=function(){return e[c()+"Milliseconds"]()},R=function(){return r?0:e.getTimezoneOffset()},k=function(){return Jde(e)},P=function(){return epe(e)},U={d:function(){return u()},dd:function(){return Zo(u())},ddd:function(){return yo.dayNames[h()]},DDD:function(){return sL({y:v(),m:m(),d:u(),_:c(),dayName:yo.dayNames[h()],short:!0})},dddd:function(){return yo.dayNames[h()+7]},DDDD:function(){return sL({y:v(),m:m(),d:u(),_:c(),dayName:yo.dayNames[h()+7]})},m:function(){return m()+1},mm:function(){return Zo(m()+1)},mmm:function(){return yo.monthNames[m()]},mmmm:function(){return yo.monthNames[m()+12]},yy:function(){return String(v()).slice(2)},yyyy:function(){return Zo(v(),4)},h:function(){return S()%12||12},hh:function(){return Zo(S()%12||12)},H:function(){return S()},HH:function(){return Zo(S())},M:function(){return x()},MM:function(){return Zo(x())},s:function(){return w()},ss:function(){return Zo(w())},l:function(){return Zo(_(),3)},L:function(){return Zo(Math.floor(_()/10))},t:function(){return S()<12?yo.timeNames[0]:yo.timeNames[1]},tt:function(){return S()<12?yo.timeNames[2]:yo.timeNames[3]},T:function(){return S()<12?yo.timeNames[4]:yo.timeNames[5]},TT:function(){return S()<12?yo.timeNames[6]:yo.timeNames[7]},Z:function(){return i?"GMT":r?"UTC":tpe(e)},o:function(){return(R()>0?"-":"+")+Zo(Math.floor(Math.abs(R())/60)*100+Math.abs(R())%60,4)},p:function(){return(R()>0?"-":"+")+Zo(Math.floor(Math.abs(R())/60),2)+":"+Zo(Math.floor(Math.abs(R())%60),2)},S:function(){return["th","st","nd","rd"][u()%10>3?0:(u()%100-u()%10!=10)*u()%10]},W:function(){return k()},WW:function(){return Zo(k())},N:function(){return P()}};return t.replace(Zde,function(L){return L in U?U[L]():L.slice(1,L.length-1)})}var oL={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"},yo={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"]},Zo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(r,"0")},sL=function(t){var r=t.y,i=t.m,o=t.d,c=t._,u=t.dayName,h=t.short,m=h===void 0?!1:h,v=new Date,S=new Date;S.setDate(S[c+"Date"]()-1);var x=new Date;x.setDate(x[c+"Date"]()+1);var w=function(){return v[c+"Date"]()},_=function(){return v[c+"Month"]()},R=function(){return v[c+"FullYear"]()},k=function(){return S[c+"Date"]()},P=function(){return S[c+"Month"]()},U=function(){return S[c+"FullYear"]()},L=function(){return x[c+"Date"]()},F=function(){return x[c+"Month"]()},B=function(){return x[c+"FullYear"]()};return R()===r&&_()===i&&w()===o?m?"Tdy":"Today":U()===r&&P()===i&&k()===o?m?"Ysd":"Yesterday":B()===r&&F()===i&&L()===o?m?"Tmw":"Tomorrow":u},Jde=function(t){var r=new Date(t.getFullYear(),t.getMonth(),t.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=new Date(r.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var o=r.getTimezoneOffset()-i.getTimezoneOffset();r.setHours(r.getHours()-o);var c=(r-i)/(864e5*7);return 1+Math.floor(c)},epe=function(t){var r=t.getDay();return r===0&&(r=7),r},tpe=function(t){return(String(t).match(Xde)||[""]).pop().replace(Qde,"").replace(/GMT\+0000/g,"UTC")};const npe=e=>{const{dispatch:t,getState:r}=e;return{onConnect:()=>{try{t(K6(!0)),t(Z6("Connected"))}catch(i){console.error(i)}},onDisconnect:()=>{try{t(K6(!1)),t(ou(!1)),t(Z6("Disconnected")),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(i){console.error(i)}},onGenerationResult:i=>{try{const{url:o,metadata:c}=i,u=L0();t(Cx({uuid:u,url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image generated: ${o}`})),t(ou(!1))}catch(o){console.error(o)}},onIntermediateResult:i=>{try{const o=L0(),{url:c,metadata:u}=i;t(qfe({uuid:o,url:c,metadata:u})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Intermediate image generated: ${c}`})),t(ou(!1))}catch(o){console.error(o)}},onESRGANResult:i=>{try{const{url:o,metadata:c}=i;t(Cx({uuid:L0(),url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Upscaled: ${o}`})),t(ou(!1))}catch(o){console.error(o)}},onGFPGANResult:i=>{try{const{url:o,metadata:c}=i;t(Cx({uuid:L0(),url:o,metadata:c})),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Fixed faces: ${o}`}))}catch(o){console.error(o)}},onProgressUpdate:i=>{try{t(ou(!0)),t(tde(i))}catch(o){console.error(o)}},onError:i=>{const{message:o,additionalData:c}=i;try{t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Server error: ${o}`,level:"error"})),t(ou(!1)),t(q6())}catch(u){console.error(u)}},onGalleryImages:i=>{const{images:o}=i,c=o.map(u=>{const{url:h,metadata:m}=u;return{uuid:L0(),url:h,metadata:m}});t(Yfe(c)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Loaded ${o.length} images`}))},onProcessingCanceled:()=>{t(ou(!1));const{intermediateImage:i}=r().gallery;i&&(t(Cx(i)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Intermediate image saved: ${i.url}`})),t(q6())),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:i=>{const{url:o,uuid:c}=i;t(Wfe(c)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image deleted: ${o}`}))},onInitialImageUploaded:i=>{const{url:o}=i;t(yC(o)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Initial image uploaded: ${o}`}))},onMaskImageUploaded:i=>{const{url:o}=i;t(sO(o)),t(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Mask image uploaded: ${o}`}))},onSystemConfig:i=>{t(nde(i))}}},rpe=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_euler","k_euler_a","k_heun"],ape=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024],ipe=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024],ope=[{key:"2x",value:2},{key:"4x",value:4}],fA=0,dA=4294967295,XF=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),spe=(e,t)=>{const{prompt:r,iterations:i,steps:o,cfgScale:c,height:u,width:h,sampler:m,seed:v,seamless:S,shouldUseInitImage:x,img2imgStrength:w,initialImagePath:_,maskPath:R,shouldFitToWidthHeight:k,shouldGenerateVariations:P,variationAmount:U,seedWeights:L,shouldRunESRGAN:F,upscalingLevel:B,upscalingStrength:$,shouldRunGFPGAN:K,gfpganStrength:Z,shouldRandomizeSeed:fe}=e,{shouldDisplayInProgress:me}=t,se={prompt:r,iterations:i,steps:o,cfg_scale:c,height:u,width:h,sampler_name:m,seed:v,seamless:S,progress_images:me};se.seed=fe?XF(fA,dA):v,x&&(se.init_img=_,se.strength=w,se.fit=k,R&&(se.init_mask=R)),P?(se.variation_amount=U,L&&(se.with_variations=Mfe(L))):se.variation_amount=0;let Se=!1,Ke=!1;return F&&(Se={level:B,strength:$}),K&&(Ke={strength:Z}),{generationParameters:se,esrganParameters:Se,gfpganParameters:Ke}},lpe=(e,t)=>{const{dispatch:r,getState:i}=e;return{emitGenerateImage:()=>{r(ou(!0));const{generationParameters:o,esrganParameters:c,gfpganParameters:u}=spe(i().options,i().system);t.emit("generateImage",o,c,u),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...o,...c,...u})}`}))},emitRunESRGAN:o=>{r(ou(!0));const{upscalingLevel:c,upscalingStrength:u}=i().options,h={upscale:[c,u]};t.emit("runESRGAN",o,h),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:o.url,...h})}`}))},emitRunGFPGAN:o=>{r(ou(!0));const{gfpganStrength:c}=i().options,u={gfpgan_strength:c};t.emit("runGFPGAN",o,u),r(Ji({timestamp:eo(new Date,"isoDateTime"),message:`GFPGAN fix faces requested: ${JSON.stringify({file:o.url,...u})}`}))},emitDeleteImage:o=>{const{url:c,uuid:u}=o;t.emit("deleteImage",c,u)},emitRequestAllImages:()=>{t.emit("requestAllImages")},emitCancelProcessing:()=>{t.emit("cancel")},emitUploadInitialImage:o=>{t.emit("uploadInitialImage",o,o.name)},emitUploadMaskImage:o=>{t.emit("uploadMaskImage",o,o.name)},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")}}},upe=()=>{const{hostname:e,port:t}=new URL(window.location.href),r=qx(`http://${e}:9090`);let i=!1;return c=>u=>h=>{const{onConnect:m,onDisconnect:v,onError:S,onESRGANResult:x,onGFPGANResult:w,onGenerationResult:_,onIntermediateResult:R,onProgressUpdate:k,onGalleryImages:P,onProcessingCanceled:U,onImageDeleted:L,onInitialImageUploaded:F,onMaskImageUploaded:B,onSystemConfig:$}=npe(c),{emitGenerateImage:K,emitRunESRGAN:Z,emitRunGFPGAN:fe,emitDeleteImage:me,emitRequestAllImages:se,emitCancelProcessing:Se,emitUploadInitialImage:Ke,emitUploadMaskImage:ae,emitRequestSystemConfig:ce}=lpe(c,r);switch(i||(r.on("connect",()=>m()),r.on("disconnect",()=>v()),r.on("error",ge=>S(ge)),r.on("generationResult",ge=>_(ge)),r.on("esrganResult",ge=>x(ge)),r.on("gfpganResult",ge=>w(ge)),r.on("intermediateResult",ge=>R(ge)),r.on("progressUpdate",ge=>k(ge)),r.on("galleryImages",ge=>P(ge)),r.on("processingCanceled",()=>{U()}),r.on("imageDeleted",ge=>{L(ge)}),r.on("initialImageUploaded",ge=>{F(ge)}),r.on("maskImageUploaded",ge=>{B(ge)}),r.on("systemConfig",ge=>{$(ge)}),i=!0),h.type){case"socketio/generateImage":{K();break}case"socketio/runESRGAN":{Z(h.payload);break}case"socketio/runGFPGAN":{fe(h.payload);break}case"socketio/deleteImage":{me(h.payload);break}case"socketio/requestAllImages":{se();break}case"socketio/cancelProcessing":{Se();break}case"socketio/uploadInitialImage":{Ke(h.payload);break}case"socketio/uploadMaskImage":{ae(h.payload);break}case"socketio/requestSystemConfig":{ce();break}}u(h)}},cpe={key:"root",storage:iO,blacklist:["gallery","system"]},fpe={key:"system",storage:iO,blacklist:["isConnected","isProcessing","currentStep","socketId","isESRGANAvailable","isGFPGANAvailable","currentStep","totalSteps","currentIteration","totalIterations","currentStatus"]},dpe=J8({options:Vfe,gallery:Kfe,system:xF(fpe,rde)}),ppe=xF(cpe,dpe),QF=Lce({reducer:ppe,middleware:e=>e({serializableCheck:!1}).concat(upe())}),pi=nfe,yr=Gce;function Kx(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kx=function(r){return typeof r}:Kx=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Kx(e)}function hpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lL(e,t){for(var r=0;r({textColor:e.colorMode==="dark"?"gray.800":"gray.100"})},Accordion:{baseStyle:e=>({button:{fontWeight:"bold",_hover:{bgColor:e.colorMode==="dark"?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"}},panel:{paddingBottom:2}})},FormLabel:{baseStyle:{fontWeight:"light"}},Button:{variants:{imageHoverIconButton:e=>({bg:e.colorMode==="dark"?"blackAlpha.700":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.700":"blackAlpha.700",_hover:{bg:e.colorMode==="dark"?"blackAlpha.800":"whiteAlpha.800",color:e.colorMode==="dark"?"whiteAlpha.900":"blackAlpha.900"}})}}}});var cL="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/Loading.tsx";const ez=()=>E(An,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:E(sC,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"},void 0,!1,{fileName:cL,lineNumber:11,columnNumber:13},void 0)},void 0,!1,{fileName:cL,lineNumber:5,columnNumber:9},void 0);var jm="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/@chakra-ui/icons/node_modules/@chakra-ui/icon/dist/index.esm.js",fL={path:E("g",{stroke:"currentColor",strokeWidth:"1.5",children:[E("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"},void 0,!1,{fileName:jm,lineNumber:14,columnNumber:22},globalThis),E("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"},void 0,!1,{fileName:jm,lineNumber:18,columnNumber:23},globalThis),E("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"},void 0,!1,{fileName:jm,lineNumber:22,columnNumber:23},globalThis)]},void 0,!0,{fileName:jm,lineNumber:11,columnNumber:25},globalThis),viewBox:"0 0 24 24"},tz=et((e,t)=>{const{as:r,viewBox:i,color:o="currentColor",focusable:c=!1,children:u,className:h,__css:m,...v}=e,S=Gr("chakra-icon",h),x={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...m},w={ref:t,focusable:c,className:S,__css:x},_=i??fL.viewBox;if(r&&typeof r!="string")return Be.createElement(Ge.svg,{as:r,...w,...v});const R=u??fL.path;return Be.createElement(Ge.svg,{verticalAlign:"middle",viewBox:_,...w,...v},R)});tz.displayName="Icon";function xt(e){const{viewBox:t="0 0 24 24",d:r,displayName:i,defaultProps:o={}}=e,c=D.exports.Children.toArray(e.path),u=et((h,m)=>E(tz,{ref:m,viewBox:t,...o,...h,children:c.length?c:E("path",{fill:"currentColor",d:r},void 0,!1,{fileName:jm,lineNumber:93,columnNumber:43},this)},void 0,!1,{fileName:jm,lineNumber:88,columnNumber:60},this));return u.displayName=i,u}var ut="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/@chakra-ui/icons/dist/index.esm.js";xt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});xt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});xt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});xt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});xt({displayName:"SunIcon",path:E("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[E("circle",{cx:"12",cy:"12",r:"5"},void 0,!1,{fileName:ut,lineNumber:42,columnNumber:22},globalThis),E("path",{d:"M12 1v2"},void 0,!1,{fileName:ut,lineNumber:46,columnNumber:23},globalThis),E("path",{d:"M12 21v2"},void 0,!1,{fileName:ut,lineNumber:48,columnNumber:23},globalThis),E("path",{d:"M4.22 4.22l1.42 1.42"},void 0,!1,{fileName:ut,lineNumber:50,columnNumber:23},globalThis),E("path",{d:"M18.36 18.36l1.42 1.42"},void 0,!1,{fileName:ut,lineNumber:52,columnNumber:23},globalThis),E("path",{d:"M1 12h2"},void 0,!1,{fileName:ut,lineNumber:54,columnNumber:23},globalThis),E("path",{d:"M21 12h2"},void 0,!1,{fileName:ut,lineNumber:56,columnNumber:23},globalThis),E("path",{d:"M4.22 19.78l1.42-1.42"},void 0,!1,{fileName:ut,lineNumber:58,columnNumber:23},globalThis),E("path",{d:"M18.36 5.64l1.42-1.42"},void 0,!1,{fileName:ut,lineNumber:60,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:36,columnNumber:25},globalThis)});xt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});xt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:E("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"},void 0,!1,{fileName:ut,lineNumber:77,columnNumber:25},globalThis)});xt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});xt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});xt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});xt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});xt({displayName:"ViewIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"},void 0,!1,{fileName:ut,lineNumber:119,columnNumber:22},globalThis),E("circle",{cx:"12",cy:"12",r:"2"},void 0,!1,{fileName:ut,lineNumber:121,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:117,columnNumber:25},globalThis)});xt({displayName:"ViewOffIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"},void 0,!1,{fileName:ut,lineNumber:134,columnNumber:22},globalThis),E("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"},void 0,!1,{fileName:ut,lineNumber:136,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:132,columnNumber:25},globalThis)});xt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});xt({displayName:"DeleteIcon",path:E("g",{fill:"currentColor",children:E("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"},void 0,!1,{fileName:ut,lineNumber:155,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:153,columnNumber:25},globalThis)});xt({displayName:"RepeatIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"},void 0,!1,{fileName:ut,lineNumber:166,columnNumber:22},globalThis),E("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"},void 0,!1,{fileName:ut,lineNumber:168,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:164,columnNumber:25},globalThis)});xt({displayName:"RepeatClockIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"},void 0,!1,{fileName:ut,lineNumber:179,columnNumber:22},globalThis),E("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"},void 0,!1,{fileName:ut,lineNumber:181,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:177,columnNumber:25},globalThis)});xt({displayName:"EditIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"},void 0,!1,{fileName:ut,lineNumber:195,columnNumber:22},globalThis),E("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"},void 0,!1,{fileName:ut,lineNumber:197,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:190,columnNumber:25},globalThis)});xt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});xt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});xt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});xt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});xt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});xt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});xt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});xt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});xt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var nz=xt({displayName:"ExternalLinkIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},void 0,!1,{fileName:ut,lineNumber:275,columnNumber:22},globalThis),E("path",{d:"M15 3h6v6"},void 0,!1,{fileName:ut,lineNumber:277,columnNumber:23},globalThis),E("path",{d:"M10 14L21 3"},void 0,!1,{fileName:ut,lineNumber:279,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:270,columnNumber:25},globalThis)});xt({displayName:"LinkIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"},void 0,!1,{fileName:ut,lineNumber:290,columnNumber:22},globalThis),E("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"},void 0,!1,{fileName:ut,lineNumber:292,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:288,columnNumber:25},globalThis)});xt({displayName:"PlusSquareIcon",path:E("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[E("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"},void 0,!1,{fileName:ut,lineNumber:306,columnNumber:22},globalThis),E("path",{d:"M12 8v8"},void 0,!1,{fileName:ut,lineNumber:313,columnNumber:23},globalThis),E("path",{d:"M8 12h8"},void 0,!1,{fileName:ut,lineNumber:315,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:301,columnNumber:25},globalThis)});xt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});xt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});xt({displayName:"TimeIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"},void 0,!1,{fileName:ut,lineNumber:342,columnNumber:22},globalThis),E("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"},void 0,!1,{fileName:ut,lineNumber:344,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:340,columnNumber:25},globalThis)});xt({displayName:"ArrowRightIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"},void 0,!1,{fileName:ut,lineNumber:355,columnNumber:22},globalThis),E("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"},void 0,!1,{fileName:ut,lineNumber:357,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:353,columnNumber:25},globalThis)});xt({displayName:"ArrowLeftIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"},void 0,!1,{fileName:ut,lineNumber:368,columnNumber:22},globalThis),E("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"},void 0,!1,{fileName:ut,lineNumber:370,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:366,columnNumber:25},globalThis)});xt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});xt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});xt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});xt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});xt({displayName:"EmailIcon",path:E("g",{fill:"currentColor",children:[E("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"},void 0,!1,{fileName:ut,lineNumber:410,columnNumber:22},globalThis),E("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"},void 0,!1,{fileName:ut,lineNumber:412,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:408,columnNumber:25},globalThis)});xt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});xt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});xt({displayName:"SpinnerIcon",path:E(Li,{children:[E("defs",{children:E("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[E("stop",{stopColor:"currentColor",offset:"0%"},void 0,!1,{fileName:ut,lineNumber:443,columnNumber:22},globalThis),E("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"},void 0,!1,{fileName:ut,lineNumber:446,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:437,columnNumber:133},globalThis)},void 0,!1,{fileName:ut,lineNumber:437,columnNumber:83},globalThis),E("g",{transform:"translate(2)",fill:"none",children:[E("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"},void 0,!1,{fileName:ut,lineNumber:453,columnNumber:22},globalThis),E("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"},void 0,!1,{fileName:ut,lineNumber:459,columnNumber:23},globalThis),E("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"},void 0,!1,{fileName:ut,lineNumber:463,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:450,columnNumber:25},globalThis)]},void 0,!0)});xt({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});xt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:E("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"},void 0,!1,{fileName:ut,lineNumber:484,columnNumber:25},globalThis)});xt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});xt({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});xt({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});xt({displayName:"InfoOutlineIcon",path:E("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[E("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"},void 0,!1,{fileName:ut,lineNumber:521,columnNumber:22},globalThis),E("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"},void 0,!1,{fileName:ut,lineNumber:527,columnNumber:23},globalThis),E("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"},void 0,!1,{fileName:ut,lineNumber:533,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:516,columnNumber:25},globalThis)});xt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});xt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});xt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});xt({displayName:"QuestionOutlineIcon",path:E("g",{stroke:"currentColor",strokeWidth:"1.5",children:[E("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"},void 0,!1,{fileName:ut,lineNumber:568,columnNumber:22},globalThis),E("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"},void 0,!1,{fileName:ut,lineNumber:572,columnNumber:23},globalThis),E("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"},void 0,!1,{fileName:ut,lineNumber:576,columnNumber:23},globalThis)]},void 0,!0,{fileName:ut,lineNumber:565,columnNumber:25},globalThis)});xt({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});xt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});xt({viewBox:"0 0 14 14",path:E("g",{fill:"currentColor",children:E("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"},void 0,!1,{fileName:ut,lineNumber:605,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:603,columnNumber:25},globalThis)});xt({displayName:"MinusIcon",path:E("g",{fill:"currentColor",children:E("rect",{height:"4",width:"20",x:"2",y:"10"},void 0,!1,{fileName:ut,lineNumber:616,columnNumber:22},globalThis)},void 0,!1,{fileName:ut,lineNumber:614,columnNumber:25},globalThis)});xt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});var rz={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dL=Be.createContext&&Be.createContext(rz),Qx="/Users/spencer/Documents/Code/stable-diffusion/frontend/node_modules/react-icons/lib/esm/iconBase.js",Yf=globalThis&&globalThis.__assign||function(){return Yf=Object.assign||function(e){for(var t,r=1,i=arguments.length;rE(An,{gap:2,children:[r&&E(Gf,{label:`Recall ${e}`,children:E(Co,{"aria-label":"Use this parameter",icon:E(iz,{},void 0,!1,{fileName:pn,lineNumber:54,columnNumber:19},void 0),size:"xs",variant:"ghost",fontSize:20,onClick:r},void 0,!1,{fileName:pn,lineNumber:52,columnNumber:11},void 0)},void 0,!1,{fileName:pn,lineNumber:51,columnNumber:9},void 0),E(Hr,{fontWeight:"semibold",whiteSpace:"nowrap",children:[e,":"]},void 0,!0,{fileName:pn,lineNumber:62,columnNumber:7},void 0),i?E(by,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",E(nz,{mx:"2px"},void 0,!1,{fileName:pn,lineNumber:67,columnNumber:30},void 0)]},void 0,!0,{fileName:pn,lineNumber:66,columnNumber:9},void 0):E(Hr,{maxHeight:100,overflowY:"scroll",wordBreak:"break-all",children:t.toString()},void 0,!1,{fileName:pn,lineNumber:70,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:49,columnNumber:5},void 0),kpe=(e,t)=>e.image.uuid===t.image.uuid,Ope=D.exports.memo(({image:e})=>{const t=pi(),r=Vf("blackAlpha.100","whiteAlpha.100"),i=e?.metadata?.image||{},{type:o,postprocessing:c,sampler:u,prompt:h,seed:m,variations:v,steps:S,cfg_scale:x,seamless:w,width:_,height:R,strength:k,fit:P,init_image_path:U,mask_image_path:L,orig_path:F,scale:B}=i,$=JSON.stringify(i,null,2);return E(An,{gap:1,direction:"column",overflowY:"scroll",width:"100%",children:[E(An,{gap:2,children:[E(Hr,{fontWeight:"semibold",children:"File:"},void 0,!1,{fileName:pn,lineNumber:124,columnNumber:9},void 0),E(by,{href:e.url,isExternal:!0,children:[e.url,E(nz,{mx:"2px"},void 0,!1,{fileName:pn,lineNumber:127,columnNumber:11},void 0)]},void 0,!0,{fileName:pn,lineNumber:125,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:123,columnNumber:7},void 0),Object.keys(i).length>0?E(Li,{children:[o&&E(ta,{label:"Type",value:o},void 0,!1,{fileName:pn,lineNumber:132,columnNumber:20},void 0),["esrgan","gfpgan"].includes(o)&&E(ta,{label:"Original image",value:F,isLink:!0},void 0,!1,{fileName:pn,lineNumber:134,columnNumber:13},void 0),o==="gfpgan"&&k&&E(ta,{label:"Fix faces strength",value:k,onClick:()=>t(rA(k))},void 0,!1,{fileName:pn,lineNumber:137,columnNumber:13},void 0),o==="esrgan"&&B&&E(ta,{label:"Upscaling scale",value:B,onClick:()=>t(aA(B))},void 0,!1,{fileName:pn,lineNumber:144,columnNumber:13},void 0),o==="esrgan"&&k&&E(ta,{label:"Upscaling strength",value:k,onClick:()=>t(iA(k))},void 0,!1,{fileName:pn,lineNumber:151,columnNumber:13},void 0),h&&E(ta,{label:"Prompt",value:eA(h),onClick:()=>t(NF(h))},void 0,!1,{fileName:pn,lineNumber:158,columnNumber:13},void 0),m&&E(ta,{label:"Seed",value:m,onClick:()=>t(Ay(m))},void 0,!1,{fileName:pn,lineNumber:165,columnNumber:13},void 0),u&&E(ta,{label:"Sampler",value:u,onClick:()=>t(AF(u))},void 0,!1,{fileName:pn,lineNumber:172,columnNumber:13},void 0),S&&E(ta,{label:"Steps",value:S,onClick:()=>t(EF(S))},void 0,!1,{fileName:pn,lineNumber:179,columnNumber:13},void 0),x&&E(ta,{label:"CFG scale",value:x,onClick:()=>t(TF(x))},void 0,!1,{fileName:pn,lineNumber:186,columnNumber:13},void 0),v&&v.length>0&&E(ta,{label:"Seed-weight pairs",value:tA(v),onClick:()=>t(DF(tA(v)))},void 0,!1,{fileName:pn,lineNumber:193,columnNumber:13},void 0),w&&E(ta,{label:"Seamless",value:w,onClick:()=>t(nA(w))},void 0,!1,{fileName:pn,lineNumber:202,columnNumber:13},void 0),_&&E(ta,{label:"Width",value:_,onClick:()=>t(nA(_))},void 0,!1,{fileName:pn,lineNumber:209,columnNumber:13},void 0),R&&E(ta,{label:"Height",value:R,onClick:()=>t(RF(R))},void 0,!1,{fileName:pn,lineNumber:216,columnNumber:13},void 0),U&&E(ta,{label:"Initial image",value:U,isLink:!0,onClick:()=>t(yC(U))},void 0,!1,{fileName:pn,lineNumber:223,columnNumber:13},void 0),L&&E(ta,{label:"Mask image",value:L,isLink:!0,onClick:()=>t(sO(L))},void 0,!1,{fileName:pn,lineNumber:231,columnNumber:13},void 0),o==="img2img"&&k&&E(ta,{label:"Image to image strength",value:k,onClick:()=>t(kF(k))},void 0,!1,{fileName:pn,lineNumber:239,columnNumber:13},void 0),P&&E(ta,{label:"Image to image fit",value:P,onClick:()=>t(OF(P))},void 0,!1,{fileName:pn,lineNumber:246,columnNumber:13},void 0),c&&c.length>0&&c.map(K=>{if(K.type==="esrgan"){const{scale:Z,strength:fe}=K;return E(Li,{children:[E(ta,{label:"Upscaling scale",value:Z,onClick:()=>t(aA(Z))},void 0,!1,{fileName:pn,lineNumber:260,columnNumber:23},void 0),E(ta,{label:"Upscaling strength",value:fe,onClick:()=>t(iA(fe))},void 0,!1,{fileName:pn,lineNumber:265,columnNumber:23},void 0)]},void 0,!0)}else if(K.type==="gfpgan"){const{strength:Z}=K;return E(ta,{label:"Fix faces strength",value:Z,onClick:()=>t(rA(Z))},void 0,!1,{fileName:pn,lineNumber:275,columnNumber:21},void 0)}}),E(An,{gap:2,direction:"column",children:[E(An,{gap:2,children:[E(Gf,{label:"Copy metadata JSON",children:E(Co,{"aria-label":"Copy metadata JSON",icon:E(_pe,{},void 0,!1,{fileName:pn,lineNumber:289,columnNumber:25},void 0),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)},void 0,!1,{fileName:pn,lineNumber:287,columnNumber:17},void 0)},void 0,!1,{fileName:pn,lineNumber:286,columnNumber:15},void 0),E(Hr,{fontWeight:"semibold",children:"Metadata JSON:"},void 0,!1,{fileName:pn,lineNumber:296,columnNumber:15},void 0)]},void 0,!0,{fileName:pn,lineNumber:285,columnNumber:13},void 0),E(bc,{overflow:"scroll",flexGrow:3,wordBreak:"break-all",bgColor:r,padding:2,children:E("pre",{children:$},void 0,!1,{fileName:pn,lineNumber:306,columnNumber:15},void 0)},void 0,!1,{fileName:pn,lineNumber:298,columnNumber:13},void 0)]},void 0,!0,{fileName:pn,lineNumber:284,columnNumber:11},void 0)]},void 0,!0):E(yy,{width:"100%",pt:10,children:E(Hr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"},void 0,!1,{fileName:pn,lineNumber:312,columnNumber:11},void 0)},void 0,!1,{fileName:pn,lineNumber:311,columnNumber:9},void 0)]},void 0,!0,{fileName:pn,lineNumber:122,columnNumber:5},void 0)},kpe),oz=To("socketio/generateImage"),Dpe=To("socketio/runESRGAN"),Mpe=To("socketio/runGFPGAN"),Ppe=To("socketio/deleteImage"),Lpe=To("socketio/requestAllImages"),Ipe=To("socketio/cancelProcessing"),Fpe=To("socketio/uploadInitialImage"),zpe=To("socketio/uploadMaskImage"),Bpe=To("socketio/requestSystemConfig");var bo="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/DeleteImageModal.tsx";const Upe=Yr(e=>e.system,e=>e.shouldConfirmOnDelete),sz=D.exports.forwardRef(({image:e,children:t},r)=>{const{isOpen:i,onOpen:o,onClose:c}=_5(),u=pi(),h=yr(Upe),m=D.exports.useRef(null),v=w=>{w.stopPropagation(),h?o():S()},S=()=>{u(Ppe(e)),c()},x=w=>u(IF(!w.target.checked));return E(Li,{children:[D.exports.cloneElement(t,{onClick:v,ref:r}),E(Ene,{isOpen:i,leastDestructiveRef:m,onClose:c,children:E(w2,{children:E(Tne,{children:[E(Uk,{fontSize:"lg",fontWeight:"bold",children:"Delete image"},void 0,!1,{fileName:bo,lineNumber:89,columnNumber:15},void 0),E(x2,{children:E(An,{direction:"column",gap:5,children:[E(Hr,{children:"Are you sure? You can't undo this action afterwards."},void 0,!1,{fileName:bo,lineNumber:95,columnNumber:19},void 0),E(Xf,{children:E(An,{alignItems:"center",children:[E(Qf,{mb:0,children:"Don't ask me again"},void 0,!1,{fileName:bo,lineNumber:100,columnNumber:23},void 0),E(Wf,{checked:!h,onChange:x},void 0,!1,{fileName:bo,lineNumber:101,columnNumber:23},void 0)]},void 0,!0,{fileName:bo,lineNumber:99,columnNumber:21},void 0)},void 0,!1,{fileName:bo,lineNumber:98,columnNumber:19},void 0)]},void 0,!0,{fileName:bo,lineNumber:94,columnNumber:17},void 0)},void 0,!1,{fileName:bo,lineNumber:93,columnNumber:15},void 0),E(Bk,{children:[E(bu,{ref:m,onClick:c,children:"Cancel"},void 0,!1,{fileName:bo,lineNumber:110,columnNumber:17},void 0),E(bu,{colorScheme:"red",onClick:S,ml:3,children:"Delete"},void 0,!1,{fileName:bo,lineNumber:113,columnNumber:17},void 0)]},void 0,!0,{fileName:bo,lineNumber:109,columnNumber:15},void 0)]},void 0,!0,{fileName:bo,lineNumber:88,columnNumber:13},void 0)},void 0,!1,{fileName:bo,lineNumber:87,columnNumber:11},void 0)},void 0,!1,{fileName:bo,lineNumber:82,columnNumber:9},void 0)]},void 0,!0)});var jpe="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDButton.tsx";const pc=e=>{const{label:t,size:r="sm",...i}=e;return E(bu,{size:r,...i,children:t},void 0,!1,{fileName:jpe,lineNumber:15,columnNumber:5},void 0)};var fc="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/CurrentImageButtons.tsx";const $pe=Yr(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isGFPGANAvailable:e.isGFPGANAvailable,isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),Vpe=({image:e,shouldShowImageDetails:t,setShouldShowImageDetails:r})=>{const i=pi(),{intermediateImage:o}=yr(U=>U.gallery),{upscalingLevel:c,gfpganStrength:u}=yr(U=>U.options),{isProcessing:h,isConnected:m,isGFPGANAvailable:v,isESRGANAvailable:S}=yr($pe),x=()=>i(yC(e.url)),w=()=>i(MF(e.metadata)),_=()=>i(Ay(e.metadata.image.seed)),R=()=>i(Dpe(e)),k=()=>i(Mpe(e)),P=()=>r(!t);return E(An,{gap:2,children:[E(pc,{label:"Use as initial image",colorScheme:"gray",flexGrow:1,variant:"outline",onClick:x},void 0,!1,{fileName:fc,lineNumber:82,columnNumber:7},void 0),E(pc,{label:"Use all",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!["txt2img","img2img"].includes(e?.metadata?.image?.type),onClick:w},void 0,!1,{fileName:fc,lineNumber:90,columnNumber:7},void 0),E(pc,{label:"Use seed",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!e?.metadata?.image?.seed,onClick:_},void 0,!1,{fileName:fc,lineNumber:99,columnNumber:7},void 0),E(pc,{label:"Upscale",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!S||Boolean(o)||!(m&&!h)||!c,onClick:R},void 0,!1,{fileName:fc,lineNumber:108,columnNumber:7},void 0),E(pc,{label:"Fix faces",colorScheme:"gray",flexGrow:1,variant:"outline",isDisabled:!v||Boolean(o)||!(m&&!h)||!u,onClick:k},void 0,!1,{fileName:fc,lineNumber:121,columnNumber:7},void 0),E(pc,{label:"Details",colorScheme:"gray",variant:t?"solid":"outline",borderWidth:1,flexGrow:1,onClick:P},void 0,!1,{fileName:fc,lineNumber:134,columnNumber:7},void 0),E(sz,{image:e,children:E(pc,{label:"Delete",colorScheme:"red",flexGrow:1,variant:"outline",isDisabled:Boolean(o)},void 0,!1,{fileName:fc,lineNumber:143,columnNumber:9},void 0)},void 0,!1,{fileName:fc,lineNumber:142,columnNumber:7},void 0)]},void 0,!0,{fileName:fc,lineNumber:81,columnNumber:5},void 0)};var Af="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/CurrentImageDisplay.tsx";const Hpe="calc(100vh - 238px)",Wpe=()=>{const{currentImage:e,intermediateImage:t}=yr(u=>u.gallery),r=Vf("rgba(255, 255, 255, 0.85)","rgba(0, 0, 0, 0.8)"),[i,o]=D.exports.useState(!1),c=t||e;return c?E(An,{direction:"column",borderWidth:1,rounded:"md",p:2,gap:2,children:[E(Vpe,{image:c,shouldShowImageDetails:i,setShouldShowImageDetails:o},void 0,!1,{fileName:Af,lineNumber:31,columnNumber:7},void 0),E(yy,{height:Hpe,position:"relative",children:[E(gy,{src:c.url,fit:"contain",maxWidth:"100%",maxHeight:"100%"},void 0,!1,{fileName:Af,lineNumber:37,columnNumber:9},void 0),i&&E(An,{width:"100%",height:"100%",position:"absolute",top:0,left:0,p:3,boxSizing:"border-box",backgroundColor:r,overflow:"scroll",children:E(Ope,{image:c},void 0,!1,{fileName:Af,lineNumber:55,columnNumber:13},void 0)},void 0,!1,{fileName:Af,lineNumber:44,columnNumber:11},void 0)]},void 0,!0,{fileName:Af,lineNumber:36,columnNumber:7},void 0)]},void 0,!0,{fileName:Af,lineNumber:30,columnNumber:5},void 0):E(yy,{height:"100%",position:"relative",children:E(Hr,{size:"xl",children:"No image selected"},void 0,!1,{fileName:Af,lineNumber:62,columnNumber:7},void 0)},void 0,!1,{fileName:Af,lineNumber:61,columnNumber:5},void 0)};var Qi="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/HoverableImage.tsx";const Gpe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,Ype=D.exports.memo(e=>{const[t,r]=D.exports.useState(!1),i=pi(),o=Vf("green.600","green.300"),c=Vf("gray.200","gray.700"),u=Vf("radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.7) 20%, rgba(0,0,0,0) 100%)","radial-gradient(circle, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0) 100%)"),{image:h,isSelected:m}=e,{url:v,uuid:S,metadata:x}=h,w=()=>r(!0),_=()=>r(!1),R=U=>{U.stopPropagation(),i(MF(x))},k=U=>{U.stopPropagation(),i(Ay(h.metadata.image.seed))};return E(bc,{position:"relative",children:[E(gy,{width:120,height:120,objectFit:"cover",rounded:"md",src:v,loading:"lazy",backgroundColor:c},void 0,!1,{fileName:Qi,lineNumber:63,columnNumber:7},void 0),E(An,{cursor:"pointer",position:"absolute",top:0,left:0,rounded:"md",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",background:m?u:void 0,onClick:()=>i(Gfe(h)),onMouseOver:w,onMouseOut:_,children:[m&&E(kl,{fill:o,width:"50%",height:"50%",as:Cpe},void 0,!1,{fileName:Qi,lineNumber:88,columnNumber:11},void 0),t&&E(An,{direction:"column",gap:1,position:"absolute",top:1,right:1,children:[E(Gf,{label:"Delete image",children:E(sz,{image:h,children:E(Co,{colorScheme:"red","aria-label":"Delete image",icon:E(Ape,{},void 0,!1,{fileName:Qi,lineNumber:103,columnNumber:25},void 0),size:"xs",variant:"imageHoverIconButton",fontSize:14},void 0,!1,{fileName:Qi,lineNumber:100,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:99,columnNumber:15},void 0)},void 0,!1,{fileName:Qi,lineNumber:98,columnNumber:13},void 0),["txt2img","img2img"].includes(h?.metadata?.image?.type)&&E(Gf,{label:"Use all parameters",children:E(Co,{"aria-label":"Use all parameters",icon:E(iz,{},void 0,!1,{fileName:Qi,lineNumber:114,columnNumber:25},void 0),size:"xs",fontSize:18,variant:"imageHoverIconButton",onClickCapture:R},void 0,!1,{fileName:Qi,lineNumber:112,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:111,columnNumber:15},void 0),h?.metadata?.image?.seed&&E(Gf,{label:"Use seed",children:E(Co,{"aria-label":"Use seed",icon:E(Tpe,{},void 0,!1,{fileName:Qi,lineNumber:126,columnNumber:25},void 0),size:"xs",fontSize:16,variant:"imageHoverIconButton",onClickCapture:k},void 0,!1,{fileName:Qi,lineNumber:124,columnNumber:17},void 0)},void 0,!1,{fileName:Qi,lineNumber:123,columnNumber:15},void 0)]},void 0,!0,{fileName:Qi,lineNumber:91,columnNumber:11},void 0)]},void 0,!0,{fileName:Qi,lineNumber:72,columnNumber:7},void 0)]},S,!0,{fileName:Qi,lineNumber:62,columnNumber:5},void 0)},Gpe);var Ex="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/gallery/ImageGallery.tsx";const qpe=()=>{const{images:e,currentImageUuid:t}=yr(r=>r.gallery);return e.length?E(An,{gap:2,wrap:"wrap",pb:2,children:[...e].reverse().map(r=>{const{uuid:i}=r;return E(Ype,{image:r,isSelected:t===i},i,!1,{fileName:Ex,lineNumber:28,columnNumber:11},void 0)})},void 0,!1,{fileName:Ex,lineNumber:23,columnNumber:5},void 0):E(yy,{height:"100%",position:"relative",children:E(Hr,{size:"xl",children:"No images in gallery"},void 0,!1,{fileName:Ex,lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:Ex,lineNumber:33,columnNumber:5},void 0)};var Kpe="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/ProgressBar.tsx";const Zpe=Yr(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),Xpe=()=>{const{isProcessing:e,currentStep:t,totalSteps:r,currentStatusHasSteps:i}=yr(Zpe),o=t?Math.round(t*100/r):0;return E(C8,{height:"10px",value:o,isIndeterminate:e&&!i},void 0,!1,{fileName:Kpe,lineNumber:30,columnNumber:5},void 0)};function Qpe(e){return ao({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function Jpe(e){return ao({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}var gr="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/SettingsModal.tsx";const ehe=Yr(e=>e.system,e=>{const{shouldDisplayInProgress:t,shouldConfirmOnDelete:r}=e;return{shouldDisplayInProgress:t,shouldConfirmOnDelete:r}},{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),the=({children:e})=>{const{isOpen:t,onOpen:r,onClose:i}=_5(),{isOpen:o,onOpen:c,onClose:u}=_5(),{shouldDisplayInProgress:h,shouldConfirmOnDelete:m}=yr(ehe),v=pi(),S=()=>{bz.purge().then(()=>{i(),c()})};return E(Li,{children:[D.exports.cloneElement(e,{onClick:r}),E(_y,{isOpen:t,onClose:i,children:[E(w2,{},void 0,!1,{fileName:gr,lineNumber:89,columnNumber:9},void 0),E(C2,{children:[E(Uk,{children:"Settings"},void 0,!1,{fileName:gr,lineNumber:91,columnNumber:11},void 0),E(d8,{},void 0,!1,{fileName:gr,lineNumber:92,columnNumber:11},void 0),E(x2,{children:E(An,{gap:5,direction:"column",children:[E(Xf,{children:E(g2,{children:[E(Qf,{marginBottom:1,children:"Display in-progress images (slower)"},void 0,!1,{fileName:gr,lineNumber:97,columnNumber:19},void 0),E(Wf,{isChecked:h,onChange:x=>v(Qfe(x.target.checked))},void 0,!1,{fileName:gr,lineNumber:100,columnNumber:19},void 0)]},void 0,!0,{fileName:gr,lineNumber:96,columnNumber:17},void 0)},void 0,!1,{fileName:gr,lineNumber:95,columnNumber:15},void 0),E(Xf,{children:E(g2,{children:[E(Qf,{marginBottom:1,children:"Confirm on delete"},void 0,!1,{fileName:gr,lineNumber:110,columnNumber:19},void 0),E(Wf,{isChecked:m,onChange:x=>v(IF(x.target.checked))},void 0,!1,{fileName:gr,lineNumber:111,columnNumber:19},void 0)]},void 0,!0,{fileName:gr,lineNumber:109,columnNumber:17},void 0)},void 0,!1,{fileName:gr,lineNumber:108,columnNumber:15},void 0),E(bk,{size:"md",children:"Reset Web UI"},void 0,!1,{fileName:gr,lineNumber:120,columnNumber:15},void 0),E(Hr,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."},void 0,!1,{fileName:gr,lineNumber:121,columnNumber:15},void 0),E(Hr,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."},void 0,!1,{fileName:gr,lineNumber:126,columnNumber:15},void 0),E(bu,{colorScheme:"red",onClick:S,children:"Reset Web UI"},void 0,!1,{fileName:gr,lineNumber:131,columnNumber:15},void 0)]},void 0,!0,{fileName:gr,lineNumber:94,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:93,columnNumber:11},void 0),E(Bk,{children:E(bu,{onClick:i,children:"Close"},void 0,!1,{fileName:gr,lineNumber:138,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:137,columnNumber:11},void 0)]},void 0,!0,{fileName:gr,lineNumber:90,columnNumber:9},void 0)]},void 0,!0,{fileName:gr,lineNumber:88,columnNumber:7},void 0),E(_y,{closeOnOverlayClick:!1,isOpen:o,onClose:u,isCentered:!0,children:[E(w2,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"},void 0,!1,{fileName:gr,lineNumber:149,columnNumber:9},void 0),E(C2,{children:E(x2,{pb:6,pt:6,children:E(An,{justifyContent:"center",children:E(Hr,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."},void 0,!1,{fileName:gr,lineNumber:153,columnNumber:15},void 0)},void 0,!1,{fileName:gr,lineNumber:152,columnNumber:13},void 0)},void 0,!1,{fileName:gr,lineNumber:151,columnNumber:11},void 0)},void 0,!1,{fileName:gr,lineNumber:150,columnNumber:9},void 0)]},void 0,!0,{fileName:gr,lineNumber:143,columnNumber:7},void 0)]},void 0,!0)};var Di="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/system/SiteHeader.tsx";const nhe=Yr(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),rhe=()=>{const{colorMode:e,toggleColorMode:t}=z2(),{isConnected:r,isProcessing:i,currentIteration:o,totalIterations:c,currentStatus:u}=yr(nhe),h=r?"green.500":"red.500",m=e=="light"?E(Epe,{},void 0,!1,{fileName:Di,lineNumber:50,columnNumber:48},void 0):E(Rpe,{},void 0,!1,{fileName:Di,lineNumber:50,columnNumber:61},void 0),v=e=="light"?18:20;let S=u;return i&&c>1&&(S+=` [${o}/${c}]`),E(An,{minWidth:"max-content",alignItems:"center",gap:"1",pl:2,pr:1,children:[E(bk,{size:"lg",children:"InvokeUI"},void 0,!1,{fileName:Di,lineNumber:65,columnNumber:7},void 0),E(s7,{},void 0,!1,{fileName:Di,lineNumber:67,columnNumber:7},void 0),E(Hr,{textColor:h,children:S},void 0,!1,{fileName:Di,lineNumber:69,columnNumber:7},void 0),E(the,{children:E(Co,{"aria-label":"Settings",variant:"link",fontSize:24,size:"sm",icon:E(Jpe,{},void 0,!1,{fileName:Di,lineNumber:77,columnNumber:17},void 0)},void 0,!1,{fileName:Di,lineNumber:72,columnNumber:9},void 0)},void 0,!1,{fileName:Di,lineNumber:71,columnNumber:7},void 0),E(Co,{"aria-label":"Link to Github Issues",variant:"link",fontSize:23,size:"sm",icon:E(by,{isExternal:!0,href:"http://github.com/lstein/stable-diffusion/issues",children:E(Qpe,{},void 0,!1,{fileName:Di,lineNumber:91,columnNumber:13},void 0)},void 0,!1,{fileName:Di,lineNumber:87,columnNumber:11},void 0)},void 0,!1,{fileName:Di,lineNumber:81,columnNumber:7},void 0),E(Co,{"aria-label":"Link to Github Repo",variant:"link",fontSize:20,size:"sm",icon:E(by,{isExternal:!0,href:"http://github.com/lstein/stable-diffusion",children:E(Spe,{},void 0,!1,{fileName:Di,lineNumber:103,columnNumber:13},void 0)},void 0,!1,{fileName:Di,lineNumber:102,columnNumber:11},void 0)},void 0,!1,{fileName:Di,lineNumber:96,columnNumber:7},void 0),E(Co,{"aria-label":"Toggle Dark Mode",onClick:t,variant:"link",size:"sm",fontSize:v,icon:m},void 0,!1,{fileName:Di,lineNumber:108,columnNumber:7},void 0)]},void 0,!0,{fileName:Di,lineNumber:64,columnNumber:5},void 0)};var dc="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDNumberInput.tsx";const qf=e=>{const{label:t,isDisabled:r=!1,fontSize:i="md",size:o="sm",width:c,isInvalid:u,...h}=e;return E(Xf,{isDisabled:r,width:c,isInvalid:u,children:E(An,{gap:2,justifyContent:"space-between",alignItems:"center",children:[t&&E(Qf,{marginBottom:1,children:E(Hr,{fontSize:i,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:dc,lineNumber:37,columnNumber:13},void 0)},void 0,!1,{fileName:dc,lineNumber:36,columnNumber:11},void 0),E(v8,{size:o,...h,keepWithinRange:!1,clampValueOnBlur:!0,children:[E(y8,{fontSize:"md"},void 0,!1,{fileName:dc,lineNumber:48,columnNumber:11},void 0),E(g8,{children:[E(x8,{},void 0,!1,{fileName:dc,lineNumber:50,columnNumber:13},void 0),E(S8,{},void 0,!1,{fileName:dc,lineNumber:51,columnNumber:13},void 0)]},void 0,!0,{fileName:dc,lineNumber:49,columnNumber:11},void 0)]},void 0,!0,{fileName:dc,lineNumber:42,columnNumber:9},void 0)]},void 0,!0,{fileName:dc,lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:dc,lineNumber:33,columnNumber:5},void 0)};var Tx="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDSwitch.tsx";const M2=e=>{const{label:t,isDisabled:r=!1,fontSize:i="md",size:o="md",width:c,...u}=e;return E(Xf,{isDisabled:r,width:c,children:E(An,{justifyContent:"space-between",alignItems:"center",children:[t&&E(Qf,{fontSize:i,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t},void 0,!1,{fileName:Tx,lineNumber:30,columnNumber:11},void 0),E(Wf,{size:o,...u},void 0,!1,{fileName:Tx,lineNumber:39,columnNumber:9},void 0)]},void 0,!0,{fileName:Tx,lineNumber:28,columnNumber:7},void 0)},void 0,!1,{fileName:Tx,lineNumber:27,columnNumber:5},void 0)};var So="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SeedVariationOptions.tsx";const ahe=Yr(e=>e.options,e=>({variationAmount:e.variationAmount,seedWeights:e.seedWeights,shouldGenerateVariations:e.shouldGenerateVariations,shouldRandomizeSeed:e.shouldRandomizeSeed,seed:e.seed,iterations:e.iterations}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),ihe=()=>{const{shouldGenerateVariations:e,variationAmount:t,seedWeights:r,shouldRandomizeSeed:i,seed:o,iterations:c}=yr(ahe),u=pi(),h=R=>u(Lfe(Number(R))),m=R=>u($fe(R.target.checked)),v=R=>u(Ay(Number(R))),S=()=>u(Ay(XF(fA,dA))),x=R=>u(zfe(R.target.checked)),w=R=>u(Bfe(Number(R))),_=R=>u(DF(R.target.value));return E(An,{gap:2,direction:"column",children:[E(qf,{label:"Images to generate",step:1,min:1,precision:0,onChange:h,value:c},void 0,!1,{fileName:So,lineNumber:87,columnNumber:7},void 0),E(M2,{label:"Randomize seed on generation",isChecked:i,onChange:m},void 0,!1,{fileName:So,lineNumber:95,columnNumber:7},void 0),E(An,{gap:2,children:[E(qf,{label:"Seed",step:1,precision:0,flexGrow:1,min:fA,max:dA,isDisabled:i,isInvalid:o<0&&e,onChange:v,value:o},void 0,!1,{fileName:So,lineNumber:101,columnNumber:9},void 0),E(bu,{size:"sm",isDisabled:i,onClick:S,children:E(Hr,{pl:2,pr:2,children:"Shuffle"},void 0,!1,{fileName:So,lineNumber:118,columnNumber:11},void 0)},void 0,!1,{fileName:So,lineNumber:113,columnNumber:9},void 0)]},void 0,!0,{fileName:So,lineNumber:100,columnNumber:7},void 0),E(M2,{label:"Generate variations",isChecked:e,width:"auto",onChange:x},void 0,!1,{fileName:So,lineNumber:123,columnNumber:7},void 0),E(qf,{label:"Variation amount",value:t,step:.01,min:0,max:1,isDisabled:!e,onChange:w},void 0,!1,{fileName:So,lineNumber:129,columnNumber:7},void 0),E(Xf,{isInvalid:e&&!(oO(r)||r===""),flexGrow:1,children:E(g2,{children:[E(Qf,{marginInlineEnd:0,marginBottom:1,children:E(Hr,{whiteSpace:"nowrap",children:"Seed Weights"},void 0,!1,{fileName:So,lineNumber:147,columnNumber:13},void 0)},void 0,!1,{fileName:So,lineNumber:146,columnNumber:11},void 0),E(vk,{size:"sm",value:r,onChange:_},void 0,!1,{fileName:So,lineNumber:149,columnNumber:11},void 0)]},void 0,!0,{fileName:So,lineNumber:145,columnNumber:9},void 0)},void 0,!1,{fileName:So,lineNumber:138,columnNumber:7},void 0)]},void 0,!0,{fileName:So,lineNumber:86,columnNumber:5},void 0)};var Rp="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/common/components/SDSelect.tsx";const P2=e=>{const{label:t,isDisabled:r,validValues:i,size:o="sm",fontSize:c="md",marginBottom:u=1,whiteSpace:h="nowrap",...m}=e;return E(Xf,{isDisabled:r,children:E(An,{justifyContent:"space-between",alignItems:"center",children:[E(Qf,{marginBottom:u,children:E(Hr,{fontSize:c,whiteSpace:h,children:t},void 0,!1,{fileName:Rp,lineNumber:34,columnNumber:11},void 0)},void 0,!1,{fileName:Rp,lineNumber:33,columnNumber:9},void 0),E(_8,{fontSize:c,size:o,...m,children:i.map(v=>typeof v=="string"||typeof v=="number"?E("option",{value:v,children:v},v,!1,{fileName:Rp,lineNumber:41,columnNumber:15},void 0):E("option",{value:v.value,children:v.key},v.value,!1,{fileName:Rp,lineNumber:45,columnNumber:15},void 0))},void 0,!1,{fileName:Rp,lineNumber:38,columnNumber:9},void 0)]},void 0,!0,{fileName:Rp,lineNumber:32,columnNumber:7},void 0)},void 0,!1,{fileName:Rp,lineNumber:31,columnNumber:5},void 0)};var Rx="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/SamplerOptions.tsx";const ohe=Yr(e=>e.options,e=>({steps:e.steps,cfgScale:e.cfgScale,sampler:e.sampler}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),she=()=>{const e=pi(),{steps:t,cfgScale:r,sampler:i}=yr(ohe);return E(An,{gap:2,direction:"column",children:[E(qf,{label:"Steps",min:1,step:1,precision:0,onChange:h=>e(EF(Number(h))),value:t},void 0,!1,{fileName:Rx,lineNumber:50,columnNumber:7},void 0),E(qf,{label:"CFG scale",step:.5,onChange:h=>e(TF(Number(h))),value:r},void 0,!1,{fileName:Rx,lineNumber:58,columnNumber:7},void 0),E(P2,{label:"Sampler",value:i,onChange:h=>e(AF(h.target.value)),validValues:rpe},void 0,!1,{fileName:Rx,lineNumber:64,columnNumber:7},void 0)]},void 0,!0,{fileName:Rx,lineNumber:49,columnNumber:5},void 0)};var DR="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/ESRGANOptions.tsx";const lhe=Yr(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),uhe=Yr(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),che=()=>{const e=pi(),{upscalingLevel:t,upscalingStrength:r}=yr(lhe),{isESRGANAvailable:i}=yr(uhe);return E(An,{direction:"column",gap:2,children:[E(P2,{isDisabled:!i,label:"Scale",value:t,onChange:u=>e(aA(Number(u.target.value))),validValues:ope},void 0,!1,{fileName:DR,lineNumber:67,columnNumber:7},void 0),E(qf,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:u=>e(iA(Number(u))),value:r},void 0,!1,{fileName:DR,lineNumber:74,columnNumber:7},void 0)]},void 0,!0,{fileName:DR,lineNumber:66,columnNumber:5},void 0)};var mL="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/GFPGANOptions.tsx";const fhe=Yr(e=>e.options,e=>({gfpganStrength:e.gfpganStrength}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),dhe=Yr(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),phe=()=>{const e=pi(),{gfpganStrength:t}=yr(fhe),{isGFPGANAvailable:r}=yr(dhe);return E(An,{direction:"column",gap:2,children:E(qf,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:o=>e(rA(Number(o))),value:t},void 0,!1,{fileName:mL,lineNumber:55,columnNumber:7},void 0)},void 0,!1,{fileName:mL,lineNumber:54,columnNumber:5},void 0)};var I0="/Users/spencer/Documents/Code/stable-diffusion/frontend/src/features/options/OutputOptions.tsx";const hhe=Yr(e=>e.options,e=>({height:e.height,width:e.width,seamless:e.seamless}),{memoizeOptions:{resultEqualityCheck:Wr.exports.isEqual}}),mhe=()=>{const e=pi(),{height:t,width:r,seamless:i}=yr(hhe);return E(An,{gap:2,direction:"column",children:[E(An,{gap:2,children:[E(P2,{label:"Width",value:r,flexGrow:1,onChange:h=>e(nA(Number(h.target.value))),validValues:ape},void 0,!1,{fileName:I0,lineNumber:51,columnNumber:9},void 0),E(P2,{label:"Height",value:t,flexGrow:1,onChange:h=>e(RF(Number(h.target.value))),validValues:ipe},void 0,!1,{fileName:I0,lineNumber:58,columnNumber:9},void 0)]},void 0,!0,{fileName:I0,lineNumber:50,columnNumber:7},void 0),E(M2,{label:"Seamless tiling",fontSize:"md",isChecked:i,onChange:h=>e(Ife(h.target.checked))},void 0,!1,{fileName:I0,lineNumber:66,columnNumber:7},void 0)]},void 0,!0,{fileName:I0,lineNumber:49,columnNumber:5},void 0)};var vhe=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 Ky(e,t){var r=ghe(e);if(typeof r.path!="string"){var i=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof i=="string"&&i.length>0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function ghe(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var i=t.split(".").pop().toLowerCase(),o=vhe.get(i);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var yhe=[".DS_Store","Thumbs.db"];function bhe(e){return uv(this,void 0,void 0,function(){return cv(this,function(t){return L2(e)&&She(e.dataTransfer)?[2,_he(e.dataTransfer,e.type)]:xhe(e)?[2,Che(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,whe(e)]:[2,[]]})})}function She(e){return L2(e)}function xhe(e){return L2(e)&&L2(e.target)}function L2(e){return typeof e=="object"&&e!==null}function Che(e){return mA(e.target.files).map(function(t){return Ky(t)})}function whe(e){return uv(this,void 0,void 0,function(){var t;return cv(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(i){return Ky(i)})]}})})}function _he(e,t){return uv(this,void 0,void 0,function(){var r,i;return cv(this,function(o){switch(o.label){case 0:return e.items?(r=mA(e.items).filter(function(c){return c.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Nhe))]):[3,2];case 1:return i=o.sent(),[2,vL(lz(i))];case 2:return[2,vL(mA(e.files).map(function(c){return Ky(c)}))]}})})}function vL(e){return e.filter(function(t){return yhe.indexOf(t.name)===-1})}function mA(e){if(e===null)return[];for(var t=[],r=0;re.length)&&(t=e.length);for(var r=0,i=new Array(t);rr)return[!1,xL(r)];if(e.sizer)return[!1,xL(r)]}return[!0,null]}function Fp(e){return e!=null}function jhe(e){var t=e.files,r=e.accept,i=e.minSize,o=e.maxSize,c=e.multiple,u=e.maxFiles,h=e.validator;return!c&&t.length>1||c&&u>=1&&t.length>u?!1:t.every(function(m){var v=dz(m,r),S=ky(v,1),x=S[0],w=pz(m,i,o),_=ky(w,1),R=_[0],k=h?h(m):null;return x&&R&&!k})}function I2(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ax(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 wL(e){e.preventDefault()}function $he(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Vhe(e){return e.indexOf("Edge/")!==-1}function Hhe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return $he(e)||Vhe(e)}function au(){for(var e=arguments.length,t=new Array(e),r=0;r1?o-1:0),u=1;u - Stable Diffusion Dream Server - + InvokeAI Stable Diffusion Dream Server + diff --git a/frontend/src/features/gallery/CurrentImageButtons.tsx b/frontend/src/features/gallery/CurrentImageButtons.tsx index 9a8ae02344..4dc1001c74 100644 --- a/frontend/src/features/gallery/CurrentImageButtons.tsx +++ b/frontend/src/features/gallery/CurrentImageButtons.tsx @@ -92,7 +92,7 @@ const CurrentImageButtons = ({ colorScheme={'gray'} flexGrow={1} variant={'outline'} - isDisabled={!['txt2img', 'img2img'].includes(image.metadata.image.type)} + isDisabled={!['txt2img', 'img2img'].includes(image?.metadata?.image?.type)} onClick={handleClickUseAllParameters} /> @@ -101,7 +101,7 @@ const CurrentImageButtons = ({ colorScheme={'gray'} flexGrow={1} variant={'outline'} - isDisabled={!image.metadata.image.seed} + isDisabled={!image?.metadata?.image?.seed} onClick={handleClickUseSeed} /> diff --git a/frontend/src/features/gallery/HoverableImage.tsx b/frontend/src/features/gallery/HoverableImage.tsx index 963bbed450..3809888bf9 100644 --- a/frontend/src/features/gallery/HoverableImage.tsx +++ b/frontend/src/features/gallery/HoverableImage.tsx @@ -53,8 +53,6 @@ const HoverableImage = memo((props: HoverableImageProps) => { const handleClickSetSeed = (e: SyntheticEvent) => { e.stopPropagation(); - // Non-null assertion: this button is not rendered unless this exists - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion dispatch(setSeed(image.metadata.image.seed)); }; @@ -109,7 +107,7 @@ const HoverableImage = memo((props: HoverableImageProps) => { /> - {['txt2img', 'img2img'].includes(image.metadata.image.type) && ( + {['txt2img', 'img2img'].includes(image?.metadata?.image?.type) && ( { /> )} - {image.metadata.image.seed && ( + {image?.metadata?.image?.seed && ( { const dispatch = useAppDispatch(); const jsonBgColor = useColorModeValue('blackAlpha.100', 'whiteAlpha.100'); - const metadata = image.metadata.image; + const metadata = image?.metadata?.image || {}; const { type, postprocessing, @@ -119,12 +119,7 @@ const ImageMetadataViewer = memo(({ image }: ImageMetadataViewerProps) => { const metadataJSON = JSON.stringify(metadata, null, 2); return ( - + File: @@ -132,7 +127,7 @@ const ImageMetadataViewer = memo(({ image }: ImageMetadataViewerProps) => { - {Object.keys(metadata).length ? ( + {Object.keys(metadata).length > 0 ? ( <> {type && } {['esrgan', 'gfpgan'].includes(type) && ( @@ -288,9 +283,9 @@ const ImageMetadataViewer = memo(({ image }: ImageMetadataViewerProps) => { )} - + } size={'xs'} variant={'ghost'} @@ -298,7 +293,7 @@ const ImageMetadataViewer = memo(({ image }: ImageMetadataViewerProps) => { onClick={() => navigator.clipboard.writeText(metadataJSON)} /> - JSON: + Metadata JSON: { step={0.01} min={0} max={1} + isDisabled={!shouldGenerateVariations} onChange={handleChangevariationAmount} /> Date: Thu, 22 Sep 2022 00:36:53 +1000 Subject: [PATCH 07/46] Reverts divergent fix to resto module path --- scripts/dream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dream.py b/scripts/dream.py index 9efa1829c6..036a3704c8 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -47,7 +47,7 @@ def main(): # Loading Face Restoration and ESRGAN Modules try: gfpgan, codeformer, esrgan = None, None, None - from ldm.dream.restoration.base import Restoration + from ldm.dream.restoration import Restoration restoration = Restoration(opt.gfpgan_dir, opt.gfpgan_model_path, opt.esrgan_bg_tile) if opt.restore: gfpgan, codeformer = restoration.load_face_restore_models() From 0ab5f2159d5d7b25cffd96b03fed0ecd305db5b6 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 21 Sep 2022 15:18:59 -0400 Subject: [PATCH 08/46] fix img2img incorrectly loading previous prompt --- ldm/generate.py | 1 - scripts/dream.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ldm/generate.py b/ldm/generate.py index e0468434ea..7f1953a80e 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -829,7 +829,6 @@ class Generate: return model def _load_img(self, path, width, height, fit=False): - print(f'DEBUG: path = {path}') assert os.path.exists(path), f'>> {path}: File not found' # with Image.open(path) as img: diff --git a/scripts/dream.py b/scripts/dream.py index d4d66503c9..33c24ff281 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -170,9 +170,10 @@ def main_loop(gen, opt, infile): if opt.init_img: try: - oldargs = metadata_from_png(opt.init_img) - opt.prompt = oldargs.prompt - print(f'>> Retrieved old prompt "{opt.prompt}" from {opt.init_img}') + if not opt.prompt: + oldargs = metadata_from_png(opt.init_img) + opt.prompt = oldargs.prompt + print(f'>> Retrieved old prompt "{opt.prompt}" from {opt.init_img}') except AttributeError: pass except KeyError: From f1d4862b132a3c604db9632862192f24fe01b3bd Mon Sep 17 00:00:00 2001 From: Ben Alkov Date: Wed, 21 Sep 2022 17:09:29 -0400 Subject: [PATCH 09/46] fix(docs): point readme useful-forks link to new repo Signed-off-by: Ben Alkov --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6300b1beb7..b61b365774 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ [discord badge]: https://flat.badgen.net/discord/members/htRgbc7e?icon=discord [discord link]: https://discord.gg/ZmtBAhwWhy [github forks badge]: https://flat.badgen.net/github/forks/invoke-ai/InvokeAI?icon=github -[github forks link]: https://useful-forks.github.io/?repo=lstein%2Fstable-diffusion +[github forks link]: https://useful-forks.github.io/?repo=invoke-ai%2FInvokeAI [github open issues badge]: https://flat.badgen.net/github/open-issues/invoke-ai/InvokeAI?icon=github [github open issues link]: https://github.com/invoke-ai/InvokeAI/issues?q=is%3Aissue+is%3Aopen [github open prs badge]: https://flat.badgen.net/github/open-prs/invoke-ai/InvokeAI?icon=github From 5f22a721880a41d8d14c46da9bbddc11e6ba0bab Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Thu, 22 Sep 2022 17:15:28 -0700 Subject: [PATCH 10/46] Fix division by zero when using an empty prompt --- ldm/dream/conditioning.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldm/dream/conditioning.py b/ldm/dream/conditioning.py index dfa108985a..4d8b766575 100644 --- a/ldm/dream/conditioning.py +++ b/ldm/dream/conditioning.py @@ -65,10 +65,10 @@ def split_weighted_subprompts(text, skip_normalize=False)->list: if weight_sum == 0: print( "Warning: Subprompt weights add up to zero. Discarding and using even weights instead.") - equal_weight = 1 / len(parsed_prompts) + equal_weight = 1 / max(len(parsed_prompts), 1) return [(x[0], equal_weight) for x in parsed_prompts] return [(x[0], x[1] / weight_sum) for x in parsed_prompts] - + # shows how the prompt is tokenized # usually tokens have '' to indicate end-of-word, # but for readability it has been replaced with ' ' From 803a51d5adca7e6e28491fc414fd3937bee7cb79 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 22 Sep 2022 09:32:22 +1000 Subject: [PATCH 11/46] Fixes previous name of repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4eb9374b51..4c6681ee59 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ _Note: This fork is rapidly evolving. Please use the report bugs and make feature requests. Be sure to use the provided templates. They will help aid diagnose issues faster._ -_This repository was formally known as /stable-diffusion_ +_This repository was formally known as lstein/stable-diffusion_ # **Table of Contents** From 413064cf4536760cf3f92f3fd49166b394ae0634 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2022 15:29:59 -0400 Subject: [PATCH 12/46] Web stub for first_seed argument per b93f04e --- ldm/dream/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/dream/server.py b/ldm/dream/server.py index 03114ac9d2..bff1117fd3 100644 --- a/ldm/dream/server.py +++ b/ldm/dream/server.py @@ -161,7 +161,7 @@ class DreamServer(BaseHTTPRequestHandler): # is complete. The upscaling replaces the original file, so the second # entry should not be inserted into the image list. # LS: This repeats code in dream.py - def image_done(image, seed, upscaled=False): + def image_done(image, seed, upscaled=False, first_seed=None): name = f'{prefix}.{seed}.png' iter_opt = copy.copy(opt) if opt.variation_amount > 0: From cd8be1d0e9f6fccad5f796668e8d2e0611bbdb0d Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:40:31 +1200 Subject: [PATCH 13/46] Restoration Modules are now optional --- ldm/dream/restoration/base.py | 24 ++++++++++++++---------- ldm/dream/restoration/gfpgan.py | 4 ++-- ldm/generate.py | 14 ++++++++++---- scripts/dream.py | 21 +++++++++++---------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/ldm/dream/restoration/base.py b/ldm/dream/restoration/base.py index 9037bc40cb..5030c7075d 100644 --- a/ldm/dream/restoration/base.py +++ b/ldm/dream/restoration/base.py @@ -1,34 +1,38 @@ class Restoration(): - def __init__(self, gfpgan_dir='./src/gfpgan', gfpgan_model_path='experiments/pretrained_models/GFPGANv1.3.pth', esrgan_bg_tile=400) -> None: - self.gfpgan_dir = gfpgan_dir - self.gfpgan_model_path = gfpgan_model_path - self.esrgan_bg_tile = esrgan_bg_tile + def __init__(self) -> None: + pass - def load_face_restore_models(self): + def load_face_restore_models(self, gfpgan_dir='./src/gfpgan', gfpgan_model_path='experiments/pretrained_models/GFPGANv1.3.pth'): # Load GFPGAN - gfpgan = self.load_gfpgan() + gfpgan = self.load_gfpgan(gfpgan_dir, gfpgan_model_path) if gfpgan.gfpgan_model_exists: print('>> GFPGAN Initialized') + else: + print('>> GFPGAN Disabled') + gfpgan = None # Load CodeFormer codeformer = self.load_codeformer() if codeformer.codeformer_model_exists: print('>> CodeFormer Initialized') + else: + print('>> CodeFormer Disabled') + codeformer = None return gfpgan, codeformer # Face Restore Models - def load_gfpgan(self): + def load_gfpgan(self, gfpgan_dir, gfpgan_model_path): from ldm.dream.restoration.gfpgan import GFPGAN - return GFPGAN(self.gfpgan_dir, self.gfpgan_model_path) + return GFPGAN(gfpgan_dir, gfpgan_model_path) def load_codeformer(self): from ldm.dream.restoration.codeformer import CodeFormerRestoration return CodeFormerRestoration() # Upscale Models - def load_esrgan(self): + def load_esrgan(self, esrgan_bg_tile=400): from ldm.dream.restoration.realesrgan import ESRGAN - esrgan = ESRGAN(self.esrgan_bg_tile) + esrgan = ESRGAN(esrgan_bg_tile) print('>> ESRGAN Initialized') return esrgan; diff --git a/ldm/dream/restoration/gfpgan.py b/ldm/dream/restoration/gfpgan.py index 643d1e9559..b3de707fac 100644 --- a/ldm/dream/restoration/gfpgan.py +++ b/ldm/dream/restoration/gfpgan.py @@ -17,8 +17,8 @@ class GFPGAN(): self.gfpgan_model_exists = os.path.isfile(self.model_path) if not self.gfpgan_model_exists: - raise Exception( - 'GFPGAN model not found at path ' + self.model_path) + print('## NOT FOUND: GFPGAN model not found at ' + self.model_path) + return None sys.path.append(os.path.abspath(gfpgan_dir)) def model_exists(self): diff --git a/ldm/generate.py b/ldm/generate.py index 7f1953a80e..f3bc93250f 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -726,11 +726,17 @@ class Generate: else: print(">> ESRGAN is disabled. Image not upscaled.") if strength > 0: - if self.gfpgan is not None and self.codeformer is not None: - if facetool == 'codeformer': - image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity) + if self.gfpgan is not None or self.codeformer is not None: + if self.gfpgan is None: + if facetool == 'codeformer': + if self.codeformer is not None: + image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity) + else: + print('>> CodeFormer not found. Face restoration is disabled.') + else: + print('>> GFPGAN not found. Face restoration is disabled.') else: - image = self.gfpgan.process(image, strength, seed) + image = self.gfpgan.process(image, strength, seed) else: print(">> Face Restoration is disabled.") except Exception as e: diff --git a/scripts/dream.py b/scripts/dream.py index 33c24ff281..d7906ec678 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -47,16 +47,17 @@ def main(): # Loading Face Restoration and ESRGAN Modules try: gfpgan, codeformer, esrgan = None, None, None - from ldm.dream.restoration import Restoration - restoration = Restoration(opt.gfpgan_dir, opt.gfpgan_model_path, opt.esrgan_bg_tile) - if opt.restore: - gfpgan, codeformer = restoration.load_face_restore_models() - else: - print('>> Face restoration disabled') - if opt.esrgan: - esrgan = restoration.load_esrgan() - else: - print('>> Upscaling disabled') + if opt.restore or opt.esrgan: + from ldm.dream.restoration import Restoration + restoration = Restoration() + if opt.restore: + gfpgan, codeformer = restoration.load_face_restore_models(opt.gfpgan_dir, opt.gfpgan_model_path) + else: + print('>> Face restoration disabled') + if opt.esrgan: + esrgan = restoration.load_esrgan(opt.esrgan_bg_tile) + else: + print('>> Upscaling disabled') except (ModuleNotFoundError, ImportError): import traceback print(traceback.format_exc(), file=sys.stderr) From 660641e720f58511ccbaa2cb28c3231303b8b6c2 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 23 Sep 2022 20:59:01 +1200 Subject: [PATCH 14/46] Missing ux warning --- scripts/dream.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/dream.py b/scripts/dream.py index d7906ec678..f3db79fe43 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -58,6 +58,8 @@ def main(): esrgan = restoration.load_esrgan(opt.esrgan_bg_tile) else: print('>> Upscaling disabled') + else: + print('>> Face restoration and upscaling disabled') except (ModuleNotFoundError, ImportError): import traceback print(traceback.format_exc(), file=sys.stderr) From a3463abf13706872db8370aee1846ba94e3f6d1b Mon Sep 17 00:00:00 2001 From: H4rk <63350517+h4rk8s@users.noreply.github.com> Date: Sat, 24 Sep 2022 08:16:48 +0800 Subject: [PATCH 15/46] Update TROUBLESHOOT.md --- docs/help/TROUBLESHOOT.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/help/TROUBLESHOOT.md b/docs/help/TROUBLESHOOT.md index cac5dddf23..3828ca1e50 100644 --- a/docs/help/TROUBLESHOOT.md +++ b/docs/help/TROUBLESHOOT.md @@ -9,6 +9,16 @@ install process. During `conda env create -f environment.yaml`, conda hangs indefinitely. +If it is because of the last PIP step (usually stuck in the Git Clone step, you can check the detailed log by this method): +```bash +export PIP_LOG="/tmp/pip_log.txt" +touch ${PIP_LOG} +tail -f ${PIP_LOG} & +conda env create -f environment-mac.yaml --debug --verbose +killall tail +rm ${PIP_LOG} +``` + **SOLUTION** Enter the stable-diffusion directory and completely remove the `src` directory and all its contents. The safest way to do this is to enter the stable-diffusion directory and give the command `git clean -f`. If this still doesn't fix the problem, try "conda clean -all" and then restart at the `conda env create` step. From bf21a0bf0278cd2aadda1f531cd4d113c2a3d2fa Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 24 Sep 2022 04:37:34 -0400 Subject: [PATCH 16/46] fix resizing of inpainting mask - change image resampling method for mask shrinkage to prevent artifacts at edge of mask Addresses #625 --- ldm/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/generate.py b/ldm/generate.py index f3bc93250f..ed3c2390be 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -928,7 +928,7 @@ class Generate: # BUG: We need to use the model's downsample factor rather than hardcoding "8" from ldm.dream.generator.base import downsampling image = image.resize((image.width//downsampling, image.height // - downsampling), resample=Image.Resampling.LANCZOS) + downsampling), resample=Image.Resampling.NEAREST) # print( # f'>> DEBUG: writing the mask to mask.png' # ) From 6858c14d949784c6a6ed5ad31ca0a990449492cb Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Fri, 23 Sep 2022 01:57:50 -0700 Subject: [PATCH 17/46] Allow `Generate` to take images as readers or `Image` instances --- ldm/generate.py | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/ldm/generate.py b/ldm/generate.py index ed3c2390be..78a691dbeb 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -591,8 +591,8 @@ class Generate: def _make_images( self, - img_path, - mask_path, + img, + mask, width, height, fit=False, @@ -600,11 +600,11 @@ class Generate: ): init_image = None init_mask = None - if not img_path: + if not img: return None, None image = self._load_img( - img_path, + img, width, height, fit=fit @@ -614,7 +614,7 @@ class Generate: init_image = self._create_init_image(image) # this returns a torch tensor # if image has a transparent area and no mask was provided, then try to generate mask - if self._has_transparency(image) and not mask_path: + if self._has_transparency(image) and not mask: print( '>> Initial image has transparent areas. Will inpaint in these regions.') if self._check_for_erasure(image): @@ -626,9 +626,9 @@ class Generate: # this returns a torch tensor init_mask = self._create_init_mask(image) - if mask_path: + if mask: mask_image = self._load_img( - mask_path, width, height, fit=fit) # this returns an Image + mask, width, height, fit=fit) # this returns an Image init_mask = self._create_init_mask(mask_image) return init_image, init_mask @@ -834,15 +834,25 @@ class Generate: return model - def _load_img(self, path, width, height, fit=False): - assert os.path.exists(path), f'>> {path}: File not found' + def _load_img(self, img, width, height, fit=False): + if isinstance(img, Image.Image): + image = img + print( + f'>> using provided input image of size {image.width}x{image.height}' + ) + elif isinstance(image, str): + assert os.path.exists(img), f'>> {img}: File not found' + + image = Image.open(img) + print( + f'>> loaded input image of size {image.width}x{image.height} from {img}' + ) + else: + image = Image.open(img) + print( + f'>> loaded input image of size {image.width}x{image.height}' + ) - # with Image.open(path) as img: - # image = img.convert('RGBA') - image = Image.open(path) - print( - f'>> loaded input image of size {image.width}x{image.height} from {path}' - ) if fit: image = self._fit_image(image, (width, height)) else: From 16a06ba66e0e90b2687cdde72a067f933bd16ead Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 24 Sep 2022 04:54:57 -0400 Subject: [PATCH 18/46] fix typo --- ldm/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/generate.py b/ldm/generate.py index 78a691dbeb..9471d01f87 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -840,7 +840,7 @@ class Generate: print( f'>> using provided input image of size {image.width}x{image.height}' ) - elif isinstance(image, str): + elif isinstance(img, str): assert os.path.exists(img), f'>> {img}: File not found' image = Image.open(img) From d117d234698e1dc717f9c7b32fd517792cc4581c Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Fri, 23 Sep 2022 02:02:30 -0700 Subject: [PATCH 19/46] Fix exception when inpainting with DDIM sampler --- ldm/dream/generator/inpaint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ldm/dream/generator/inpaint.py b/ldm/dream/generator/inpaint.py index 248be93bdf..da5411ad64 100644 --- a/ldm/dream/generator/inpaint.py +++ b/ldm/dream/generator/inpaint.py @@ -34,9 +34,9 @@ class Inpaint(Img2Img): ) sampler = DDIMSampler(self.model, device=self.model.device) - sampler.make_schedule( - ddim_num_steps=steps, ddim_eta=ddim_eta, verbose=False - ) + sampler.make_schedule( + ddim_num_steps=steps, ddim_eta=ddim_eta, verbose=False + ) scope = choose_autocast(self.precision) with scope(self.model.device.type): From 53b4c3cc609a19fb1ae63927d76bd38fc8da6789 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 23 Sep 2022 22:20:05 +1200 Subject: [PATCH 20/46] Upgrade GFPGAN to Version 1.4 --- docker-build/Dockerfile | 2 +- docs/features/CLI.md | 113 +++++++++++--------- docs/features/UPSCALE.md | 138 ++++++++++++++----------- docs/installation/INSTALL_DOCKER.md | 154 ++++++++++++++++++++-------- ldm/dream/args.py | 2 +- ldm/dream/restoration/base.py | 2 +- ldm/dream/restoration/gfpgan.py | 4 +- scripts/preload_models.py | 4 +- 8 files changed, 260 insertions(+), 159 deletions(-) diff --git a/docker-build/Dockerfile b/docker-build/Dockerfile index dd6d898ce5..f3d6834c93 100644 --- a/docker-build/Dockerfile +++ b/docker-build/Dockerfile @@ -47,7 +47,7 @@ RUN git clone https://github.com/TencentARC/GFPGAN.git WORKDIR /GFPGAN RUN pip3 install -r requirements.txt \ && python3 setup.py develop \ - && ln -s "/data/GFPGANv1.3.pth" experiments/pretrained_models/GFPGANv1.3.pth + && ln -s "/data/GFPGANv1.4.pth" experiments/pretrained_models/GFPGANv1.4.pth WORKDIR /stable-diffusion RUN python3 scripts/preload_models.py diff --git a/docs/features/CLI.md b/docs/features/CLI.md index aab695bbcd..1cbdbf21cb 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -8,20 +8,23 @@ hide: ## **Interactive Command Line Interface** -The `dream.py` script, located in `scripts/dream.py`, provides an interactive interface to image -generation similar to the "dream mothership" bot that Stable AI provided on its Discord server. +The `dream.py` script, located in `scripts/dream.py`, provides an interactive +interface to image generation similar to the "dream mothership" bot that Stable +AI provided on its Discord server. Unlike the `txt2img.py` and `img2img.py` scripts provided in the original -[CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion) source code repository, the -time-consuming initialization of the AI model initialization only happens once. After that image -generation from the command-line interface is very fast. +[CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion) source +code repository, the time-consuming initialization of the AI model +initialization only happens once. After that image generation from the +command-line interface is very fast. -The script uses the readline library to allow for in-line editing, command history (++up++ and -++down++), autocompletion, and more. To help keep track of which prompts generated which images, the -script writes a log file of image names and prompts to the selected output directory. +The script uses the readline library to allow for in-line editing, command +history (++up++ and ++down++), autocompletion, and more. To help keep track of +which prompts generated which images, the script writes a log file of image +names and prompts to the selected output directory. -In addition, as of version 1.02, it also writes the prompt into the PNG file's metadata where it can -be retrieved using `scripts/images2prompt.py` +In addition, as of version 1.02, it also writes the prompt into the PNG file's +metadata where it can be retrieved using `scripts/images2prompt.py` The script is confirmed to work on Linux, Windows and Mac systems. @@ -56,21 +59,24 @@ dream> q ![dream-py-demo](../assets/dream-py-demo.png) -The `dream>` prompt's arguments are pretty much identical to those used in the Discord bot, except -you don't need to type "!dream" (it doesn't hurt if you do). A significant change is that creation -of individual images is now the default unless `--grid` (`-g`) is given. A full list is given in +The `dream>` prompt's arguments are pretty much identical to those used in the +Discord bot, except you don't need to type "!dream" (it doesn't hurt if you do). +A significant change is that creation of individual images is now the default +unless `--grid` (`-g`) is given. A full list is given in [List of prompt arguments](#list-of-prompt-arguments). ## Arguments -The script itself also recognizes a series of command-line switches that will change important -global defaults, such as the directory for image outputs and the location of the model weight files. +The script itself also recognizes a series of command-line switches that will +change important global defaults, such as the directory for image outputs and +the location of the model weight files. ### List of arguments recognized at the command line -These command-line arguments can be passed to `dream.py` when you first run it from the Windows, Mac -or Linux command line. Some set defaults that can be overridden on a per-prompt basis (see [List of -prompt arguments] (#list-of-prompt-arguments). Others +These command-line arguments can be passed to `dream.py` when you first run it +from the Windows, Mac or Linux command line. Some set defaults that can be +overridden on a per-prompt basis (see [List of prompt arguments] +(#list-of-prompt-arguments). Others | Argument | Shortcut | Default | Description | | ----------------------------------------- | ----------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------- | @@ -90,7 +96,7 @@ prompt arguments] (#list-of-prompt-arguments). Others | `--seamless` | | `False` | Create interesting effects by tiling elements of the image. | | `--embedding_path ` | | `None` | Path to pre-trained embedding manager checkpoints, for custom models | | `--gfpgan_dir` | | `src/gfpgan` | Path to where GFPGAN is installed. | -| `--gfpgan_model_path` | | `experiments/pretrained_models/GFPGANv1.3.pth` | Path to GFPGAN model file, relative to `--gfpgan_dir`. | +| `--gfpgan_model_path` | | `experiments/pretrained_models/GFPGANv1.4.pth` | Path to GFPGAN model file, relative to `--gfpgan_dir`. | | `--device ` | `-d` | `torch.cuda.current_device()` | Device to run SD on, e.g. "cuda:0" | #### deprecated @@ -115,9 +121,10 @@ These arguments are deprecated but still work: ### List of prompt arguments -After the `dream.py` script initializes, it will present you with a **`dream>`** prompt. Here you -can enter information to generate images from text (txt2img), to embellish an existing image or -sketch (img2img), or to selectively alter chosen regions of the image (inpainting). +After the `dream.py` script initializes, it will present you with a **`dream>`** +prompt. Here you can enter information to generate images from text (txt2img), +to embellish an existing image or sketch (img2img), or to selectively alter +chosen regions of the image (inpainting). #### txt2img @@ -171,12 +178,13 @@ Those are the `dream` commands that apply to txt2img: than 640x480. Otherwise the image size will be identical to the provided photo and you may run out of memory if it is large. -Repeated chaining of img2img on an image can result in significant color shifts in the output, -especially if run with lower strength. Color correction can be run against a reference image to fix -this issue. Use the original input image to the chain as the the reference image for each step in -the chain. +Repeated chaining of img2img on an image can result in significant color shifts +in the output, especially if run with lower strength. Color correction can be +run against a reference image to fix this issue. Use the original input image to +the chain as the the reference image for each step in the chain. -In addition to the command-line options recognized by txt2img, img2img accepts additional options: +In addition to the command-line options recognized by txt2img, img2img accepts +additional options: | Argument | Shortcut | Default | Description | | ----------------------------------------- | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | @@ -198,8 +206,8 @@ In addition to the command-line options recognized by txt2img, img2img accepts a the areas to overpaint made transparent, but you must be careful not to destroy the pixels underneath when you create the transparent areas. See [Inpainting](./INPAINTING.md) for details. -Inpainting accepts all the arguments used for txt2img and img2img, as well as the `--mask` (`-M`) -argument: +Inpainting accepts all the arguments used for txt2img and img2img, as well as +the `--mask` (`-M`) argument: | Argument | Shortcut | Default | Description | | ----------------------------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------ | @@ -207,37 +215,42 @@ argument: ## Command-line editing and completion -If you are on a Macintosh or Linux machine, the command-line offers convenient history tracking, -editing, and command completion. +If you are on a Macintosh or Linux machine, the command-line offers convenient +history tracking, editing, and command completion. -- To scroll through previous commands and potentially edit/reuse them, use the ++up++ and ++down++ - cursor keys. -- To edit the current command, use the ++left++ and ++right++ cursor keys to position the cursor, - and then ++backspace++, ++delete++ or ++insert++ characters. -- To move to the very beginning of the command, type ++ctrl+a++ (or ++command+a++ on the Mac) +- To scroll through previous commands and potentially edit/reuse them, use the + ++up++ and ++down++ cursor keys. +- To edit the current command, use the ++left++ and ++right++ cursor keys to + position the cursor, and then ++backspace++, ++delete++ or ++insert++ + characters. +- To move to the very beginning of the command, type ++ctrl+a++ (or + ++command+a++ on the Mac) - To move to the end of the command, type ++ctrl+e++. -- To cut a section of the command, position the cursor where you want to start cutting and type - ++ctrl+k++. -- To paste a cut section back in, position the cursor where you want to paste, and type ++ctrl+y++ +- To cut a section of the command, position the cursor where you want to start + cutting and type ++ctrl+k++. +- To paste a cut section back in, position the cursor where you want to paste, + and type ++ctrl+y++ -Windows users can get similar, but more limited, functionality if they launch `dream.py` with the -"winpty" program: +Windows users can get similar, but more limited, functionality if they launch +`dream.py` with the "winpty" program: ```batch winpty python scripts\dream.py ``` -On the Mac and Linux platforms, when you exit `dream.py`, the last 1000 lines of your command-line -history will be saved. When you restart `dream.py`, you can access the saved history using the -++up++ key. +On the Mac and Linux platforms, when you exit `dream.py`, the last 1000 lines of +your command-line history will be saved. When you restart `dream.py`, you can +access the saved history using the ++up++ key. -In addition, limited command-line completion is installed. In various contexts, you can start typing -your command and press tab. A list of potential completions will be presented to you. You can then -type a little more, hit tab again, and eventually autocomplete what you want. +In addition, limited command-line completion is installed. In various contexts, +you can start typing your command and press tab. A list of potential completions +will be presented to you. You can then type a little more, hit tab again, and +eventually autocomplete what you want. -When specifying file paths using the one-letter shortcuts, the CLI will attempt to complete -pathnames for you. This is most handy for the `-I` (init image) and `-M` (init mask) paths. To -initiate completion, start the path with a slash `/` or `./`, for example: +When specifying file paths using the one-letter shortcuts, the CLI will attempt +to complete pathnames for you. This is most handy for the `-I` (init image) and +`-M` (init mask) paths. To initiate completion, start the path with a slash `/` +or `./`, for example: ```bash dream> "zebra with a mustache" -I./test-pictures diff --git a/docs/features/UPSCALE.md b/docs/features/UPSCALE.md index f68bac987c..f4c06f8b42 100644 --- a/docs/features/UPSCALE.md +++ b/docs/features/UPSCALE.md @@ -4,37 +4,42 @@ title: Upscale ## Intro -The script provides the ability to restore faces and upscale. You can apply these operations -at the time you generate the images, or at any time to a previously-generated PNG file, using -the [!fix](#fixing-previously-generated-images) command. +The script provides the ability to restore faces and upscale. You can apply +these operations at the time you generate the images, or at any time to a +previously-generated PNG file, using the +[!fix](#fixing-previously-generated-images) command. ## Face Fixing -The default face restoration module is GFPGAN. The default upscale is Real-ESRGAN. For an alternative -face restoration module, see [CodeFormer Support] below. +The default face restoration module is GFPGAN. The default upscale is +Real-ESRGAN. For an alternative face restoration module, see [CodeFormer +Support] below. -As of version 1.14, environment.yaml will install the Real-ESRGAN package into the standard install -location for python packages, and will put GFPGAN into a subdirectory of "src" in the -stable-diffusion directory. (The reason for this is that the standard GFPGAN distribution has a -minor bug that adversely affects image color.) Upscaling with Real-ESRGAN should "just work" without -further intervention. Simply pass the --upscale (-U) option on the dream> command line, or indicate -the desired scale on the popup in the Web GUI. +As of version 1.14, environment.yaml will install the Real-ESRGAN package into +the standard install location for python packages, and will put GFPGAN into a +subdirectory of "src" in the stable-diffusion directory. (The reason for this is +that the standard GFPGAN distribution has a minor bug that adversely affects +image color.) Upscaling with Real-ESRGAN should "just work" without further +intervention. Simply pass the --upscale (-U) option on the dream> command line, +or indicate the desired scale on the popup in the Web GUI. -For **GFPGAN** to work, there is one additional step needed. You will need to download and copy the -GFPGAN [models file](https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth) -into **src/gfpgan/experiments/pretrained_models**. On Mac and Linux systems, here's how you'd do it -using **wget**: +For **GFPGAN** to work, there is one additional step needed. You will need to +download and copy the GFPGAN +[models file](https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth) +into **src/gfpgan/experiments/pretrained_models**. On Mac and Linux systems, +here's how you'd do it using **wget**: ```bash -> wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth src/gfpgan/experiments/pretrained_models/ +> wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth src/gfpgan/experiments/pretrained_models/ ``` Make sure that you're in the stable-diffusion directory when you do this. -Alternatively, if you have GFPGAN installed elsewhere, or if you are using an earlier version of -this package which asked you to install GFPGAN in a sibling directory, you may use the -`--gfpgan_dir` argument with `dream.py` to set a custom path to your GFPGAN directory. _There are -other GFPGAN related boot arguments if you wish to customize further._ +Alternatively, if you have GFPGAN installed elsewhere, or if you are using an +earlier version of this package which asked you to install GFPGAN in a sibling +directory, you may use the `--gfpgan_dir` argument with `dream.py` to set a +custom path to your GFPGAN directory. _There are other GFPGAN related boot +arguments if you wish to customize further._ !!! warning "Internet connection needed" @@ -52,13 +57,14 @@ You will now have access to two new prompt arguments. `-U : ` -The upscaling prompt argument takes two values. The first value is a scaling factor and should be -set to either `2` or `4` only. This will either scale the image 2x or 4x respectively using -different models. +The upscaling prompt argument takes two values. The first value is a scaling +factor and should be set to either `2` or `4` only. This will either scale the +image 2x or 4x respectively using different models. -You can set the scaling stength between `0` and `1.0` to control intensity of the of the scaling. -This is handy because AI upscalers generally tend to smooth out texture details. If you wish to -retain some of those for natural looking results, we recommend using values between `0.5 to 0.8`. +You can set the scaling stength between `0` and `1.0` to control intensity of +the of the scaling. This is handy because AI upscalers generally tend to smooth +out texture details. If you wish to retain some of those for natural looking +results, we recommend using values between `0.5 to 0.8`. If you do not explicitly specify an upscaling_strength, it will default to 0.75. @@ -66,18 +72,19 @@ If you do not explicitly specify an upscaling_strength, it will default to 0.75. `-G : ` -This prompt argument controls the strength of the face restoration that is being applied. Similar to -upscaling, values between `0.5 to 0.8` are recommended. +This prompt argument controls the strength of the face restoration that is being +applied. Similar to upscaling, values between `0.5 to 0.8` are recommended. -You can use either one or both without any conflicts. In cases where you use both, the image will be -first upscaled and then the face restoration process will be executed to ensure you get the highest -quality facial features. +You can use either one or both without any conflicts. In cases where you use +both, the image will be first upscaled and then the face restoration process +will be executed to ensure you get the highest quality facial features. `--save_orig` -When you use either `-U` or `-G`, the final result you get is upscaled or face modified. If you want -to save the original Stable Diffusion generation, you can use the `-save_orig` prompt argument to -save the original unaffected version too. +When you use either `-U` or `-G`, the final result you get is upscaled or face +modified. If you want to save the original Stable Diffusion generation, you can +use the `-save_orig` prompt argument to save the original unaffected version +too. ### Example Usage @@ -102,60 +109,69 @@ dream> a man wearing a pineapple hat -I path/to/your/file.png -U 2 0.5 -G 0.6 process is complete. While the image generation is taking place, you will still be able to preview the base images. -If you wish to stop during the image generation but want to upscale or face restore a particular -generated image, pass it again with the same prompt and generated seed along with the `-U` and `-G` -prompt arguments to perform those actions. +If you wish to stop during the image generation but want to upscale or face +restore a particular generated image, pass it again with the same prompt and +generated seed along with the `-U` and `-G` prompt arguments to perform those +actions. ## CodeFormer Support This repo also allows you to perform face restoration using [CodeFormer](https://github.com/sczhou/CodeFormer). -In order to setup CodeFormer to work, you need to download the models like with GFPGAN. You can do -this either by running `preload_models.py` or by manually downloading the -[model file](https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth) and -saving it to `ldm/restoration/codeformer/weights` folder. +In order to setup CodeFormer to work, you need to download the models like with +GFPGAN. You can do this either by running `preload_models.py` or by manually +downloading the +[model file](https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth) +and saving it to `ldm/restoration/codeformer/weights` folder. -You can use `-ft` prompt argument to swap between CodeFormer and the default GFPGAN. The above -mentioned `-G` prompt argument will allow you to control the strength of the restoration effect. +You can use `-ft` prompt argument to swap between CodeFormer and the default +GFPGAN. The above mentioned `-G` prompt argument will allow you to control the +strength of the restoration effect. ### Usage: -The following command will perform face restoration with CodeFormer instead of the default gfpgan. +The following command will perform face restoration with CodeFormer instead of +the default gfpgan. ` -G 0.8 -ft codeformer` ### Other Options: -- `-cf` - cf or CodeFormer Fidelity takes values between `0` and `1`. 0 produces high quality - results but low accuracy and 1 produces lower quality results but higher accuacy to your original - face. +- `-cf` - cf or CodeFormer Fidelity takes values between `0` and `1`. 0 produces + high quality results but low accuracy and 1 produces lower quality results but + higher accuacy to your original face. -The following command will perform face restoration with CodeFormer. CodeFormer will output a result -that is closely matching to the input face. +The following command will perform face restoration with CodeFormer. CodeFormer +will output a result that is closely matching to the input face. ` -G 1.0 -ft codeformer -cf 0.9` -The following command will perform face restoration with CodeFormer. CodeFormer will output a result -that is the best restoration possible. This may deviate slightly from the original face. This is an -excellent option to use in situations when there is very little facial data to work with. +The following command will perform face restoration with CodeFormer. CodeFormer +will output a result that is the best restoration possible. This may deviate +slightly from the original face. This is an excellent option to use in +situations when there is very little facial data to work with. ` -G 1.0 -ft codeformer -cf 0.1` ## Fixing Previously-Generated Images -It is easy to apply face restoration and/or upscaling to any previously-generated file. Just use the -syntax `!fix path/to/file.png `. For example, to apply GFPGAN at strength 0.8 and upscale 2X -for a file named `./outputs/img-samples/000044.2945021133.png`, just run: +It is easy to apply face restoration and/or upscaling to any +previously-generated file. Just use the syntax +`!fix path/to/file.png `. For example, to apply GFPGAN at strength 0.8 +and upscale 2X for a file named `./outputs/img-samples/000044.2945021133.png`, +just run: -~~~~ +``` dream> !fix ./outputs/img-samples/000044.2945021133.png -G 0.8 -U 2 -~~~~ +``` -A new file named `000044.2945021133.fixed.png` will be created in the output directory. Note that -the `!fix` command does not replace the original file, unlike the behavior at generate time. +A new file named `000044.2945021133.fixed.png` will be created in the output +directory. Note that the `!fix` command does not replace the original file, +unlike the behavior at generate time. ### Disabling: -If, for some reason, you do not wish to load the GFPGAN and/or ESRGAN libraries, you can disable them -on the dream.py command line with the `--no_restore` and `--no_upscale` options, respectively. +If, for some reason, you do not wish to load the GFPGAN and/or ESRGAN libraries, +you can disable them on the dream.py command line with the `--no_restore` and +`--no_upscale` options, respectively. diff --git a/docs/installation/INSTALL_DOCKER.md b/docs/installation/INSTALL_DOCKER.md index 784e845e11..c7dd3582d5 100644 --- a/docs/installation/INSTALL_DOCKER.md +++ b/docs/installation/INSTALL_DOCKER.md @@ -1,36 +1,60 @@ # Before you begin -- For end users: Install Stable Diffusion locally using the instructions for your OS. -- For developers: For container-related development tasks or for enabling easy deployment to other environments (on-premises or cloud), follow these instructions. For general use, install locally to leverage your machine's GPU. +- For end users: Install Stable Diffusion locally using the instructions for + your OS. +- For developers: For container-related development tasks or for enabling easy + deployment to other environments (on-premises or cloud), follow these + instructions. For general use, install locally to leverage your machine's GPU. # Why containers? -They provide a flexible, reliable way to build and deploy Stable Diffusion. You'll also use a Docker volume to store the largest model files and image outputs as a first step in decoupling storage and compute. Future enhancements can do this for other assets. See [Processes](https://12factor.net/processes) under the Twelve-Factor App methodology for details on why running applications in such a stateless fashion is important. +They provide a flexible, reliable way to build and deploy Stable Diffusion. +You'll also use a Docker volume to store the largest model files and image +outputs as a first step in decoupling storage and compute. Future enhancements +can do this for other assets. See [Processes](https://12factor.net/processes) +under the Twelve-Factor App methodology for details on why running applications +in such a stateless fashion is important. -You can specify the target platform when building the image and running the container. You'll also need to specify the Stable Diffusion requirements file that matches the container's OS and the architecture it will run on. +You can specify the target platform when building the image and running the +container. You'll also need to specify the Stable Diffusion requirements file +that matches the container's OS and the architecture it will run on. -Developers on Apple silicon (M1/M2): You [can't access your GPU cores from Docker containers](https://github.com/pytorch/pytorch/issues/81224) and performance is reduced compared with running it directly on macOS but for development purposes it's fine. Once you're done with development tasks on your laptop you can build for the target platform and architecture and deploy to another environment with NVIDIA GPUs on-premises or in the cloud. +Developers on Apple silicon (M1/M2): You +[can't access your GPU cores from Docker containers](https://github.com/pytorch/pytorch/issues/81224) +and performance is reduced compared with running it directly on macOS but for +development purposes it's fine. Once you're done with development tasks on your +laptop you can build for the target platform and architecture and deploy to +another environment with NVIDIA GPUs on-premises or in the cloud. -# Installation on a Linux container +# Installation on a Linux container ## Prerequisites -### Get the data files +### Get the data files -Go to [Hugging Face](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original), and click "Access repository" to Download the model file ```sd-v1-4.ckpt``` (~4 GB) to ```~/Downloads```. You'll need to create an account but it's quick and free. +Go to +[Hugging Face](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original), +and click "Access repository" to Download the model file `sd-v1-4.ckpt` (~4 GB) +to `~/Downloads`. You'll need to create an account but it's quick and free. Also download the face restoration model. + ```Shell cd ~/Downloads -wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth +wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth ``` -### Install [Docker](https://github.com/santisbon/guides#docker) -On the Docker Desktop app, go to Preferences, Resources, Advanced. Increase the CPUs and Memory to avoid this [Issue](https://github.com/invoke-ai/InvokeAI/issues/342). You may need to increase Swap and Disk image size too. +### Install [Docker](https://github.com/santisbon/guides#docker) + +On the Docker Desktop app, go to Preferences, Resources, Advanced. Increase the +CPUs and Memory to avoid this +[Issue](https://github.com/invoke-ai/InvokeAI/issues/342). You may need to +increase Swap and Disk image size too. ## Setup -Set the fork you want to use and other variables. +Set the fork you want to use and other variables. + ```Shell TAG_STABLE_DIFFUSION="santisbon/stable-diffusion" PLATFORM="linux/arm64" @@ -46,21 +70,28 @@ echo $CONDA_SUBDIR ``` Create a Docker volume for the downloaded model files. + ```Shell docker volume create my-vol ``` -Copy the data files to the Docker volume using a lightweight Linux container. We'll need the models at run time. You just need to create the container with the mountpoint; no need to run this dummy container. +Copy the data files to the Docker volume using a lightweight Linux container. +We'll need the models at run time. You just need to create the container with +the mountpoint; no need to run this dummy container. + ```Shell cd ~/Downloads # or wherever you saved the files -docker create --platform $PLATFORM --name dummy --mount source=my-vol,target=/data alpine +docker create --platform $PLATFORM --name dummy --mount source=my-vol,target=/data alpine docker cp sd-v1-4.ckpt dummy:/data -docker cp GFPGANv1.3.pth dummy:/data +docker cp GFPGANv1.4.pth dummy:/data ``` -Get the repo and download the Miniconda installer (we'll need it at build time). Replace the URL with the version matching your container OS and the architecture it will run on. +Get the repo and download the Miniconda installer (we'll need it at build time). +Replace the URL with the version matching your container OS and the architecture +it will run on. + ```Shell cd ~ git clone $GITHUB_STABLE_DIFFUSION @@ -70,10 +101,15 @@ chmod +x entrypoint.sh wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O anaconda.sh && chmod +x anaconda.sh ``` -Build the Docker image. Give it any tag ```-t``` that you want. -Choose the Linux container's host platform: x86-64/Intel is ```amd64```. Apple silicon is ```arm64```. If deploying the container to the cloud to leverage powerful GPU instances you'll be on amd64 hardware but if you're just trying this out locally on Apple silicon choose arm64. -The application uses libraries that need to match the host environment so use the appropriate requirements file. -Tip: Check that your shell session has the env variables set above. +Build the Docker image. Give it any tag `-t` that you want. +Choose the Linux container's host platform: x86-64/Intel is `amd64`. Apple +silicon is `arm64`. If deploying the container to the cloud to leverage powerful +GPU instances you'll be on amd64 hardware but if you're just trying this out +locally on Apple silicon choose arm64. +The application uses libraries that need to match the host environment so use +the appropriate requirements file. +Tip: Check that your shell session has the env variables set above. + ```Shell docker build -t $TAG_STABLE_DIFFUSION \ --platform $PLATFORM \ @@ -85,6 +121,7 @@ docker build -t $TAG_STABLE_DIFFUSION \ Run a container using your built image. Tip: Make sure you've created and populated the Docker volume (above). + ```Shell docker run -it \ --rm \ @@ -98,86 +135,121 @@ $TAG_STABLE_DIFFUSION # Usage (time to have fun) ## Startup -If you're on a **Linux container** the ```dream``` script is **automatically started** and the output dir set to the Docker volume you created earlier. + +If you're on a **Linux container** the `dream` script is **automatically +started** and the output dir set to the Docker volume you created earlier. If you're **directly on macOS follow these startup instructions**. -With the Conda environment activated (```conda activate ldm```), run the interactive interface that combines the functionality of the original scripts ```txt2img``` and ```img2img```: -Use the more accurate but VRAM-intensive full precision math because half-precision requires autocast and won't work. -By default the images are saved in ```outputs/img-samples/```. +With the Conda environment activated (`conda activate ldm`), run the interactive +interface that combines the functionality of the original scripts `txt2img` and +`img2img`: +Use the more accurate but VRAM-intensive full precision math because +half-precision requires autocast and won't work. +By default the images are saved in `outputs/img-samples/`. + ```Shell -python3 scripts/dream.py --full_precision +python3 scripts/dream.py --full_precision ``` You'll get the script's prompt. You can see available options or quit. + ```Shell dream> -h dream> q ``` ## Text to Image -For quick (but bad) image results test with 5 steps (default 50) and 1 sample image. This will let you know that everything is set up correctly. + +For quick (but bad) image results test with 5 steps (default 50) and 1 sample +image. This will let you know that everything is set up correctly. Then increase steps to 100 or more for good (but slower) results. The prompt can be in quotes or not. + ```Shell -dream> The hulk fighting with sheldon cooper -s5 -n1 +dream> The hulk fighting with sheldon cooper -s5 -n1 dream> "woman closeup highly detailed" -s 150 # Reuse previous seed and apply face restoration -dream> "woman closeup highly detailed" --steps 150 --seed -1 -G 0.75 +dream> "woman closeup highly detailed" --steps 150 --seed -1 -G 0.75 ``` -You'll need to experiment to see if face restoration is making it better or worse for your specific prompt. +You'll need to experiment to see if face restoration is making it better or +worse for your specific prompt. -If you're on a container the output is set to the Docker volume. You can copy it wherever you want. +If you're on a container the output is set to the Docker volume. You can copy it +wherever you want. You can download it from the Docker Desktop app, Volumes, my-vol, data. -Or you can copy it from your Mac terminal. Keep in mind ```docker cp``` can't expand ```*.png``` so you'll need to specify the image file name. +Or you can copy it from your Mac terminal. Keep in mind `docker cp` can't expand +`*.png` so you'll need to specify the image file name. + +On your host Mac (you can use the name of any container that mounted the +volume): -On your host Mac (you can use the name of any container that mounted the volume): ```Shell -docker cp dummy:/data/000001.928403745.png /Users//Pictures +docker cp dummy:/data/000001.928403745.png /Users//Pictures ``` ## Image to Image -You can also do text-guided image-to-image translation. For example, turning a sketch into a detailed drawing. -```strength``` is a value between 0.0 and 1.0 that controls the amount of noise that is added to the input image. Values that approach 1.0 allow for lots of variations but will also produce images that are not semantically consistent with the input. 0.0 preserves image exactly, 1.0 replaces it completely. +You can also do text-guided image-to-image translation. For example, turning a +sketch into a detailed drawing. -Make sure your input image size dimensions are multiples of 64 e.g. 512x512. Otherwise you'll get ```Error: product of dimension sizes > 2**31'```. If you still get the error [try a different size](https://support.apple.com/guide/preview/resize-rotate-or-flip-an-image-prvw2015/mac#:~:text=image's%20file%20size-,In%20the%20Preview%20app%20on%20your%20Mac%2C%20open%20the%20file,is%20shown%20at%20the%20bottom.) like 512x256. +`strength` is a value between 0.0 and 1.0 that controls the amount of noise that +is added to the input image. Values that approach 1.0 allow for lots of +variations but will also produce images that are not semantically consistent +with the input. 0.0 preserves image exactly, 1.0 replaces it completely. + +Make sure your input image size dimensions are multiples of 64 e.g. 512x512. +Otherwise you'll get `Error: product of dimension sizes > 2**31'`. If you still +get the error +[try a different size](https://support.apple.com/guide/preview/resize-rotate-or-flip-an-image-prvw2015/mac#:~:text=image's%20file%20size-,In%20the%20Preview%20app%20on%20your%20Mac%2C%20open%20the%20file,is%20shown%20at%20the%20bottom.) +like 512x256. If you're on a Docker container, copy your input image into the Docker volume + ```Shell docker cp /Users//Pictures/sketch-mountains-input.jpg dummy:/data/ ``` -Try it out generating an image (or more). The ```dream``` script needs absolute paths to find the image so don't use ```~```. +Try it out generating an image (or more). The `dream` script needs absolute +paths to find the image so don't use `~`. If you're on your Mac -```Shell + +```Shell dream> "A fantasy landscape, trending on artstation" -I /Users//Pictures/sketch-mountains-input.jpg --strength 0.75 --steps 100 -n4 ``` + If you're on a Linux container on your Mac + ```Shell dream> "A fantasy landscape, trending on artstation" -I /data/sketch-mountains-input.jpg --strength 0.75 --steps 50 -n1 ``` ## Web Interface -You can use the ```dream``` script with a graphical web interface. Start the web server with: + +You can use the `dream` script with a graphical web interface. Start the web +server with: + ```Shell python3 scripts/dream.py --full_precision --web ``` -If it's running on your Mac point your Mac web browser to http://127.0.0.1:9090 + +If it's running on your Mac point your Mac web browser to http://127.0.0.1:9090 Press Control-C at the command line to stop the web server. ## Notes Some text you can add at the end of the prompt to make it very pretty: + ```Shell cinematic photo, highly detailed, cinematic lighting, ultra-detailed, ultrarealistic, photorealism, Octane Rendering, cyberpunk lights, Hyper Detail, 8K, HD, Unreal Engine, V-Ray, full hd, cyberpunk, abstract, 3d octane render + 4k UHD + immense detail + dramatic lighting + well lit + black, purple, blue, pink, cerulean, teal, metallic colours, + fine details, ultra photoreal, photographic, concept art, cinematic composition, rule of thirds, mysterious, eerie, photorealism, breathtaking detailed, painting art deco pattern, by hsiao, ron cheng, john james audubon, bizarre compositions, exquisite detail, extremely moody lighting, painted by greg rutkowski makoto shinkai takashi takeuchi studio ghibli, akihiko yoshida ``` The original scripts should work as well. + ```Shell python3 scripts/orig_scripts/txt2img.py --help python3 scripts/orig_scripts/txt2img.py --ddim_steps 100 --n_iter 1 --n_samples 1 --plms --prompt "new born baby kitten. Hyper Detail, Octane Rendering, Unreal Engine, V-Ray" python3 scripts/orig_scripts/txt2img.py --ddim_steps 5 --n_iter 1 --n_samples 1 --plms --prompt "ocean" # or --klms -``` \ No newline at end of file +``` diff --git a/ldm/dream/args.py b/ldm/dream/args.py index 2cb42d82a7..79b1d49f5d 100644 --- a/ldm/dream/args.py +++ b/ldm/dream/args.py @@ -400,7 +400,7 @@ class Args(object): postprocessing_group.add_argument( '--gfpgan_model_path', type=str, - default='experiments/pretrained_models/GFPGANv1.3.pth', + default='experiments/pretrained_models/GFPGANv1.4.pth', help='Indicates the path to the GFPGAN model, relative to --gfpgan_dir.', ) postprocessing_group.add_argument( diff --git a/ldm/dream/restoration/base.py b/ldm/dream/restoration/base.py index 5030c7075d..2605c4ac4b 100644 --- a/ldm/dream/restoration/base.py +++ b/ldm/dream/restoration/base.py @@ -2,7 +2,7 @@ class Restoration(): def __init__(self) -> None: pass - def load_face_restore_models(self, gfpgan_dir='./src/gfpgan', gfpgan_model_path='experiments/pretrained_models/GFPGANv1.3.pth'): + def load_face_restore_models(self, gfpgan_dir='./src/gfpgan', gfpgan_model_path='experiments/pretrained_models/GFPGANv1.4.pth'): # Load GFPGAN gfpgan = self.load_gfpgan(gfpgan_dir, gfpgan_model_path) if gfpgan.gfpgan_model_exists: diff --git a/ldm/dream/restoration/gfpgan.py b/ldm/dream/restoration/gfpgan.py index b3de707fac..473d708961 100644 --- a/ldm/dream/restoration/gfpgan.py +++ b/ldm/dream/restoration/gfpgan.py @@ -11,7 +11,7 @@ class GFPGAN(): def __init__( self, gfpgan_dir='src/gfpgan', - gfpgan_model_path='experiments/pretrained_models/GFPGANv1.3.pth') -> None: + gfpgan_model_path='experiments/pretrained_models/GFPGANv1.4.pth') -> None: self.model_path = os.path.join(gfpgan_dir, gfpgan_model_path) self.gfpgan_model_exists = os.path.isfile(self.model_path) @@ -50,7 +50,7 @@ class GFPGAN(): f'>> WARNING: GFPGAN not initialized.' ) print( - f'>> Download https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth to {self.model_path}, \nor change GFPGAN directory with --gfpgan_dir.' + f'>> Download https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth to {self.model_path}, \nor change GFPGAN directory with --gfpgan_dir.' ) image = image.convert('RGB') diff --git a/scripts/preload_models.py b/scripts/preload_models.py index c681ab91ad..bc4029ac7f 100644 --- a/scripts/preload_models.py +++ b/scripts/preload_models.py @@ -87,8 +87,8 @@ if gfpgan: try: import urllib.request - model_url = 'https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth' - model_dest = 'src/gfpgan/experiments/pretrained_models/GFPGANv1.3.pth' + model_url = 'https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth' + model_dest = 'src/gfpgan/experiments/pretrained_models/GFPGANv1.4.pth' if not os.path.exists(model_dest): print('downloading gfpgan model file...') From b1d1063a25fc504bde00bcdd5d4e8f0cd63c957c Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 24 Sep 2022 19:54:22 +1200 Subject: [PATCH 21/46] Fix CodeFormer not working if GFPGAN is enabeld --- ldm/generate.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ldm/generate.py b/ldm/generate.py index 9471d01f87..11ac655793 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -727,16 +727,16 @@ class Generate: print(">> ESRGAN is disabled. Image not upscaled.") if strength > 0: if self.gfpgan is not None or self.codeformer is not None: - if self.gfpgan is None: - if facetool == 'codeformer': - if self.codeformer is not None: - image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity) - else: - print('>> CodeFormer not found. Face restoration is disabled.') - else: + if facetool == 'gfpgan': + if self.gfpgan is None: print('>> GFPGAN not found. Face restoration is disabled.') - else: - image = self.gfpgan.process(image, strength, seed) + else: + image = self.gfpgan.process(image, strength, seed) + if facetool == 'codeformer': + if self.codeformer is None: + print('>> CodeFormer not found. Face restoration is disabled.') + else: + image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity) else: print(">> Face Restoration is disabled.") except Exception as e: From ac51ec4939395ee68f3de8849a140595990209b5 Mon Sep 17 00:00:00 2001 From: hipsterusername Date: Fri, 23 Sep 2022 09:09:48 -0400 Subject: [PATCH 22/46] Addressed merge conflicts for adding UI tooltips --- frontend/src/app/features.ts | 59 +++++++++++++++++++ frontend/src/common/components/GuideIcon.tsx | 22 +++++++ .../src/common/components/GuidePopover.tsx | 51 ++++++++++++++++ .../src/features/options/OptionsAccordion.tsx | 11 +++- .../src/features/system/SettingsModal.tsx | 20 ++++++- frontend/src/features/system/systemSlice.ts | 7 +++ 6 files changed, 166 insertions(+), 4 deletions(-) create mode 100644 frontend/src/app/features.ts create mode 100644 frontend/src/common/components/GuideIcon.tsx create mode 100644 frontend/src/common/components/GuidePopover.tsx diff --git a/frontend/src/app/features.ts b/frontend/src/app/features.ts new file mode 100644 index 0000000000..cb8455f09d --- /dev/null +++ b/frontend/src/app/features.ts @@ -0,0 +1,59 @@ +type FeatureHelpInfo = { + text: string; + href: string; + guideImage: string; +}; + +export enum Feature { + PROMPT, + GALLERY, + OUTPUT, + SEED_AND_VARIATION, + ESRGAN, + FACE_CORRECTION, + IMAGE_TO_IMAGE, + SAMPLER, +} + +export const FEATURES: Record = { + [Feature.PROMPT]: { + text: 'This field will take all prompt text, including both content and stylistic terms. CLI Commands will not work in the prompt.', + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.GALLERY]: { + 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', + }, + [Feature.OUTPUT]: { + text: 'The Height and Width of generations can be controlled here. If you experience errors, you may be generating an image too large for your system. The seamless option will more often result in repeating patterns in outputs.', + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.SEED_AND_VARIATION]: { + text: 'Seed values provide an initial set of noise which guide the denoising process. Try a variation with an amount of between 0 and 1 to change the output image for that seed.', + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, + [Feature.ESRGAN]: { + text: 'The ESRGAN setting can be used to increase the output resolution without requiring a higher width/height in the initial generation.', + href: 'link/to/docs/feature1.html', + guideImage: 'asset/path.gif', + }, + [Feature.FACE_CORRECTION]: { + text: 'Using GFPGAN or CodeFormer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher values will apply a stronger corrective pressure on outputs.', + href: 'link/to/docs/feature2.html', + guideImage: 'asset/path.gif', + }, + [Feature.IMAGE_TO_IMAGE]: { + 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', + }, + [Feature.SAMPLER]: { + text: 'This setting allows for different denoising samplers to be used, as well as the number of denoising steps used, which will change the resulting output.', + href: 'link/to/docs/feature3.html', + guideImage: 'asset/path.gif', + }, +}; diff --git a/frontend/src/common/components/GuideIcon.tsx b/frontend/src/common/components/GuideIcon.tsx new file mode 100644 index 0000000000..2f4312ae76 --- /dev/null +++ b/frontend/src/common/components/GuideIcon.tsx @@ -0,0 +1,22 @@ +import { Box, forwardRef, Icon } from '@chakra-ui/react'; +import { IconType } from 'react-icons'; +import { MdHelp } from 'react-icons/md'; +import { Feature } from '../../app/features'; +import GuidePopover from './GuidePopover'; + +type GuideIconProps = { + feature: Feature; + icon?: IconType; +}; + +const GuideIcon = forwardRef( + ({ feature, icon = MdHelp }: GuideIconProps, ref) => ( + + + + + + ) +); + +export default GuideIcon; diff --git a/frontend/src/common/components/GuidePopover.tsx b/frontend/src/common/components/GuidePopover.tsx new file mode 100644 index 0000000000..48a2f8d48f --- /dev/null +++ b/frontend/src/common/components/GuidePopover.tsx @@ -0,0 +1,51 @@ +import { + Popover, + PopoverArrow, + PopoverContent, + PopoverTrigger, + PopoverHeader, + Flex, + Box, +} from '@chakra-ui/react'; +import { SystemState } from '../../features/system/systemSlice'; +import { useAppSelector } from '../../app/store'; +import { RootState } from '../../app/store'; +import { createSelector } from '@reduxjs/toolkit'; +import { ReactElement } from 'react'; +import { Feature, FEATURES } from '../../app/features'; + +type GuideProps = { + children: ReactElement; + feature: Feature; +}; + +const systemSelector = createSelector( + (state: RootState) => state.system, + (system: SystemState) => system.shouldDisplayGuides +); + +const GuidePopover = ({ children, feature }: GuideProps) => { + const shouldDisplayGuides = useAppSelector(systemSelector); + const { text } = FEATURES[feature]; + return shouldDisplayGuides ? ( + + + {children} + + e.preventDefault()} + cursor={'initial'} + > + + + {text} + + + + ) : ( + <> + ); +}; + +export default GuidePopover; diff --git a/frontend/src/features/options/OptionsAccordion.tsx b/frontend/src/features/options/OptionsAccordion.tsx index ab60e98228..2568717090 100644 --- a/frontend/src/features/options/OptionsAccordion.tsx +++ b/frontend/src/features/options/OptionsAccordion.tsx @@ -31,6 +31,9 @@ import OutputOptions from './OutputOptions'; import ImageToImageOptions from './ImageToImageOptions'; import { ChangeEvent } from 'react'; +import GuideIcon from '../../common/components/GuideIcon'; +import { Feature } from '../../app/features'; + const optionsSelector = createSelector( (state: RootState) => state.options, (options: OptionsState) => { @@ -108,6 +111,7 @@ const OptionsAccordion = () => { Seed & Variation + @@ -121,6 +125,7 @@ const OptionsAccordion = () => { Sampler + @@ -144,6 +149,7 @@ const OptionsAccordion = () => { onChange={handleChangeShouldRunESRGAN} /> + @@ -160,13 +166,14 @@ const OptionsAccordion = () => { width={'100%'} mr={2} > - Fix Faces (GFPGAN) + Face Correction + @@ -190,6 +197,7 @@ const OptionsAccordion = () => { onChange={handleChangeShouldUseInitImage} /> + @@ -203,6 +211,7 @@ const OptionsAccordion = () => { Output + diff --git a/frontend/src/features/system/SettingsModal.tsx b/frontend/src/features/system/SettingsModal.tsx index 2f636dc44e..11b10bdbae 100644 --- a/frontend/src/features/system/SettingsModal.tsx +++ b/frontend/src/features/system/SettingsModal.tsx @@ -20,6 +20,7 @@ import { useAppDispatch, useAppSelector } from '../../app/store'; import { setShouldConfirmOnDelete, setShouldDisplayInProgress, + setShouldDisplayGuides, SystemState, } from './systemSlice'; import { RootState } from '../../app/store'; @@ -31,8 +32,8 @@ import { cloneElement, ReactElement } from 'react'; const systemSelector = createSelector( (state: RootState) => state.system, (system: SystemState) => { - const { shouldDisplayInProgress, shouldConfirmOnDelete } = system; - return { shouldDisplayInProgress, shouldConfirmOnDelete }; + const { shouldDisplayInProgress, shouldConfirmOnDelete, shouldDisplayGuides } = system; + return { shouldDisplayInProgress, shouldConfirmOnDelete, shouldDisplayGuides }; }, { memoizeOptions: { resultEqualityCheck: isEqual }, @@ -63,7 +64,7 @@ const SettingsModal = ({ children }: SettingsModalProps) => { onClose: onRefreshModalClose, } = useDisclosure(); - const { shouldDisplayInProgress, shouldConfirmOnDelete } = + const { shouldDisplayInProgress, shouldConfirmOnDelete, shouldDisplayGuides } = useAppSelector(systemSelector); const dispatch = useAppDispatch(); @@ -116,6 +117,19 @@ const SettingsModal = ({ children }: SettingsModalProps) => { /> + + + + Display help guides in configuration menus + + + dispatch(setShouldDisplayGuides(e.target.checked)) + } + /> + + Reset Web UI diff --git a/frontend/src/features/system/systemSlice.ts b/frontend/src/features/system/systemSlice.ts index f3d8295b05..fbb44bd9e1 100644 --- a/frontend/src/features/system/systemSlice.ts +++ b/frontend/src/features/system/systemSlice.ts @@ -31,6 +31,8 @@ export interface SystemState extends InvokeAI.SystemStatus, InvokeAI.SystemConfi totalIterations: number; currentStatus: string; currentStatusHasSteps: boolean; + + shouldDisplayGuides: boolean; } const initialSystemState = { @@ -39,6 +41,7 @@ const initialSystemState = { log: [], shouldShowLogViewer: false, shouldDisplayInProgress: false, + shouldDisplayGuides: true, isGFPGANAvailable: true, isESRGANAvailable: true, socketId: '', @@ -117,6 +120,9 @@ export const systemSlice = createSlice({ setSystemConfig: (state, action: PayloadAction) => { return { ...state, ...action.payload }; }, + setShouldDisplayGuides: (state, action: PayloadAction) => { + state.shouldDisplayGuides = action.payload; + }, }, }); @@ -132,6 +138,7 @@ export const { setSystemStatus, setCurrentStatus, setSystemConfig, + setShouldDisplayGuides, } = systemSlice.actions; export default systemSlice.reducer; From 66dac1884b31cce74c381892d26d7f0fcf034121 Mon Sep 17 00:00:00 2001 From: Mihail Dumitrescu Date: Fri, 23 Sep 2022 14:14:28 +0300 Subject: [PATCH 23/46] Fix Generate.sample_to_image crash. Build the base generator in same place and way as other generators to reduce the chance of missed arguments in the future. Fixes crash with display in-progress images, though note the feature still doesn't work for other reasons. --- ldm/generate.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ldm/generate.py b/ldm/generate.py index 11ac655793..e477e1d9ae 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -633,6 +633,12 @@ class Generate: return init_image, init_mask + def _make_base(self): + if not self.generators.get('base'): + from ldm.dream.generator import Generator + self.generators['base'] = Generator(self.model, self.precision) + return self.generators['base'] + def _make_img2img(self): if not self.generators.get('img2img'): from ldm.dream.generator.img2img import Img2Img @@ -751,13 +757,7 @@ class Generate: # to help WebGUI - front end to generator util function def sample_to_image(self, samples): - return self._sample_to_image(samples) - - def _sample_to_image(self, samples): - if not self.base_generator: - from ldm.dream.generator import Generator - self.base_generator = Generator(self.model) - return self.base_generator.sample_to_image(samples) + return self._make_base().sample_to_image(samples) def _set_sampler(self): msg = f'>> Setting Sampler to {self.sampler_name}' From e2bd492764d09568167e0357f2e6d3fcadabd2d3 Mon Sep 17 00:00:00 2001 From: Any-Winter-4079 <50542132+Any-Winter-4079@users.noreply.github.com> Date: Sat, 24 Sep 2022 17:07:33 +0200 Subject: [PATCH 24/46] Create Sampler Tips (SAMPLER_CONVERGENCE.md) --- docs/help/SAMPLER_CONVERGENCE.md | 141 +++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 docs/help/SAMPLER_CONVERGENCE.md diff --git a/docs/help/SAMPLER_CONVERGENCE.md b/docs/help/SAMPLER_CONVERGENCE.md new file mode 100644 index 0000000000..5dfee5dc4e --- /dev/null +++ b/docs/help/SAMPLER_CONVERGENCE.md @@ -0,0 +1,141 @@ +--- +title: SAMPLER CONVERGENCE +--- + +## *Sampler Convergence* + +As features keep increasing, making the right choices for your needs can become increasingly difficult. What sampler to use? And for how many steps? Do you change the CFG value? Do you use prompt weighting? Do you allow variations? + +Even once you have a result, do you blend it with other images? Pass it through `img2img`? With what strength? Do you use inpainting to correct small details? Outpainting to extend cropped sections? + +The purpose of this series of documents is to help you better understand these tools, so you can make the best out of them. Feel free to contribute with your own findings! + +In this document, we will talk about sampler convergence. + +Looking for a short version? Here's a TL;DR in 3 tables. + +| Remember | +|:---| +| Results converge as steps (`-s`) are increased (except for `K_DPM_2_A` and `K_EULER_A`). Often at ≥ `-s100`, but may require ≥ `-s700`). | +| Producing a batch of candidate images at low (`-s8` to `-s30`) step counts can save you hours of computation. | +| `K_HEUN` and `K_DPM_2` converge in less steps (but are slower). | +| `K_DPM_2_A` and `K_EULER_A` incorporate a lot of creativity/variability. | + +| Sampler | (3 sample avg) it/s (M1 Max 64GB, 512x512) | +|---|---| +| `DDIM` | 1.89 | +| `PLMS` | 1.86 | +| `K_EULER` | 1.86 | +| `K_LMS` | 1.91 | +| `K_HEUN` | 0.95 (slower) | +| `K_DPM_2` | 0.95 (slower) | +| `K_DPM_2_A` | 0.95 (slower) | +| `K_EULER_A` | 1.86 | + +| Suggestions | +|:---| +| For most use cases, `K_LMS`, `K_HEUN` and `K_DPM_2` are the best choices (the latter 2 run 0.5x as quick, but tend to converge 2x as quick as `K_LMS`). At very low steps (≤ `-s8`), `K_HEUN` and `K_DPM_2` are not recommended. Use `K_LMS` instead.| +| For variability, use `K_EULER_A` (runs 2x as quick as `K_DPM_2_A`). | + +--- + +### *Sampler results* + +Let's start by choosing a prompt and using it with each of our 8 samplers, running it for 10, 20, 30, 40, 50 and 100 steps. + +Anime. `"an anime girl" -W512 -H512 -C7.5 -S3031912972` + +![191636411-083c8282-6ed1-4f78-9273-ee87c0a0f1b6-min (1)](https://user-images.githubusercontent.com/50542132/191868725-7f7af991-e254-4c1f-83e7-bed8c9b2d34f.png) + +### *Sampler convergence* + +Immediately, you can notice results tend to converge -that is, as `-s` (step) values increase, images look more and more similar until there comes a point where the image no longer changes. + +You can also notice how `DDIM` and `PLMS` eventually tend to converge to K-sampler results as steps are increased. +Among K-samplers, `K_HEUN` and `K_DPM_2` seem to require the fewest steps to converge, and even at low step counts they are good indicators of the final result. And finally, `K_DPM_2_A` and `K_EULER_A` seem to do a bit of their own thing and don't keep much similarity with the rest of the samplers. + +### *Batch generation speedup* + +This realization is very useful because it means you don't need to create a batch of 100 images (`-n100`) at `-s100` to choose your favorite 2 or 3 images. +You can produce the same 100 images at `-s10` to `-s30` using a K-sampler (since they converge faster), get a rough idea of the final result, choose your 2 or 3 favorite ones, and then run `-s100` on those images to polish some details. +The latter technique is 3-8x as quick. + +Example: + +At 60s per 100 steps. + +(Option A) 60s * 100 images = 6000s (100 images at `-s100`, manually picking 3 favorites) + +(Option B) 6s * 100 images + 60s * 3 images = 780s (100 images at `-s10`, manually picking 3 favorites, and running those 3 at `-s100` to polish details) + +The result is 1 hour and 40 minutes (Option A) vs 13 minutes (Option B). + +### *Topic convergance* + +Now, these results seem interesting, but do they hold for other topics? How about nature? Food? People? Animals? Let's try! + +Nature. `"valley landscape wallpaper, d&d art, fantasy, painted, 4k, high detail, sharp focus, washed colors, elaborate excellent painted illustration" -W512 -H512 -C7.5 -S1458228930` + +![191736091-dda76929-00d1-4590-bef4-7314ea4ea419-min (1)](https://user-images.githubusercontent.com/50542132/191868763-b151c69e-0a72-4cf1-a151-5a64edd0c93e.png) + +With nature, you can see how initial results are even more indicative of final result -more so than with characters/people. `K_HEUN` and `K_DPM_2` are again the quickest indicators, almost right from the start. Results also converge faster (e.g. `K_HEUN` converged at `-s21`). + +Food. `"a hamburger with a bowl of french fries" -W512 -H512 -C7.5 -S4053222918` + +![191639011-f81d9d38-0a15-45f0-9442-a5e8d5c25f1f-min (1)](https://user-images.githubusercontent.com/50542132/191868898-98801a62-885f-4ea1-aee8-563503522aa9.png) + +Again, `K_HEUN` and `K_DPM_2` take the fewest number of steps to be good indicators of the final result. `K_DPM_2_A` and `K_EULER_A` seem to incorporate a lot of creativity/variability, capable of producing rotten hamburgers, but also of adding lettuce to the mix. And they're the only samplers that produced an actual 'bowl of fries'! + +Animals. `"grown tiger, full body" -W512 -H512 -C7.5 -S3721629802` + +![191771922-6029a4f5-f707-4684-9011-c6f96e25fe56-min (1)](https://user-images.githubusercontent.com/50542132/191868870-9e3b7d82-b909-429f-893a-13f6ec343454.png) + +`K_HEUN` and `K_DPM_2` once again require the least number of steps to be indicative of the final result (around `-s30`), while other samplers are still struggling with several tails or malformed back legs. + +It also takes longer to converge (for comparison, `K_HEUN` required around 150 steps to converge). This is normal, as producing human/animal faces/bodies is one of the things the model struggles the most with. For these topics, running for more steps will often increase coherence within the composition. + +People. `"Ultra realistic photo, (Miranda Bloom-Kerr), young, stunning model, blue eyes, blond hair, beautiful face, intricate, highly detailed, smooth, art by artgerm and greg rutkowski and alphonse mucha, stained glass" -W512 -H512 -C7.5 -S2131956332`. This time, we will go up to 300 steps. + +![Screenshot 2022-09-23 at 02 05 48-min (1)](https://user-images.githubusercontent.com/50542132/191871743-6802f199-0ffd-4986-98c5-df2d8db30d18.png) + +Observing the results, it again takes longer for all samplers to converge (`K_HEUN` took around 150 steps), but we can observe good indicative results much earlier (see: `K_HEUN`). Conversely, `DDIM` and `PLMS` are still undergoing moderate changes (see: lace around her neck), even at `-s300`. + +In fact, as we can see in this other experiment, some samplers can take 700+ steps to converge when generating people. + +![191988191-c586b75a-2d7f-4351-b705-83cc1149881a-min (1)](https://user-images.githubusercontent.com/50542132/191992123-7e0759d6-6220-42c4-a961-88c7071c5ee6.png) + +Note also the point of convergence may not be the most desirable state (e.g. I prefer an earlier version of the face, more rounded), but it will probably be the most coherent arms/hands/face attributes-wise. You can always merge different images with a photo editing tool and pass it through `img2img` to smoothen the composition. + +### *Sampler generation times* + +Once we understand the concept of sampler convergence, we must look into the performance of each sampler in terms of steps (iterations) per second, as not all samplers run at the same speed. + +On my M1 Max with 64GB of RAM, for a 512x512 image: +| Sampler | (3 sample average) it/s | +|---|---| +| `DDIM` | 1.89 | +| `PLMS` | 1.86 | +| `K_EULER` | 1.86 | +| `K_LMS` | 1.91 | +| `K_HEUN` | 0.95 (slower) | +| `K_DPM_2` | 0.95 (slower) | +| `K_DPM_2_A` | 0.95 (slower) | +| `K_EULER_A` | 1.86 | + +Combining our results with the steps per second of each sampler, three choices come out on top: `K_LMS`, `K_HEUN` and `K_DPM_2` (where the latter two run 0.5x as quick but tend to converge 2x as quick as `K_LMS`). For creativity and a lot of variation between iterations, `K_EULER_A` can be a good choice (which runs 2x as quick as `K_DPM_2_A`). + +Additionally, image generation at very low steps (≤ `-s8`) is not recommended for `K_HEUN` and `K_DPM_2`. Use `K_LMS` instead. + +192044949-67d5d441-a0d5-4d5a-be30-5dda4fc28a00-min + +### *Three key points* + +Finally, it is relevant to mention that, in general, there are 3 important moments in the process of image formation as steps increase: + +* The (earliest) point at which an image becomes a good indicator of the final result (useful for batch generation at low step values, to then improve the quality/coherence of the chosen images via running the same prompt and seed for more steps). + +* The (earliest) point at which an image becomes coherent, even if different from the result if steps are increased (useful for batch generation at low step values, where quality/coherence is improved via techniques other than increasing the steps -e.g. via inpainting). + +* The point at which an image fully converges. + +Hence, remember that your workflow/strategy should define your optimal number of steps, even for the same prompt and seed (for example, if you seek full convergence, you may run `K_LMS` for `-s200` in the case of the red-haired girl, but `K_LMS` and `-s20`-taking one tenth the time- may do as well if your workflow includes adding small details, such as the missing shoulder strap, via `img2img`). From 636c356aafdeceab646648bcb25ba38c16a49e32 Mon Sep 17 00:00:00 2001 From: David Burnett Date: Sat, 24 Sep 2022 14:33:12 +0100 Subject: [PATCH 25/46] facexlib and codeformer are broken on mps currently, force CPU device. --- ldm/generate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldm/generate.py b/ldm/generate.py index e477e1d9ae..6dfbfdc018 100644 --- a/ldm/generate.py +++ b/ldm/generate.py @@ -742,7 +742,8 @@ class Generate: if self.codeformer is None: print('>> CodeFormer not found. Face restoration is disabled.') else: - image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity) + cf_device = 'cpu' if str(self.device) == 'mps' else self.device + image = self.codeformer.process(image=image, strength=strength, device=cf_device, seed=seed, fidelity=codeformer_fidelity) else: print(">> Face Restoration is disabled.") except Exception as e: From 90500698584f6ec9f56d957d2eae05db4908bad9 Mon Sep 17 00:00:00 2001 From: mofuzz Date: Sun, 25 Sep 2022 01:27:57 -0400 Subject: [PATCH 26/46] Update INSTALL_MAC.md --- docs/installation/INSTALL_MAC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation/INSTALL_MAC.md b/docs/installation/INSTALL_MAC.md index c000e818bb..b1b79d7682 100644 --- a/docs/installation/INSTALL_MAC.md +++ b/docs/installation/INSTALL_MAC.md @@ -61,8 +61,8 @@ curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o Mi # continue from here # clone the repo -git clone https://github.com/lstein/stable-diffusion.git -cd stable-diffusion +git clone https://github.com/invoke-ai/InvokeAI.git +cd InvokeAI # # wait until the checkpoint file has downloaded, then proceed From 5e23ec25f9589795b8d8b8adc3769bdcf06fedf4 Mon Sep 17 00:00:00 2001 From: spezialspezial <75758219+spezialspezial@users.noreply.github.com> Date: Sun, 25 Sep 2022 08:29:50 +0200 Subject: [PATCH 27/46] Update CLI.md guidance scale must be >1.0 --- docs/features/CLI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/CLI.md b/docs/features/CLI.md index d809d48841..b949e20aab 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -121,7 +121,7 @@ Here are the dream> command that apply to txt2img: | --height | -H | 512 | Height of generated image | | --iterations | -n | 1 | How many images to generate from this prompt | | --steps | -s | 50 | How many steps of refinement to apply | -| --cfg_scale | -C | 7.5 | How hard to try to match the prompt to the generated image; any number greater than 0.0 works, but the useful range is roughly 5.0 to 20.0 | +| --cfg_scale | -C | 7.5 | How hard to try to match the prompt to the generated image; any number greater than 1.0 works, but the useful range is roughly 5.0 to 20.0 | | --seed | -S | None | Set the random seed for the next series of images. This can be used to recreate an image generated previously.| | --sampler | -A| k_lms | Sampler to use. Use -h to get list of available samplers. | | --grid | -g | False | Turn on grid mode to return a single image combining all the images generated by this prompt | From af8d73a8e8a4d579c5b0560f10ce19677df1dd2e Mon Sep 17 00:00:00 2001 From: H4rk <63350517+h4rk8s@users.noreply.github.com> Date: Sun, 25 Sep 2022 18:04:56 +0800 Subject: [PATCH 28/46] Update dream.py In the case of this "point", the Warp Terminal cannot be clicked directly to trigger the browser to open, and Chrome is a blank page. It should open properly once you remove it --- scripts/dream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dream.py b/scripts/dream.py index 891a448bf2..629addbda2 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -358,7 +358,7 @@ def dream_server_loop(t2i, host, port, outdir): f"Point your browser at http://localhost:{port} or use the host's DNS name or IP address.") else: print(">> Default host address now 127.0.0.1 (localhost). Use --host 0.0.0.0 to bind any address.") - print(f">> Point your browser at http://{host}:{port}.") + print(f">> Point your browser at http://{host}:{port}") try: dream_server.serve_forever() From 98950e67e9e4382d38f1b69734ec8d8d715207ed Mon Sep 17 00:00:00 2001 From: Ben Alkov Date: Sat, 24 Sep 2022 13:48:31 -0400 Subject: [PATCH 29/46] fix(install): pin 'transformers' Either Huggingface's 'transformers' lib introduced a regression in v4.22, or we changed how we're using 'transformers' in such a way that we break when using v4.22. Pin to 'transformers==4.21.*' Signed-off-by: Ben Alkov --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d0b739f82a..7323ad66bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ taming-transformers-rom1504 test-tube torch-fidelity torchmetrics -transformers +transformers==4.21.* flask==2.1.3 flask_socketio==5.3.0 flask_cors==3.0.10 From db537f154e6129acf790e362b535917b48d29c9b Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 26 Sep 2022 06:24:31 +1000 Subject: [PATCH 30/46] Increases socketio timeout --- backend/server.py | 2 + frontend/dist/assets/index.48fa0a78.js | 694 ++++++++++++++++++++++++ frontend/dist/assets/index.632c341a.js | 694 ------------------------ frontend/dist/index.html | 2 +- frontend/src/app/socketio/middleware.ts | 4 +- 5 files changed, 700 insertions(+), 696 deletions(-) create mode 100644 frontend/dist/assets/index.48fa0a78.js delete mode 100644 frontend/dist/assets/index.632c341a.js diff --git a/backend/server.py b/backend/server.py index b5a04a6e9b..e56319391b 100644 --- a/backend/server.py +++ b/backend/server.py @@ -103,6 +103,8 @@ socketio = SocketIO( engineio_logger=engineio_logger, max_http_buffer_size=max_http_buffer_size, cors_allowed_origins=cors_allowed_origins, + ping_interval=(50,50), + ping_timeout=60 ) diff --git a/frontend/dist/assets/index.48fa0a78.js b/frontend/dist/assets/index.48fa0a78.js new file mode 100644 index 0000000000..53868ce475 --- /dev/null +++ b/frontend/dist/assets/index.48fa0a78.js @@ -0,0 +1,694 @@ +function Yj(e,t){for(var n=0;ni[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerpolicy&&(c.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?c.credentials="include":o.crossorigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=n(o);fetch(o.href,c)}})();var vc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k={exports:{}},e5={exports:{}};/** + * @license React + * react.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e,t){(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.2.0",i=Symbol.for("react.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),M=Symbol.iterator,B="@@iterator";function I(S){if(S===null||typeof S!="object")return null;var A=M&&S[M]||S[B];return typeof A=="function"?A:null}var F={current:null},z={transition:null},$={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},q={current:null},K={},le=null;function pe(S){le=S}K.setExtraStackFrame=function(S){le=S},K.getCurrentStack=null,K.getStackAddendum=function(){var S="";le&&(S+=le);var A=K.getCurrentStack;return A&&(S+=A()||""),S};var se=!1,Se=!1,qe=!1,ae=!1,ue=!1,ge={ReactCurrentDispatcher:F,ReactCurrentBatchConfig:z,ReactCurrentOwner:q};ge.ReactDebugCurrentFrame=K,ge.ReactCurrentActQueue=$;function Ce(S){{for(var A=arguments.length,V=new Array(A>1?A-1:0),G=1;G1?A-1:0),G=1;G1){for(var Ot=Array(St),yt=0;yt1){for(var jt=Array(yt),Tt=0;Tt is not supported and will be removed in a future major release. Did you mean to render instead?")),A.Provider},set:function(Ne){A.Provider=Ne}},_currentValue:{get:function(){return A._currentValue},set:function(Ne){A._currentValue=Ne}},_currentValue2:{get:function(){return A._currentValue2},set:function(Ne){A._currentValue2=Ne}},_threadCount:{get:function(){return A._threadCount},set:function(Ne){A._threadCount=Ne}},Consumer:{get:function(){return V||(V=!0,ie("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),A.Consumer}},displayName:{get:function(){return A.displayName},set:function(Ne){te||(Ce("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",Ne),te=!0)}}}),A.Consumer=ze}return A._currentRenderer=null,A._currentRenderer2=null,A}var vr=-1,Ia=0,Fi=1,La=2;function X(S){if(S._status===vr){var A=S._result,V=A();if(V.then(function(ze){if(S._status===Ia||S._status===vr){var Ne=S;Ne._status=Fi,Ne._result=ze}},function(ze){if(S._status===Ia||S._status===vr){var Ne=S;Ne._status=La,Ne._result=ze}}),S._status===vr){var G=S;G._status=Ia,G._result=V}}if(S._status===Fi){var te=S._result;return te===void 0&&ie(`lazy: Expected the result of a dynamic import() call. Instead received: %s + +Your code should look like: + const MyComponent = lazy(() => import('./MyComponent')) + +Did you accidentally put curly braces around the import?`,te),"default"in te||ie(`lazy: Expected the result of a dynamic import() call. Instead received: %s + +Your code should look like: + const MyComponent = lazy(() => import('./MyComponent'))`,te),te.default}else throw S._result}function Ue(S){var A={_status:vr,_result:S},V={$$typeof:R,_payload:A,_init:X};{var G,te;Object.defineProperties(V,{defaultProps:{configurable:!0,get:function(){return G},set:function(ze){ie("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),G=ze,Object.defineProperty(V,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return te},set:function(ze){ie("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),te=ze,Object.defineProperty(V,"propTypes",{enumerable:!0})}}})}return V}function Ke(S){S!=null&&S.$$typeof===N?ie("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof S!="function"?ie("forwardRef requires a render function but was given %s.",S===null?"null":typeof S):S.length!==0&&S.length!==2&&ie("forwardRef render functions accept exactly two parameters: props and ref. %s",S.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),S!=null&&(S.defaultProps!=null||S.propTypes!=null)&&ie("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var A={$$typeof:b,render:S};{var V;Object.defineProperty(A,"displayName",{enumerable:!1,configurable:!0,get:function(){return V},set:function(G){V=G,!S.name&&!S.displayName&&(S.displayName=G)}})}return A}var Ct;Ct=Symbol.for("react.module.reference");function on(S){return!!(typeof S=="string"||typeof S=="function"||S===c||S===m||ue||S===u||S===x||S===w||ae||S===O||se||Se||qe||typeof S=="object"&&S!==null&&(S.$$typeof===R||S.$$typeof===N||S.$$typeof===h||S.$$typeof===v||S.$$typeof===b||S.$$typeof===Ct||S.getModuleId!==void 0))}function xn(S,A){on(S)||ie("memo: The first argument must be a component. Instead received: %s",S===null?"null":typeof S);var V={$$typeof:N,type:S,compare:A===void 0?null:A};{var G;Object.defineProperty(V,"displayName",{enumerable:!1,configurable:!0,get:function(){return G},set:function(te){G=te,!S.name&&!S.displayName&&(S.displayName=te)}})}return V}function nt(){var S=F.current;return S===null&&ie(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),S}function qt(S){var A=nt();if(S._context!==void 0){var V=S._context;V.Consumer===S?ie("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):V.Provider===S&&ie("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return A.useContext(S)}function Vn(S){var A=nt();return A.useState(S)}function Bn(S,A,V){var G=nt();return G.useReducer(S,A,V)}function ln(S){var A=nt();return A.useRef(S)}function Ur(S,A){var V=nt();return V.useEffect(S,A)}function vi(S,A){var V=nt();return V.useInsertionEffect(S,A)}function Po(S,A){var V=nt();return V.useLayoutEffect(S,A)}function ya(S,A){var V=nt();return V.useCallback(S,A)}function io(S,A){var V=nt();return V.useMemo(S,A)}function Eu(S,A,V){var G=nt();return G.useImperativeHandle(S,A,V)}function gi(S,A){{var V=nt();return V.useDebugValue(S,A)}}function Hs(){var S=nt();return S.useTransition()}function zi(S){var A=nt();return A.useDeferredValue(S)}function Jt(){var S=nt();return S.useId()}function Bi(S,A,V){var G=nt();return G.useSyncExternalStore(S,A,V)}var ba=0,Mo,os,Io,ss,ls,Lo,Fo;function us(){}us.__reactDisabledLog=!0;function Ws(){{if(ba===0){Mo=console.log,os=console.info,Io=console.warn,ss=console.error,ls=console.group,Lo=console.groupCollapsed,Fo=console.groupEnd;var S={configurable:!0,enumerable:!0,value:us,writable:!0};Object.defineProperties(console,{info:S,log:S,warn:S,error:S,group:S,groupCollapsed:S,groupEnd:S})}ba++}}function Gs(){{if(ba--,ba===0){var S={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Me({},S,{value:Mo}),info:Me({},S,{value:os}),warn:Me({},S,{value:Io}),error:Me({},S,{value:ss}),group:Me({},S,{value:ls}),groupCollapsed:Me({},S,{value:Lo}),groupEnd:Me({},S,{value:Fo})})}ba<0&&ie("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var yi=ge.ReactCurrentDispatcher,Mr;function Fa(S,A,V){{if(Mr===void 0)try{throw Error()}catch(te){var G=te.stack.trim().match(/\n( *(at )?)/);Mr=G&&G[1]||""}return` +`+Mr+S}}var Sa=!1,za;{var cs=typeof WeakMap=="function"?WeakMap:Map;za=new cs}function zo(S,A){if(!S||Sa)return"";{var V=za.get(S);if(V!==void 0)return V}var G;Sa=!0;var te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=yi.current,yi.current=null,Ws();try{if(A){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(Bt){G=Bt}Reflect.construct(S,[],Ne)}else{try{Ne.call()}catch(Bt){G=Bt}S.call(Ne.prototype)}}else{try{throw Error()}catch(Bt){G=Bt}S()}}catch(Bt){if(Bt&&G&&typeof Bt.stack=="string"){for(var Ve=Bt.stack.split(` +`),st=G.stack.split(` +`),St=Ve.length-1,Ot=st.length-1;St>=1&&Ot>=0&&Ve[St]!==st[Ot];)Ot--;for(;St>=1&&Ot>=0;St--,Ot--)if(Ve[St]!==st[Ot]){if(St!==1||Ot!==1)do if(St--,Ot--,Ot<0||Ve[St]!==st[Ot]){var yt=` +`+Ve[St].replace(" at new "," at ");return S.displayName&&yt.includes("")&&(yt=yt.replace("",S.displayName)),typeof S=="function"&&za.set(S,yt),yt}while(St>=1&&Ot>=0);break}}}finally{Sa=!1,yi.current=ze,Gs(),Error.prepareStackTrace=te}var jt=S?S.displayName||S.name:"",Tt=jt?Fa(jt):"";return typeof S=="function"&&za.set(S,Tt),Tt}function fs(S,A,V){return zo(S,!1)}function Pl(S){var A=S.prototype;return!!(A&&A.isReactComponent)}function xa(S,A,V){if(S==null)return"";if(typeof S=="function")return zo(S,Pl(S));if(typeof S=="string")return Fa(S);switch(S){case x:return Fa("Suspense");case w:return Fa("SuspenseList")}if(typeof S=="object")switch(S.$$typeof){case b:return fs(S.render);case N:return xa(S.type,A,V);case R:{var G=S,te=G._payload,ze=G._init;try{return xa(ze(te),A,V)}catch{}}}return""}var Bo={},Ba=ge.ReactDebugCurrentFrame;function bi(S){if(S){var A=S._owner,V=xa(S.type,S._source,A?A.type:null);Ba.setExtraStackFrame(V)}else Ba.setExtraStackFrame(null)}function Ys(S,A,V,G,te){{var ze=Function.call.bind(an);for(var Ne in S)if(ze(S,Ne)){var Ve=void 0;try{if(typeof S[Ne]!="function"){var st=Error((G||"React class")+": "+V+" type `"+Ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof S[Ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw st.name="Invariant Violation",st}Ve=S[Ne](A,Ne,G,V,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(St){Ve=St}Ve&&!(Ve instanceof Error)&&(bi(te),ie("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",G||"React class",V,Ne,typeof Ve),bi(null)),Ve instanceof Error&&!(Ve.message in Bo)&&(Bo[Ve.message]=!0,bi(te),ie("Failed %s type: %s",V,Ve.message),bi(null))}}}function un(S){if(S){var A=S._owner,V=xa(S.type,S._source,A?A.type:null);pe(V)}else pe(null)}var Si;Si=!1;function Uo(){if(q.current){var S=Lt(q.current.type);if(S)return` + +Check the render method of \``+S+"`."}return""}function $t(S){if(S!==void 0){var A=S.fileName.replace(/^.*[\\\/]/,""),V=S.lineNumber;return` + +Check your code at `+A+":"+V+"."}return""}function qs(S){return S!=null?$t(S.__source):""}var xr={};function Ui(S){var A=Uo();if(!A){var V=typeof S=="string"?S:S.displayName||S.name;V&&(A=` + +Check the top-level render call using <`+V+">.")}return A}function Ga(S,A){if(!(!S._store||S._store.validated||S.key!=null)){S._store.validated=!0;var V=Ui(A);if(!xr[V]){xr[V]=!0;var G="";S&&S._owner&&S._owner!==q.current&&(G=" It was passed a child from "+Lt(S._owner.type)+"."),un(S),ie('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',V,G),un(null)}}}function oo(S,A){if(typeof S=="object"){if(Wt(S))for(var V=0;V",te=" Did you accidentally export a JSX literal instead of a component?"):Ne=typeof S,ie("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ne,te)}var Ve=it.apply(this,arguments);if(Ve==null)return Ve;if(G)for(var st=2;st10&&Ce("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),G._updatedFibers.clear()}}}var so=!1,xi=null;function Ks(S){if(xi===null)try{var A=("require"+Math.random()).slice(0,7),V=e&&e[A];xi=V.call(e,"timers").setImmediate}catch{xi=function(te){so===!1&&(so=!0,typeof MessageChannel>"u"&&ie("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var ze=new MessageChannel;ze.port1.onmessage=te,ze.port2.postMessage(void 0)}}return xi(S)}var vn=0,Fn=!1;function Ml(S){{var A=vn;vn++,$.current===null&&($.current=[]);var V=$.isBatchingLegacy,G;try{if($.isBatchingLegacy=!0,G=S(),!V&&$.didScheduleLegacyUpdate){var te=$.current;te!==null&&($.didScheduleLegacyUpdate=!1,de(te))}}catch(jt){throw Ua(A),jt}finally{$.isBatchingLegacy=V}if(G!==null&&typeof G=="object"&&typeof G.then=="function"){var ze=G,Ne=!1,Ve={then:function(jt,Tt){Ne=!0,ze.then(function(Bt){Ua(A),vn===0?W(Bt,jt,Tt):jt(Bt)},function(Bt){Ua(A),Tt(Bt)})}};return!Fn&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){Ne||(Fn=!0,ie("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),Ve}else{var st=G;if(Ua(A),vn===0){var St=$.current;St!==null&&(de(St),$.current=null);var Ot={then:function(jt,Tt){$.current===null?($.current=[],W(st,jt,Tt)):jt(st)}};return Ot}else{var yt={then:function(jt,Tt){jt(st)}};return yt}}}}function Ua(S){S!==vn-1&&ie("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),vn=S}function W(S,A,V){{var G=$.current;if(G!==null)try{de(G),Ks(function(){G.length===0?($.current=null,A(S)):W(S,A,V)})}catch(te){V(te)}else A(S)}}var Q=!1;function de(S){if(!Q){Q=!0;var A=0;try{for(;A0;){var Qt=hn-1>>>1,Tn=je[Qt];if(v(Tn,it)>0)je[Qt]=it,je[hn]=Tn,hn=Qt;else return}}function h(je,it,_t){for(var hn=_t,Qt=je.length,Tn=Qt>>>1;hn_t&&(!je||$n()));){var hn=ae.callback;if(typeof hn=="function"){ae.callback=null,ue=ae.priorityLevel;var Qt=ae.expirationTime<=_t,Tn=hn(Qt);_t=e.unstable_now(),typeof Tn=="function"?ae.callback=Tn:ae===c(se)&&u(se),we(_t)}else u(se);ae=c(se)}if(ae!==null)return!0;var Ln=c(Se);return Ln!==null&&kt(Me,Ln.startTime-_t),!1}function at(je,it){switch(je){case b:case x:case w:case N:case R:break;default:je=w}var _t=ue;ue=je;try{return it()}finally{ue=_t}}function gt(je){var it;switch(ue){case b:case x:case w:it=w;break;default:it=ue;break}var _t=ue;ue=it;try{return je()}finally{ue=_t}}function Ht(je){var it=ue;return function(){var _t=ue;ue=it;try{return je.apply(this,arguments)}finally{ue=_t}}}function Ze(je,it,_t){var hn=e.unstable_now(),Qt;if(typeof _t=="object"&&_t!==null){var Tn=_t.delay;typeof Tn=="number"&&Tn>0?Qt=hn+Tn:Qt=hn}else Qt=hn;var Ln;switch(je){case b:Ln=$;break;case x:Ln=q;break;case R:Ln=pe;break;case N:Ln=le;break;case w:default:Ln=K;break}var kr=Qt+Ln,Dn={id:qe++,callback:it,priorityLevel:je,startTime:Qt,expirationTime:kr,sortIndex:-1};return Qt>hn?(Dn.sortIndex=Qt,o(Se,Dn),c(se)===null&&Dn===c(Se)&&(ie?Oe():ie=!0,kt(Me,Qt-hn))):(Dn.sortIndex=kr,o(se,Dn),!Ce&&!ge&&(Ce=!0,tn(Ie))),Dn}function ct(){}function wt(){!Ce&&!ge&&(Ce=!0,tn(Ie))}function zt(){return c(se)}function Ge(je){je.callback=null}function Wt(){return ue}var ye=!1,et=null,Nt=-1,lt=i,Sn=-1;function $n(){var je=e.unstable_now()-Sn;return!(je125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}je>0?lt=Math.floor(1e3/je):lt=i}var On=function(){if(et!==null){var je=e.unstable_now();Sn=je;var it=!0,_t=!0;try{_t=et(it,je)}finally{_t?gn():(ye=!1,et=null)}}else ye=!1},gn;if(typeof me=="function")gn=function(){me(On)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,Je=He.port2;He.port1.onmessage=On,gn=function(){Je.postMessage(null)}}else gn=function(){xe(On,0)};function tn(je){et=je,ye||(ye=!0,gn())}function kt(je,it){Nt=xe(function(){je(e.unstable_now())},it)}function Oe(){Ee(Nt),Nt=-1}var Yt=Lt,_n=null;e.unstable_IdlePriority=R,e.unstable_ImmediatePriority=b,e.unstable_LowPriority=N,e.unstable_NormalPriority=w,e.unstable_Profiling=_n,e.unstable_UserBlockingPriority=x,e.unstable_cancelCallback=Ge,e.unstable_continueExecution=wt,e.unstable_forceFrameRate=an,e.unstable_getCurrentPriorityLevel=Wt,e.unstable_getFirstCallbackNode=zt,e.unstable_next=gt,e.unstable_pauseExecution=ct,e.unstable_requestPaint=Yt,e.unstable_runWithPriority=at,e.unstable_scheduleCallback=Ze,e.unstable_shouldYield=$n,e.unstable_wrapCallback=Ht,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()})(ZI);(function(e){e.exports=ZI})(XI);/** + * @license React + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=k.exports,t=XI.exports,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,i=!1;function o(r){i=r}function c(r){if(!i){for(var a=arguments.length,s=new Array(a>1?a-1:0),f=1;f1?a-1:0),f=1;f2&&(r[0]==="o"||r[0]==="O")&&(r[1]==="n"||r[1]==="N")}function kr(r,a,s,f){if(s!==null&&s.type===He)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":{if(f)return!1;if(s!==null)return!s.acceptsBooleans;var p=r.toLowerCase().slice(0,5);return p!=="data-"&&p!=="aria-"}default:return!1}}function Dn(r,a,s,f){if(a===null||typeof a>"u"||kr(r,a,s,f))return!0;if(f)return!1;if(s!==null)switch(s.type){case kt:return!a;case Oe:return a===!1;case Yt:return isNaN(a);case _n:return isNaN(a)||a<1}return!1}function va(r){return Rn.hasOwnProperty(r)?Rn[r]:null}function jn(r,a,s,f,p,y,C){this.acceptsBooleans=a===tn||a===kt||a===Oe,this.attributeName=f,this.attributeNamespace=p,this.mustUseProperty=s,this.propertyName=r,this.type=a,this.sanitizeURL=y,this.removeEmptyString=C}var Rn={},ga=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];ga.forEach(function(r){Rn[r]=new jn(r,He,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var a=r[0],s=r[1];Rn[a]=new jn(a,Je,!1,s,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){Rn[r]=new jn(r,tn,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){Rn[r]=new jn(r,tn,!1,r,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(r){Rn[r]=new jn(r,kt,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){Rn[r]=new jn(r,kt,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){Rn[r]=new jn(r,Oe,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){Rn[r]=new jn(r,_n,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){Rn[r]=new jn(r,Yt,!1,r.toLowerCase(),null,!1,!1)});var Sr=/[\-\:]([a-z])/g,ko=function(r){return r[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(r){var a=r.replace(Sr,ko);Rn[a]=new jn(a,Je,!1,r,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(r){var a=r.replace(Sr,ko);Rn[a]=new jn(a,Je,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var a=r.replace(Sr,ko);Rn[a]=new jn(a,Je,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){Rn[r]=new jn(r,Je,!1,r.toLowerCase(),null,!1,!1)});var as="xlinkHref";Rn[as]=new jn("xlinkHref",Je,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){Rn[r]=new jn(r,Je,!1,r.toLowerCase(),null,!0,!0)});var is=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Oo=!1;function Do(r){!Oo&&is.test(r)&&(Oo=!0,u("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(r)))}function vr(r,a,s,f){if(f.mustUseProperty){var p=f.propertyName;return r[p]}else{Sn(s,a),f.sanitizeURL&&Do(""+s);var y=f.attributeName,C=null;if(f.type===Oe){if(r.hasAttribute(y)){var T=r.getAttribute(y);return T===""?!0:Dn(a,s,f,!1)?T:T===""+s?s:T}}else if(r.hasAttribute(y)){if(Dn(a,s,f,!1))return r.getAttribute(y);if(f.type===kt)return s;C=r.getAttribute(y)}return Dn(a,s,f,!1)?C===null?s:C:C===""+s?s:C}}function Ia(r,a,s,f){{if(!Tn(a))return;if(!r.hasAttribute(a))return s===void 0?void 0:null;var p=r.getAttribute(a);return Sn(s,a),p===""+s?s:p}}function Fi(r,a,s,f){var p=va(a);if(!Ln(a,p,f)){if(Dn(a,s,p,f)&&(s=null),f||p===null){if(Tn(a)){var y=a;s===null?r.removeAttribute(y):(Sn(s,a),r.setAttribute(y,""+s))}return}var C=p.mustUseProperty;if(C){var T=p.propertyName;if(s===null){var D=p.type;r[T]=D===kt?!1:""}else r[T]=s;return}var U=p.attributeName,H=p.attributeNamespace;if(s===null)r.removeAttribute(U);else{var ee=p.type,J;ee===kt||ee===Oe&&s===!0?J="":(Sn(s,U),J=""+s,p.sanitizeURL&&Do(J.toString())),H?r.setAttributeNS(H,U,J):r.setAttribute(U,J)}}}var La=Symbol.for("react.element"),X=Symbol.for("react.portal"),Ue=Symbol.for("react.fragment"),Ke=Symbol.for("react.strict_mode"),Ct=Symbol.for("react.profiler"),on=Symbol.for("react.provider"),xn=Symbol.for("react.context"),nt=Symbol.for("react.forward_ref"),qt=Symbol.for("react.suspense"),Vn=Symbol.for("react.suspense_list"),Bn=Symbol.for("react.memo"),ln=Symbol.for("react.lazy"),Ur=Symbol.for("react.scope"),vi=Symbol.for("react.debug_trace_mode"),Po=Symbol.for("react.offscreen"),ya=Symbol.for("react.legacy_hidden"),io=Symbol.for("react.cache"),Eu=Symbol.for("react.tracing_marker"),gi=Symbol.iterator,Hs="@@iterator";function zi(r){if(r===null||typeof r!="object")return null;var a=gi&&r[gi]||r[Hs];return typeof a=="function"?a:null}var Jt=Object.assign,Bi=0,ba,Mo,os,Io,ss,ls,Lo;function Fo(){}Fo.__reactDisabledLog=!0;function us(){{if(Bi===0){ba=console.log,Mo=console.info,os=console.warn,Io=console.error,ss=console.group,ls=console.groupCollapsed,Lo=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Fo,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Bi++}}function Ws(){{if(Bi--,Bi===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Jt({},r,{value:ba}),info:Jt({},r,{value:Mo}),warn:Jt({},r,{value:os}),error:Jt({},r,{value:Io}),group:Jt({},r,{value:ss}),groupCollapsed:Jt({},r,{value:ls}),groupEnd:Jt({},r,{value:Lo})})}Bi<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Gs=n.ReactCurrentDispatcher,yi;function Mr(r,a,s){{if(yi===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);yi=f&&f[1]||""}return` +`+yi+r}}var Fa=!1,Sa;{var za=typeof WeakMap=="function"?WeakMap:Map;Sa=new za}function cs(r,a){if(!r||Fa)return"";{var s=Sa.get(r);if(s!==void 0)return s}var f;Fa=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var y;y=Gs.current,Gs.current=null,us();try{if(a){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(ve){f=ve}Reflect.construct(r,[],C)}else{try{C.call()}catch(ve){f=ve}r.call(C.prototype)}}else{try{throw Error()}catch(ve){f=ve}r()}}catch(ve){if(ve&&f&&typeof ve.stack=="string"){for(var T=ve.stack.split(` +`),D=f.stack.split(` +`),U=T.length-1,H=D.length-1;U>=1&&H>=0&&T[U]!==D[H];)H--;for(;U>=1&&H>=0;U--,H--)if(T[U]!==D[H]){if(U!==1||H!==1)do if(U--,H--,H<0||T[U]!==D[H]){var ee=` +`+T[U].replace(" at new "," at ");return r.displayName&&ee.includes("")&&(ee=ee.replace("",r.displayName)),typeof r=="function"&&Sa.set(r,ee),ee}while(U>=1&&H>=0);break}}}finally{Fa=!1,Gs.current=y,Ws(),Error.prepareStackTrace=p}var J=r?r.displayName||r.name:"",he=J?Mr(J):"";return typeof r=="function"&&Sa.set(r,he),he}function zo(r,a,s){return cs(r,!0)}function fs(r,a,s){return cs(r,!1)}function Pl(r){var a=r.prototype;return!!(a&&a.isReactComponent)}function xa(r,a,s){if(r==null)return"";if(typeof r=="function")return cs(r,Pl(r));if(typeof r=="string")return Mr(r);switch(r){case qt:return Mr("Suspense");case Vn:return Mr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case nt:return fs(r.render);case Bn:return xa(r.type,a,s);case ln:{var f=r,p=f._payload,y=f._init;try{return xa(y(p),a,s)}catch{}}}return""}function Bo(r){switch(r._debugOwner&&r._debugOwner.type,r._debugSource,r.tag){case N:return Mr(r.type);case le:return Mr("Lazy");case $:return Mr("Suspense");case Se:return Mr("SuspenseList");case h:case b:case K:return fs(r.type);case F:return fs(r.type.render);case v:return zo(r.type);default:return""}}function Ba(r){try{var a="",s=r;do a+=Bo(s),s=s.return;while(s);return a}catch(f){return` +Error generating stack: `+f.message+` +`+f.stack}}function bi(r,a,s){var f=r.displayName;if(f)return f;var p=a.displayName||a.name||"";return p!==""?s+"("+p+")":s}function Ys(r){return r.displayName||"Context"}function un(r){if(r==null)return null;if(typeof r.tag=="number"&&u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case Ue:return"Fragment";case X:return"Portal";case Ct:return"Profiler";case Ke:return"StrictMode";case qt:return"Suspense";case Vn:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case xn:var a=r;return Ys(a)+".Consumer";case on:var s=r;return Ys(s._context)+".Provider";case nt:return bi(r,r.render,"ForwardRef");case Bn:var f=r.displayName||null;return f!==null?f:un(r.type)||"Memo";case ln:{var p=r,y=p._payload,C=p._init;try{return un(C(y))}catch{return null}}}return null}function Si(r,a,s){var f=a.displayName||a.name||"";return r.displayName||(f!==""?s+"("+f+")":s)}function Uo(r){return r.displayName||"Context"}function $t(r){var a=r.tag,s=r.type;switch(a){case ge:return"Cache";case B:var f=s;return Uo(f)+".Consumer";case I:var p=s;return Uo(p._context)+".Provider";case se:return"DehydratedFragment";case F:return Si(s,s.render,"ForwardRef");case O:return"Fragment";case N:return s;case w:return"Portal";case x:return"Root";case R:return"Text";case le:return un(s);case M:return s===Ke?"StrictMode":"Mode";case ae:return"Offscreen";case z:return"Profiler";case qe:return"Scope";case $:return"Suspense";case Se:return"SuspenseList";case Ce:return"TracingMarker";case v:case h:case pe:case b:case q:case K:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;break}return null}var qs=n.ReactDebugCurrentFrame,xr=null,Ui=!1;function Ga(){{if(xr===null)return null;var r=xr._debugOwner;if(r!==null&&typeof r<"u")return $t(r)}return null}function oo(){return xr===null?"":Ba(xr)}function _r(){qs.getCurrentStack=null,xr=null,Ui=!1}function or(r){qs.getCurrentStack=r===null?null:oo,xr=r,Ui=!1}function $o(){return xr}function Kr(r){Ui=r}function pr(r){return""+r}function aa(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return gn(r),r;default:return""}}var _u={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function so(r,a){_u[a.type]||a.onChange||a.onInput||a.readOnly||a.disabled||a.value==null||u("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),a.onChange||a.readOnly||a.disabled||a.checked==null||u("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function xi(r){var a=r.type,s=r.nodeName;return s&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ks(r){return r._valueTracker}function vn(r){r._valueTracker=null}function Fn(r){var a="";return r&&(xi(r)?a=r.checked?"true":"false":a=r.value),a}function Ml(r){var a=xi(r)?"checked":"value",s=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);gn(r[a]);var f=""+r[a];if(!(r.hasOwnProperty(a)||typeof s>"u"||typeof s.get!="function"||typeof s.set!="function")){var p=s.get,y=s.set;Object.defineProperty(r,a,{configurable:!0,get:function(){return p.call(this)},set:function(T){gn(T),f=""+T,y.call(this,T)}}),Object.defineProperty(r,a,{enumerable:s.enumerable});var C={getValue:function(){return f},setValue:function(T){gn(T),f=""+T},stopTracking:function(){vn(r),delete r[a]}};return C}}function Ua(r){Ks(r)||(r._valueTracker=Ml(r))}function W(r){if(!r)return!1;var a=Ks(r);if(!a)return!0;var s=a.getValue(),f=Fn(r);return f!==s?(a.setValue(f),!0):!1}function Q(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var de=!1,ot=!1,cn=!1,zn=!1;function Kt(r){var a=r.type==="checkbox"||r.type==="radio";return a?r.checked!=null:r.value!=null}function S(r,a){var s=r,f=a.checked,p=Jt({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??s._wrapperState.initialChecked});return p}function A(r,a){so("input",a),a.checked!==void 0&&a.defaultChecked!==void 0&&!ot&&(u("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",Ga()||"A component",a.type),ot=!0),a.value!==void 0&&a.defaultValue!==void 0&&!de&&(u("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",Ga()||"A component",a.type),de=!0);var s=r,f=a.defaultValue==null?"":a.defaultValue;s._wrapperState={initialChecked:a.checked!=null?a.checked:a.defaultChecked,initialValue:aa(a.value!=null?a.value:f),controlled:Kt(a)}}function V(r,a){var s=r,f=a.checked;f!=null&&Fi(s,"checked",f,!1)}function G(r,a){var s=r;{var f=Kt(a);!s._wrapperState.controlled&&f&&!zn&&(u("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),zn=!0),s._wrapperState.controlled&&!f&&!cn&&(u("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),cn=!0)}V(r,a);var p=aa(a.value),y=a.type;if(p!=null)y==="number"?(p===0&&s.value===""||s.value!=p)&&(s.value=pr(p)):s.value!==pr(p)&&(s.value=pr(p));else if(y==="submit"||y==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?Ve(s,a.type,p):a.hasOwnProperty("defaultValue")&&Ve(s,a.type,aa(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function te(r,a,s){var f=r;if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var p=a.type,y=p==="submit"||p==="reset";if(y&&(a.value===void 0||a.value===null))return;var C=pr(f._wrapperState.initialValue);s||C!==f.value&&(f.value=C),f.defaultValue=C}var T=f.name;T!==""&&(f.name=""),f.defaultChecked=!f.defaultChecked,f.defaultChecked=!!f._wrapperState.initialChecked,T!==""&&(f.name=T)}function ze(r,a){var s=r;G(s,a),Ne(s,a)}function Ne(r,a){var s=a.name;if(a.type==="radio"&&s!=null){for(var f=r;f.parentNode;)f=f.parentNode;Sn(s,"name");for(var p=f.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),y=0;y.")))}):a.dangerouslySetInnerHTML!=null&&(Ot||(Ot=!0,u("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))),a.selected!=null&&!st&&(u("Use the `defaultValue` or `value` props on must be a scalar value if `multiple` is false.%s",s,Ca())}}}}function Pn(r,a,s,f){var p=r.options;if(a){for(var y=s,C={},T=0;T.");var f=Jt({},a,{value:void 0,defaultValue:void 0,children:pr(s._wrapperState.initialValue)});return f}function wv(r,a){var s=r;so("textarea",a),a.value!==void 0&&a.defaultValue!==void 0&&!sb&&(u("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",Ga()||"A component"),sb=!0);var f=a.value;if(f==null){var p=a.children,y=a.defaultValue;if(p!=null){u("Use the `defaultValue` or `value` props instead of setting children on