Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.55k stars 278 forks source link

concurrent api #383

Open lisea2017 opened 8 months ago

lisea2017 commented 8 months ago

First, confirm

What happened?

When conducting concurrent testing on this API, I observed that it can only execute sequentially and cannot run in parallel. How can I modify it to support concurrent execution?

Steps to reproduce the problem

use jmeter test http://127.0.0.1:7860/reactor/image

Sysinfo

{ "Platform": "Linux-5.15.0-60-generic-x86_64-with-glibc2.31", "Python": "3.10.11", "Version": "v1.7.0", "Commit": "cf2772fab0af5573da775e7437e6acdca424f26e", "Script path": "/data1/ai/stable-diffusion-webui", "Data path": "/data1/ai/stable-diffusion-webui", "Extensions dir": "/data1/ai/stable-diffusion-webui/extensions", "Checksum": "f887c98ac33b36cfe67ce323f04b1aa3c6a14dd4fa477584da83a4c0951df0d4", "Commandline": [ "launch.py", "--api", "--listen" ], "Torch env info": { "torch_version": "2.0.1+cu118", "is_debug_build": "False", "cuda_compiled_version": "11.8", "gcc_version": "(Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0", "clang_version": null, "cmake_version": "version 3.26.3", "os": "Ubuntu 20.04 LTS (x86_64)", "libc_version": "glibc-2.31", "python_version": "3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] (64-bit runtime)", "python_platform": "Linux-5.15.0-60-generic-x86_64-with-glibc2.31", "is_cuda_available": "True", "cuda_runtime_version": "11.8.89", "cuda_module_loading": "LAZY", "nvidia_driver_version": "525.78.01", "nvidia_gpu_models": "GPU 0: NVIDIA GeForce RTX 2080", "cudnn_version": null, "pip_version": "pip3", "pip_packages": [ "lion-pytorch==0.0.8", "numpy==1.23.5", "open-clip-torch==2.20.0", "pytorch-lightning==1.9.4", "torch==2.0.1+cu118", "torchdiffeq==0.2.3", "torchmetrics==0.11.4", "torchsde==0.2.6", "torchvision==0.15.2+cu118" ], "conda_packages": "", "hip_compiled_version": "N/A", "hip_runtime_version": "N/A", "miopen_runtime_version": "N/A", "caching_allocator_config": "", "is_xnnpack_available": "True", "cpu_info": [ "Architecture: x86_64", "CPU op-mode(s): 32-bit, 64-bit", "Byte Order: Little Endian", "Address sizes: 39 bits physical, 48 bits virtual", "CPU(s): 16", "On-line CPU(s) list: 0-15", "Thread(s) per core: 2", "Core(s) per socket: 8", "Socket(s): 1", "NUMA node(s): 1", "Vendor ID: GenuineIntel", "CPU family: 6", "Model: 165", "Model name: Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz", "Stepping: 5", "CPU MHz: 2900.000", "CPU max MHz: 4800.0000", "CPU min MHz: 800.0000", "BogoMIPS: 5799.77", "Virtualization: VT-x", "L1d cache: 256 KiB", "L1i cache: 256 KiB", "L2 cache: 2 MiB", "L3 cache: 16 MiB", "NUMA node0 CPU(s): 0-15", "Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled", "Vulnerability L1tf: Not affected", "Vulnerability Mds: Not affected", "Vulnerability Meltdown: Not affected", "Vulnerability Mmio stale data: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable", "Vulnerability Retbleed: Mitigation; Enhanced IBRS", "Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp", "Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and user pointer sanitization", "Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence", "Vulnerability Srbds: Vulnerable: No microcode", "Vulnerability Tsx async abort: Not affected", "Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp pku ospke md_clear flush_l1d arch_capabilities" ] }, "Exceptions": [ { "exception": "[TypeError(\"'coroutine' object is not iterable\"), TypeError('vars() argument must have dict attribute')]", "traceback": [ [ "/data1/ai/stable-diffusion-webui/modules/api/api.py, line 186, exception_handling", "return await call_next(request)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py, line 84, call_next", "raise app_exc" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py, line 70, coro", "await self.app(scope, receive_or_disconnect, send_no_error)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py, line 108, call__", "response = await self.dispatch_func(request, call_next)" ], [ "/data1/ai/stable-diffusion-webui/modules/api/api.py, line 150, log_and_time", "res: Response = await call_next(req)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py, line 84, call_next", "raise app_exc" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py, line 70, coro", "await self.app(scope, receive_or_disconnect, send_no_error)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/cors.py, line 84, call", "await self.app(scope, receive, send)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py, line 24, call", "await responder(scope, receive, send)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py, line 44, call", "await self.app(scope, receive, self.send_with_gzip)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py, line 79, call", "raise exc" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py, line 68, call", "await self.app(scope, receive, sender)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py, line 21, call", "raise e" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py, line 18, call", "await self.app(scope, receive, send)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py, line 718, call", "await route.handle(scope, receive, send)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py, line 276, handle", "await self.app(scope, receive, send)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py, line 66, app", "response = await func(request)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py, line 255, app", "content = await serialize_response(" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py, line 152, serialize_response", "return jsonable_encoder(response_content)" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/encoders.py, line 117, jsonable_encoder", "encoded_value = jsonable_encoder(" ], [ "/data1/ai/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/encoders.py, line 160, jsonable_encoder", "raise ValueError(errors) from e" ] ] }, { "exception": "name 'List' is not defined", "traceback": [ [ "/data1/ai/stable-diffusion-webui/modules/script_callbacks.py, line 139, app_started_callback", "c.callback(demo, app)" ], [ "/data1/ai/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/api.py, line 58, controlnet_api", "controlnet_input_images: List[str] = Body([], title='Controlnet Input Images')," ] ] }, { "exception": "cannot import name 'wrap_gradio_gpu_call' from 'webui' (/data1/ai/stable-diffusion-webui/webui.py)", "traceback": [ [ "/data1/ai/stable-diffusion-webui/modules/scripts.py, line 469, load_scripts", "script_module = script_loading.load_module(scriptfile.path)" ], [ "/data1/ai/stable-diffusion-webui/modules/script_loading.py, line 10, load_module", "module_spec.loader.exec_module(module)" ], [ ", line 883, exec_module", "" ], [ ", line 241, _call_with_frames_removed", "" ], [ "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/scripts/tagger.py, line 5, ", "from tagger.ui import on_ui_tabs" ], [ "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/tagger/ui.py, line 10, ", "from webui import wrap_gradio_gpu_call" ] ] }, { "exception": "cannot import name 'models_path' from partially initialized module 'modules.shared' (most likely due to a circular import) (/data1/ai/stable-diffusion-webui/modules/shared.py)", "traceback": [ [ "/data1/ai/stable-diffusion-webui/modules/script_loading.py, line 26, preload_extensions", "module = load_module(preload_script)" ], [ "/data1/ai/stable-diffusion-webui/modules/script_loading.py, line 10, load_module", "module_spec.loader.exec_module(module)" ], [ ", line 883, exec_module", "" ], [ ", line 241, _call_with_frames_removed", "" ], [ "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/preload.py, line 4, ", "from modules.shared import models_path" ] ] } ], "CPU": { "model": "x86_64", "count logical": 16, "count physical": 8 }, "RAM": { "total": "31GB", "used": "4GB", "free": "15GB", "active": "8GB", "inactive": "6GB", "buffers": "341MB", "cached": "12GB", "shared": "16MB" }, "Extensions": [ { "name": "a1111-sd-webui-locon", "path": "/data1/ai/stable-diffusion-webui/extensions/a1111-sd-webui-locon", "version": "59a92862", "branch": "main", "remote": "https://github.com/KohakuBlueleaf/a1111-sd-webui-locon" }, { "name": "a1111-sd-webui-lycoris", "path": "/data1/ai/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris", "version": "b0d24ca6", "branch": "main", "remote": "https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris.git" }, { "name": "a1111-sd-webui-tagcomplete", "path": "/data1/ai/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete", "version": "da65feea", "branch": "main", "remote": "https://gitcode.net/ranting8323/a1111-sd-webui-tagcomplete.git" }, { "name": "booru2prompt", "path": "/data1/ai/stable-diffusion-webui/extensions/booru2prompt", "version": "4bd88839", "branch": "master", "remote": "https://github.com/Malisius/booru2prompt.git" }, { "name": "multidiffusion-upscaler-for-automatic1111", "path": "/data1/ai/stable-diffusion-webui/extensions/multidiffusion-upscaler-for-automatic1111", "version": "50f5f889", "branch": "main", "remote": "https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git" }, { "name": "openpose-editor", "path": "/data1/ai/stable-diffusion-webui/extensions/openpose-editor", "version": "d74fdd72", "branch": "master", "remote": "https://github.com/fkunn1326/openpose-editor.git" }, { "name": "sd-webui-additional-networks", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-additional-networks", "version": "e9f3d622", "branch": "main", "remote": "https://github.com/kohya-ss/sd-webui-additional-networks.git" }, { "name": "sd-webui-bilingual-localization", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-bilingual-localization", "version": "89a02280", "branch": "main", "remote": "https://github.com/journey-ad/sd-webui-bilingual-localization.git" }, { "name": "sd-webui-controlnet", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-controlnet", "version": "a8bf0c39", "branch": "main", "remote": "https://github.com/Mikubill/sd-webui-controlnet.git" }, { "name": "sd-webui-reactor", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-reactor", "version": "9778e4f2", "branch": "main", "remote": "https://github.com/Gourieff/sd-webui-reactor.git" }, { "name": "sd-webui-segment-anything", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-segment-anything", "version": "89a2213f", "branch": "master", "remote": "https://github.com/continue-revolution/sd-webui-segment-anything.git" }, { "name": "sd-webui-stablesr", "path": "/data1/ai/stable-diffusion-webui/extensions/sd-webui-stablesr", "version": "17b75e98", "branch": "master", "remote": "https://github.com/pkuliyi2015/sd-webui-stablesr.git" }, { "name": "sd_dreambooth_extension", "path": "/data1/ai/stable-diffusion-webui/extensions/sd_dreambooth_extension", "version": "926ae204", "branch": "main", "remote": "https://github.com/d8ahazard/sd_dreambooth_extension" }, { "name": "stable-diffusion-NPW", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-NPW", "version": "b9d9c859", "branch": "main", "remote": "https://github.com/muerrilla/stable-diffusion-NPW" }, { "name": "stable-diffusion-webui-dataset-tag-editor", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-dataset-tag-editor", "version": "43b0478f", "branch": "main", "remote": "https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor" }, { "name": "stable-diffusion-webui-images-browser", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser", "version": "7da8aec6", "branch": "main", "remote": "https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git" }, { "name": "stable-diffusion-webui-localization-zh_CN", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-localization-zh_CN", "version": "582ca24d", "branch": "main", "remote": "https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN" }, { "name": "stable-diffusion-webui-promptgen", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-promptgen", "version": "84e58b5d", "branch": "master", "remote": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git" }, { "name": "stable-diffusion-webui-wd14-tagger", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger", "version": "3ba3a735", "branch": "master", "remote": "https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git" } ], "Inactive extensions": [ { "name": "Stable-Diffusion-Webui-Prompt-Translator", "path": "/data1/ai/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Prompt-Translator", "version": "a827ef8d", "branch": "main", "remote": "https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator" }, { "name": "stable-diffusion-webui-aesthetic-image-scorer", "path": "/data1/ai/stable-diffusion-webui/extensions/stable-diffusion-webui-aesthetic-image-scorer", "version": "1c3ab7a1", "branch": "main", "remote": "https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer.git" } ], "Environment": { "COMMANDLINE_ARGS": "--api --listen", "GIT": "git", "GRADIO_ANALYTICS_ENABLED": "False" }, "Config": { "samples_save": true, "samples_format": "png", "samples_filename_pattern": "", "save_images_add_number": true, "grid_save": true, "grid_format": "png", "grid_extended_filename": false, "grid_only_if_multiple": true, "grid_prevent_empty_spots": false, "n_rows": -1, "enable_pnginfo": true, "save_txt": false, "save_images_before_face_restoration": false, "save_images_before_highres_fix": false, "save_images_before_color_correction": false, "save_mask": false, "save_mask_composite": false, "jpeg_quality": 80, "webp_lossless": false, "export_for_4chan": true, "img_downscale_threshold": 4.0, "target_side_length": 4000, "img_max_size_mp": 200, "use_original_name_batch": true, "use_upscaler_name_as_suffix": false, "save_selected_only": true, "do_not_add_watermark": false, "temp_dir": "", "clean_temp_dir_at_start": false, "outdir_samples": "", "outdir_txt2img_samples": "outputs/txt2img-images", "outdir_img2img_samples": "outputs/img2img-images", "outdir_extras_samples": "outputs/extras-images", "outdir_grids": "", "outdir_txt2img_grids": "outputs/txt2img-grids", "outdir_img2img_grids": "outputs/img2img-grids", "outdir_save": "log/images", "save_to_dirs": true, "grid_save_to_dirs": true, "use_save_to_dirs_for_ui": false, "directories_filename_pattern": "[date]", "directories_max_prompt_words": 8, "ESRGAN_tile": 192, "ESRGAN_tile_overlap": 8, "realesrgan_enabled_models": [ "R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B" ], "upscaler_for_img2img": null, "face_restoration_model": "CodeFormer", "code_former_weight": 0.5, "face_restoration_unload": false, "show_warnings": false, "memmon_poll_rate": 8, "samples_log_stdout": false, "multiple_tqdm": true, "print_hypernet_extra": false, "unload_models_when_training": false, "pin_memory": false, "save_optimizer_state": false, "save_training_settings_to_txt": true, "dataset_filename_word_regex": "", "dataset_filename_join_string": " ", "training_image_repeats_per_epoch": 1, "training_write_csv_every": 500, "training_xattention_optimizations": false, "training_enable_tensorboard": false, "training_tensorboard_save_images": false, "training_tensorboard_flush_every": 120, "sd_model_checkpoint": "v2-1_512-ema-pruned.safetensors [df955bdf6b]", "sd_checkpoint_cache": 0, "sd_vae_checkpoint_cache": 0, "sd_vae": "vqgan_cfw_00011_vae_only.ckpt", "sd_vae_as_default": true, "inpainting_mask_weight": 1.0, "initial_noise_multiplier": 1.0, "img2img_color_correction": false, "img2img_fix_steps": false, "img2img_background_color": "#ffffff", "enable_quantization": false, "enable_emphasis": false, "enable_batch_seeds": true, "comma_padding_backtrack": 20, "CLIP_stop_at_last_layers": 1, "upcast_attn": false, "use_old_emphasis_implementation": false, "use_old_karras_scheduler_sigmas": false, "no_dpmpp_sde_batch_determinism": false, "use_old_hires_fix_width_height": false, "interrogate_keep_models_in_memory": false, "interrogate_return_ranks": false, "interrogate_clip_num_beams": 1, "interrogate_clip_min_length": 24, "interrogate_clip_max_length": 48, "interrogate_clip_dict_limit": 1500, "interrogate_clip_skip_categories": [], "interrogate_deepbooru_score_threshold": 0.5, "deepbooru_sort_alpha": true, "deepbooru_use_spaces": false, "deepbooru_escape": true, "deepbooru_filter_tags": "", "extra_networks_default_view": "cards", "extra_networks_default_multiplier": 1.0, "extra_networks_card_width": 0, "extra_networks_card_height": 0, "extra_networks_add_text_separator": " ", "sd_hypernetwork": "None", "return_grid": true, "return_mask": false, "return_mask_composite": false, "do_not_show_images": false, "add_model_hash_to_info": true, "add_model_name_to_info": true, "disable_weights_auto_swap": true, "send_seed": true, "send_size": true, "font": "", "js_modal_lightbox": true, "js_modal_lightbox_initially_zoomed": true, "show_progress_in_title": true, "samplers_in_dropdown": true, "dimensions_and_batch_together": true, "keyedit_precision_attention": 0.1, "keyedit_precision_extra": 0.05, "quicksettings": "sd_model_checkpoint,sd_vae", "hidden_tabs": [], "ui_reorder": "inpaint, sampler, checkboxes, hires_fix, dimensions, cfg, seed, batch, override_settings, scripts", "ui_extra_networks_tab_reorder": "", "localization": "zh_CN", "show_progressbar": true, "live_previews_enable": true, "show_progress_grid": true, "show_progress_every_n_steps": 10, "show_progress_type": "Approx NN", "live_preview_content": "Prompt", "live_preview_refresh_period": 1000, "hide_samplers": [], "eta_ddim": 0.0, "eta_ancestral": 1.0, "ddim_discretize": "uniform", "s_churn": 0.0, "s_tmin": 0.0, "s_noise": 1.0, "eta_noise_seed_delta": 0, "always_discard_next_to_last_sigma": false, "uni_pc_variant": "bh1", "uni_pc_skip_type": "time_uniform", "uni_pc_order": 3, "uni_pc_lower_order_final": true, "postprocessing_enable_in_main_ui": [], "postprocessing_operation_order": [], "upscaling_max_images_in_cache": 5, "disabled_extensions": [ "Stable-Diffusion-Webui-Prompt-Translator", "stable-diffusion-webui-aesthetic-image-scorer" ], "disable_all_extensions": "none", "sd_checkpoint_hash": "df955bdf6b682338ea9b55dfc0d8f3475aadf4836e204893d28b82355e0956d2", "ldsr_steps": 100, "ldsr_cached": false, "SWIN_tile": 192, "SWIN_tile_overlap": 8, "sd_lora": "None", "ais_exif_pnginfo_group": [], "ais_windows_tag_group": [], "ais_windows_category_group": [], "ais_generation_params_text_group": [], "ais_force_cpu": false, "image_browser_active_tabs": "txt2img, img2img, txt2img-grids, img2img-grids, Extras, Favorites, Others", "image_browser_hidden_components": [], "image_browser_with_subdirs": true, "image_browser_preload": false, "image_browser_copy_image": false, "image_browser_delete_message": true, "image_browser_txt_files": true, "image_browser_logger_warning": false, "image_browser_logger_debug": false, "image_browser_delete_recycle": false, "image_browser_scan_exif": true, "image_browser_mod_shift": false, "image_browser_mod_ctrl_shift": false, "image_browser_enable_maint": true, "image_browser_ranking_pnginfo": false, "image_browser_page_columns": 6.0, "image_browser_page_rows": 6.0, "image_browser_pages_perload": 20.0, "image_browser_use_thumbnail": false, "image_browser_thumbnail_size": 200.0, "promptgen_names": "AUTOMATIC/promptgen-lexart, AUTOMATIC/promptgen-majinai-safe, AUTOMATIC/promptgen-majinai-unsafe", "promptgen_device": "gpu", "bilingual_localization_enabled": true, "bilingual_localization_logger": false, "bilingual_localization_file": "zh_CN", "bilingual_localization_order": "Translation First", "control_net_model_config": "models/cldm_v15.yaml", "control_net_model_adapter_config": "models/sketch_adapter_v14.yaml", "control_net_detectedmap_dir": "detected_maps", "control_net_models_path": "", "control_net_max_models_num": 1, "control_net_model_cache_size": 1, "control_net_control_transfer": false, "control_net_no_detectmap": false, "control_net_detectmap_autosaving": false, "control_net_only_midctrl_hires": true, "control_net_allow_script_control": false, "control_net_skip_img2img_processing": false, "control_net_monocular_depth_optim": false, "control_net_only_mid_control": false, "control_net_cfg_based_guidance": false, "control_net_sync_field_args": false, "dataset_editor_image_columns": 6.0, "dataset_editor_max_res": 0.0, "dataset_editor_use_temp_files": false, "dataset_editor_use_raw_clip_token": true, "additional_networks_extra_lora_path": "", "additional_networks_sort_models_by": "name", "additional_networks_reverse_sort_order": false, "additional_networks_model_name_filter": "", "additional_networks_xy_grid_model_metadata": "", "additional_networks_hash_thread_count": 1.0, "additional_networks_back_up_model_when_saving": true, "additional_networks_show_only_safetensors": false, "additional_networks_show_only_models_with_metadata": "disabled", "additional_networks_max_top_tags": 20.0, "additional_networks_max_dataset_folders": 20.0, "tac_tagFile": "danbooru.csv", "tac_active": true, "tac_activeIn.txt2img": true, "tac_activeIn.img2img": true, "tac_activeIn.negativePrompts": true, "tac_activeIn.thirdParty": true, "tac_activeIn.modelList": "", "tac_activeIn.modelListMode": "Blacklist", "tac_slidingPopup": true, "tac_maxResults": 5.0, "tac_showAllResults": false, "tac_resultStepLength": 100.0, "tac_delayTime": 100.0, "tac_useWildcards": true, "tac_useEmbeddings": true, "tac_useHypernetworks": true, "tac_useLoras": true, "tac_showWikiLinks": false, "tac_replaceUnderscores": true, "tac_escapeParentheses": true, "tac_appendComma": true, "tac_alias.searchByAlias": true, "tac_alias.onlyShowAlias": false, "tac_translation.translationFile": "danbooru.csv", "tac_translation.oldFormat": false, "tac_translation.searchByTranslation": true, "tac_extra.extraFile": "extra-quality-tags.csv", "tac_extra.addMode": "Insert before", "tac_keymap": "{\n \"MoveUp\": \"ArrowUp\",\n \"MoveDown\": \"ArrowDown\",\n \"JumpUp\": \"PageUp\",\n \"JumpDown\": \"PageDown\",\n \"JumpToStart\": \"Home\",\n \"JumpToEnd\": \"End\",\n \"ChooseSelected\": \"Enter\",\n \"ChooseFirstOrSelected\": \"Tab\",\n \"Close\": \"Escape\"\n}", "tac_colormap": "{\n \"danbooru\": {\n \"-1\": [\"red\", \"maroon\"],\n \"0\": [\"lightblue\", \"dodgerblue\"],\n \"1\": [\"indianred\", \"firebrick\"],\n \"3\": [\"violet\", \"darkorchid\"],\n \"4\": [\"lightgreen\", \"darkgreen\"],\n \"5\": [\"orange\", \"darkorange\"]\n },\n \"e621\": {\n \"-1\": [\"red\", \"maroon\"],\n \"0\": [\"lightblue\", \"dodgerblue\"],\n \"1\": [\"gold\", \"goldenrod\"],\n \"3\": [\"violet\", \"darkorchid\"],\n \"4\": [\"lightgreen\", \"darkgreen\"],\n \"5\": [\"tomato\", \"darksalmon\"],\n \"6\": [\"red\", \"maroon\"],\n \"7\": [\"whitesmoke\", \"black\"],\n \"8\": [\"seagreen\", \"darkseagreen\"]\n }\n}", "quicksettings_list": [ "sd_model_checkpoint", "sd_vae" ], "restore_config_state_file": "", "sd_vae_overrides_per_model_preferences": false, "ui_reorder_list": [ "inpaint", "sampler", "checkboxes", "hires_fix", "dimensions", "cfg", "seed", "batch", "override_settings", "scripts" ], "SCUNET_tile": 256, "SCUNET_tile_overlap": 8, "SWIN_torch_compile": false, "hypertile_enable_unet": false, "hypertile_enable_unet_secondpass": false, "hypertile_max_depth_unet": 3, "hypertile_max_tile_unet": 256, "hypertile_swap_size_unet": 3, "hypertile_enable_vae": false, "hypertile_max_depth_vae": 3, "hypertile_max_tile_vae": 128, "hypertile_swap_size_vae": 3, "tac_useLycos": true, "tac_translation.liveTranslation": false, "tac_chantFile": "demo-chants.json", "bilingual_localization_dirs": "{\"zh_CN\": \"extensions/stable-diffusion-webui-localization-zh_CN/localizations/zh_CN.json\"}", "control_net_modules_path": "", "controlnet_show_batch_images_in_ui": false, "controlnet_increment_seed_during_batch": false, "image_browser_debug_level": "0 - none", "image_browser_swipe": false, "image_browser_img_tooltips": true, "image_browser_scoring_type": "aesthetic_score", "image_browser_show_progress": true }, "Startup": { "total": 29.02776789665222, "records": { "initial startup": 0.013531684875488281, "prepare environment/checks": 3.5762786865234375e-05, "prepare environment/git version info": 0.0020220279693603516, "prepare environment/torch GPU test": 0.9957554340362549, "prepare environment/clone repositores": 0.0062601566314697266, "prepare environment/install requirements": 6.830485582351685, "prepare environment/run extensions installers/sd_dreambooth_extension": 10.57453441619873, "prepare environment/run extensions installers/stable-diffusion-webui-promptgen": 3.528594970703125e-05, "prepare environment/run extensions installers/stable-diffusion-webui-wd14-tagger": 9.775161743164062e-06, "prepare environment/run extensions installers/stable-diffusion-webui-images-browser": 0.06266951560974121, "prepare environment/run extensions installers/stable-diffusion-NPW": 2.8848648071289062e-05, "prepare environment/run extensions installers/a1111-sd-webui-lycoris": 9.775161743164062e-06, "prepare environment/run extensions installers/multidiffusion-upscaler-for-automatic1111": 7.62939453125e-06, "prepare environment/run extensions installers/sd-webui-additional-networks": 7.152557373046875e-06, "prepare environment/run extensions installers/a1111-sd-webui-tagcomplete": 6.4373016357421875e-06, "prepare environment/run extensions installers/sd-webui-bilingual-localization": 9.5367431640625e-06, "prepare environment/run extensions installers/stable-diffusion-webui-dataset-tag-editor": 6.4373016357421875e-06, "prepare environment/run extensions installers/booru2prompt": 6.198883056640625e-06, "prepare environment/run extensions installers/a1111-sd-webui-locon": 6.198883056640625e-06, "prepare environment/run extensions installers/stable-diffusion-webui-localization-zh_CN": 6.67572021484375e-06, "prepare environment/run extensions installers/openpose-editor": 6.198883056640625e-06, "prepare environment/run extensions installers/sd-webui-controlnet": 0.14679908752441406, "prepare environment/run extensions installers/sd-webui-segment-anything": 0.06248879432678223, "prepare environment/run extensions installers/sd-webui-stablesr": 2.8848648071289062e-05, "prepare environment/run extensions installers/sd-webui-reactor": 1.0910484790802002, "prepare environment/run extensions installers": 11.937727451324463, "prepare environment": 19.77230739593506, "launcher": 0.0004227161407470703, "import torch": 2.7348530292510986, "import gradio": 0.6126174926757812, "setup paths": 0.29171276092529297, "import ldm": 0.001619577407836914, "import sgm": 2.6226043701171875e-06, "initialize shared": 0.11132383346557617, "other imports": 0.36579251289367676, "opts onchange": 0.0002353191375732422, "setup SD model": 0.0001938343048095703, "setup codeformer": 0.0542142391204834, "setup gfpgan": 0.005404233932495117, "set samplers": 2.7418136596679688e-05, "list extensions": 0.0016064643859863281, "restore config state file": 6.9141387939453125e-06, "list SD models": 0.0004634857177734375, "list localizations": 0.00021457672119140625, "load scripts/custom_code.py": 0.002225637435913086, "load scripts/img2imgalt.py": 0.00018787384033203125, "load scripts/loopback.py": 0.00010228157043457031, "load scripts/outpainting_mk_2.py": 0.00012111663818359375, "load scripts/poor_mans_outpainting.py": 9.417533874511719e-05, "load scripts/postprocessing_caption.py": 7.605552673339844e-05, "load scripts/postprocessing_codeformer.py": 6.937980651855469e-05, "load scripts/postprocessing_create_flipped_copies.py": 6.699562072753906e-05, "load scripts/postprocessing_focal_crop.py": 0.00026154518127441406, "load scripts/postprocessing_gfpgan.py": 7.677078247070312e-05, "load scripts/postprocessing_split_oversized.py": 7.62939453125e-05, "load scripts/postprocessing_upscale.py": 0.0001747608184814453, "load scripts/processing_autosized_crop.py": 9.107589721679688e-05, "load scripts/prompt_matrix.py": 9.5367431640625e-05, "load scripts/prompts_from_file.py": 0.00010180473327636719, "load scripts/sd_upscale.py": 9.179115295410156e-05, "load scripts/xyz_grid.py": 0.0010943412780761719, "load scripts/ldsr_model.py": 0.25278210639953613, "load scripts/lora_script.py": 0.1044464111328125, "load scripts/scunet_model.py": 0.01829218864440918, "load scripts/swinir_model.py": 0.017937898635864258, "load scripts/hotkey_config.py": 0.00011467933654785156, "load scripts/extra_options_section.py": 0.00020122528076171875, "load scripts/hypertile_script.py": 0.03538823127746582, "load scripts/hypertile_xyz.py": 0.00011801719665527344, "load scripts/main.py": 0.10668778419494629, "load scripts/lycoris_script.py": 0.05963850021362305, "load scripts/tag_autocomplete_helper.py": 0.03593587875366211, "load scripts/tilediffusion.py": 0.0022356510162353516, "load scripts/vae_optimize.py": 0.0004379749298095703, "load scripts/additional_networks.py": 0.07949042320251465, "load scripts/addnet_xyz_grid_support.py": 0.0001678466796875, "load scripts/lora_compvis.py": 0.0002949237823486328, "load scripts/metadata_editor.py": 0.0001888275146484375, "load scripts/model_util.py": 0.004560708999633789, "load scripts/safetensors_hack.py": 0.00010466575622558594, "load scripts/util.py": 6.318092346191406e-05, "load scripts/bilingual_localization_helper.py": 0.019229888916015625, "load scripts/adapter.py": 0.0002791881561279297, "load scripts/api.py": 2.6394989490509033, "load scripts/batch_hijack.py": 0.00043582916259765625, "load scripts/cldm.py": 0.0001735687255859375, "load scripts/controlnet.py": 0.11776137351989746, "load scripts/controlnet_version.py": 0.00010085105895996094, "load scripts/external_code.py": 0.0005042552947998047, "load scripts/global_state.py": 0.00021791458129882812, "load scripts/hook.py": 0.0003533363342285156, "load scripts/lvminthin.py": 0.0002410411834716797, "load scripts/movie2movie.py": 0.00012755393981933594, "load scripts/processor.py": 0.00017976760864257812, "load scripts/utils.py": 0.0001575946807861328, "load scripts/xyz_grid_support.py": 0.00016880035400390625, "load scripts/console_log_patch.py": 0.14940690994262695, "load scripts/reactor_api.py": 0.03602027893066406, "load scripts/reactor_faceswap.py": 0.0009171962738037109, "load scripts/reactor_globals.py": 0.0001289844512939453, "load scripts/reactor_helpers.py": 0.0002148151397705078, "load scripts/reactor_logger.py": 0.00018596649169921875, "load scripts/reactor_swapper.py": 0.0008611679077148438, "load scripts/reactor_version.py": 6.67572021484375e-05, "load scripts/auto.py": 0.0002079010009765625, "load scripts/dino.py": 0.00010967254638671875, "load scripts/process_params.py": 0.00010156631469726562, "load scripts/sam.py": 0.016244888305664062, "load scripts/stablesr.py": 0.0010340213775634766, "load scripts/init.py": 5.984306335449219e-05, "load scripts/npw.py": 0.0001628398895263672, "load scripts/dte_instance.py": 0.003529071807861328, "load scripts/singleton.py": 0.000102996826171875, "load scripts/image_browser.py": 0.04208946228027344, "load scripts/promptgen.py": 0.05784440040588379, "load scripts/tagger.py": 0.0028982162475585938, "load scripts/refiner.py": 9.942054748535156e-05, "load scripts/seed.py": 0.000102996826171875, "load scripts": 3.815946340560913, "load upscalers": 0.0007910728454589844, "refresh VAE": 0.00043463706970214844, "refresh textual inversion templates": 2.4318695068359375e-05, "scripts list_optimizers": 0.0001895427703857422, "scripts list_unets": 4.5299530029296875e-06, "reload hypernetworks": 0.00028395652770996094, "initialize extra networks": 0.0008893013000488281, "scripts before_ui_callback": 0.00010633468627929688, "create ui": 1.012152910232544, "gradio launch": 0.14055681228637695, "add APIs": 0.07215356826782227, "app_started_callback/lora_script.py": 0.0002300739288330078, "app_started_callback/reactor_api.py": 0.0027823448181152344, "app_started_callback/api.py": 0.01470041275024414, "app_started_callback": 0.017717361450195312 } }, "Packages": [ "-ransformers==4.30.2", "absl-py==1.4.0", "accelerate==0.18.0", "addict==2.4.0", "aenum==3.1.12", "aiofiles==23.1.0", "aiohttp==3.8.4", "aiosignal==1.3.1", "albumentations==1.4.0", "aliyun-python-sdk-core==2.14.0", "aliyun-python-sdk-kms==2.16.2", "altair==5.0.0", "antlr4-python3-runtime==4.9.3", "anyio==3.6.2", "astunparse==1.6.3", "async-timeout==4.0.2", "attrs==23.1.0", "basicsr==1.4.2", "beautifulsoup4==4.12.2", "bitsandbytes==0.35.4", "blendmodes==2022", "boltons==23.0.0", "cachetools==5.3.0", "certifi==2024.2.2", "cffi==1.15.1", "chardet==4.0.0", "charset-normalizer==3.1.0", "clean-fid==0.1.35", "click==8.1.3", "clip==1.0", "cmake==3.26.3", "coloredlogs==15.0.1", "contourpy==1.0.7", "controlnet-aux==0.0.6", "crcmod==1.7", "cryptography==42.0.5", "cssselect2==0.7.0", "cycler==0.11.0", "cython==3.0.8", "dadaptation==1.5", "datasets==2.18.0", "deprecation==2.1.0", "diffusers==0.14.0", "dill==0.3.8", "discord-webhook==1.1.0", "easydict==1.12", "edge-tts==6.1.10", "einops==0.4.1", "facexlib==0.3.0", "fastapi==0.94.1", "ffmpy==0.3.0", "filelock==3.12.0", "filterpy==1.4.5", "flatbuffers==23.5.9", "font-roboto==0.0.1", "fonts==0.0.3", "fonttools==4.39.4", "frozenlist==1.3.3", "fsspec==2023.9.2", "ftfy==6.1.1", "future==0.18.3", "fvcore==0.1.5.post20221221", "gast==0.4.0", "gdown==4.7.1", "gfpgan==1.3.8", "gitdb==4.0.10", "gitpython==3.1.32", "google-auth-oauthlib==0.4.6", "google-auth==2.18.1", "google-pasta==0.2.0", "gradio-client==0.5.0", "gradio==3.41.2", "grpcio==1.54.2", "h11==0.12.0", "h5py==3.8.0", "httpcore==0.15.0", "httpx==0.24.1", "huggingface-hub==0.21.3", "humanfriendly==10.0", "idna==2.10", "imageio==2.29.0", "importlib-metadata==6.6.0", "importlib-resources==6.1.1", "inflection==0.5.1", "insightface==0.7.3", "iopath==0.1.9", "jax==0.4.10", "jinja2==3.1.2", "jmespath==0.10.0", "joblib==1.3.2", "jsonmerge==1.8.0", "jsonschema==4.17.3", "keras==2.12.0", "kiwisolver==1.4.4", "kornia==0.6.7", "lark==1.1.2", "lazy-loader==0.3", "libclang==16.0.0", "lightning-utilities==0.8.0", "linkify-it-py==2.0.2", "lion-pytorch==0.0.8", "lit==16.0.5", "llvmlite==0.40.0", "lmdb==1.4.1", "lpips==0.1.4", "lxml==4.9.2", "markdown-it-py==2.2.0", "markdown==3.4.3", "markupsafe==2.1.2", "matplotlib==3.7.1", "mdit-py-plugins==0.3.3", "mdurl==0.1.2", "mediapipe==0.10.0", "ml-dtypes==0.1.0", "mmdet==2.26.0", "modelscope==1.12.0", "mpmath==1.3.0", "multidict==6.0.4", "multiprocess==0.70.16", "networkx==3.1", "numba==0.57.0", "numpy==1.23.5", "oauthlib==3.2.2", "omegaconf==2.2.3", "onnx==1.15.0", "onnxruntime-gpu==1.17.1", "onnxruntime==1.17.1", "open-clip-torch==2.20.0", "opencv-contrib-python==4.7.0.72", "opencv-python-headless==4.9.0.80", "opencv-python==4.9.0.80", "opt-einsum==3.3.0", "orjson==3.8.13", "oss2==2.18.4", "packaging==23.1", "pandas==2.0.1", "piexif==1.1.3", "pillow==9.4.0", "pip==23.0.1", "portalocker==2.7.0", "prettytable==3.10.0", "protobuf==3.20.3", "psutil==5.9.5", "pyarrow-hotfix==0.6", "pyarrow==15.0.0", "pyasn1-modules==0.3.0", "pyasn1==0.5.0", "pycocotools==2.0.6", "pycparser==2.21", "pycryptodome==3.20.0", "pydantic==1.10.8", "pydub==0.25.1", "pygments==2.15.1", "pyparsing==3.0.9", "pyrsistent==0.19.3", "pysocks==1.7.1", "python-dateutil==2.8.2", "python-multipart==0.0.6", "python-slugify==8.0.1", "pytorch-lightning==1.9.4", "pytz==2023.3", "pywavelets==1.4.1", "pyyaml==6.0", "qudida==0.0.4", "realesrgan==0.3.0", "regex==2023.5.5", "reportlab==4.0.4", "requests-oauthlib==1.3.1", "requests==2.31.0", "resize-right==0.0.2", "rsa==4.9", "safetensors==0.3.1", "scikit-image==0.21.0", "scikit-learn==1.4.1.post1", "scipy==1.10.1", "segment-anything==1.0", "semantic-version==2.10.0", "send2trash==1.8.2", "sentencepiece==0.1.99", "setuptools==65.5.0", "simplejson==3.19.2", "six==1.16.0", "slugify==0.0.1", "smmap==5.0.0", "sniffio==1.3.0", "sortedcontainers==2.4.0", "sounddevice==0.4.6", "soupsieve==2.4.1", "starlette==0.26.1", "supervision==0.6.0", "svglib==1.5.1", "sympy==1.12", "tabulate==0.9.0", "tb-nightly==2.14.0a20230524", "tensorboard-data-server==0.7.0", "tensorboard-plugin-wit==1.8.1", "tensorboard==2.12.0", "tensorflow-estimator==2.12.0", "tensorflow-io-gcs-filesystem==0.32.0", "tensorflow==2.12.0", "termcolor==2.3.0", "terminaltables==3.1.10", "text-unidecode==1.3", "threadpoolctl==3.3.0", "tifffile==2023.4.12", "timm==0.9.2", "tinycss2==1.2.1", "tokenizers==0.13.3", "tomesd==0.1.3", "tomli==2.0.1", "toolz==0.12.0", "torch==2.0.1+cu118", "torchdiffeq==0.2.3", "torchmetrics==0.11.4", "torchsde==0.2.6", "torchvision==0.15.2+cu118", "tqdm==4.64.1", "trampoline==0.1.2", "transformers==4.26.1", "triton==2.0.0", "typing-extensions==4.6.1", "tzdata==2023.3", "uc-micro-py==1.0.2", "urllib3==1.26.16", "uvicorn==0.22.0", "wcwidth==0.2.6", "webencodings==0.5.1", "websockets==11.0.3", "werkzeug==2.3.4", "wheel==0.40.0", "wrapt==1.14.1", "xxhash==3.4.1", "yacs==0.1.8", "yapf==0.33.0", "yarl==1.9.2", "zipp==3.15.0" ] }

Relevant console log

No

Additional information

No response

eous commented 8 months ago

https://github.com/SthPhoenix/InsightFace-REST might be a useful example how its been done elsewhere