vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.48k stars 400 forks source link

[Issue]: Face HiRes doesn’t properly execute from API #3351

Closed eadnams22 closed 1 week ago

eadnams22 commented 1 month ago

Issue Description

It all executes, then fails on the last step it seems.

It works fine if I use "restore" in the GUI, and generate that.

API content:

curl -X 'POST' \
  'https://sd.ml/sdapi/v1/txt2img' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
"prompt": "photorealistic picture of a woman",
"width": 768,
"height": 1024,
"sampler_name": "Euler a",
"pag_scale": 10,
"cfg_scale": 7,
"restore_faces": "true",
"save_images": "true"
}'

Upon further testing its because its defaulting to UniPC when the FaceHires (inpainting) sampler type comes up as "none". Does the same when inpainting with unipc in the GUI.

Version Platform Description

Fresh install. Tried Dev (and Master) on Linux (WSL2) using python 3.10

Did a fresh git pull, and rebuilt the venv for both as well.

Relevant log output

2024-07-31 06:17:47,830 | sd | INFO | launch | Starting SD.Next
2024-07-31 06:17:47,833 | sd | INFO | installer | Logger: file="/automatic/sdnext.log" level=INFO size=555099 mode=append
2024-07-31 06:17:47,834 | sd | INFO | installer | Python version=3.10.12 platform=Linux bin="/automatic/venv/bin/python3" venv="/automatic/venv"
2024-07-31 06:17:47,846 | sd | INFO | installer | Version: app=sd.next updated=2024-07-30 hash=b50a8601 branch=dev url=https://github.com/vladmandic/automatic.git/tree/dev ui=dev
2024-07-31 06:17:48,239 | sd | INFO | installer | Latest published version: a874b27e50a343ac55148756a0a80eafb3a7f87f 2024-07-24T20:16:33Z
2024-07-31 06:17:48,242 | sd | INFO | launch | Platform: arch=x86_64 cpu=x86_64 system=Linux release=5.15.153.1-microsoft-standard-WSL2 python=3.10.12
2024-07-31 06:17:48,244 | sd | DEBUG | installer | Setting environment tuning
2024-07-31 06:17:48,244 | sd | INFO | installer | HF cache folder: /root/.cache/huggingface/hub
2024-07-31 06:17:48,245 | sd | DEBUG | installer | Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
2024-07-31 06:17:48,245 | sd | DEBUG | installer | Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
2024-07-31 06:17:48,245 | sd | DEBUG | installer | Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True
2024-07-31 06:17:48,246 | sd | INFO | installer | nVidia CUDA toolkit detected: nvidia-smi present
2024-07-31 06:17:48,262 | sd | WARNING | installer | Deleted files: ['models/Reference/DeepFloyd--IF-I-M-v1.0.jpg', 'models/Reference/IDKiro--sdxs-512-dreamshaper.jpg', 'models/Reference/PixArt-alpha--PixArt-XL-2-1024-MS.jpg', 'models/Reference/PixArt-alpha--PixArt-XL-2-512x512.jpg', 'models/Reference/PixArt-alpha--pixart_sigma_sdxlvae_T5_diffusers.jpg', 'models/Reference/SDXL-Flash_Mini.jpg', 'models/Reference/SimianLuo--LCM_Dreamshaper_v7.jpg', 'models/Reference/TempestV0.1-Artistic.jpg', 'models/Reference/Tencent-Hunyuan-HunyuanDiT.jpg', 'models/Reference/XCLiu--instaflow_0_9B_from_sd_1_5.jpg', 'models/Reference/amused--amused-256.jpg', 'models/Reference/amused--amused-512.jpg', 'models/Reference/damo-vilab--text-to-video-ms-1.7b.jpg', 'models/Reference/dreamshaperXL_v21TurboDPMSDE.jpg', 'models/Reference/dreamshaper_8.jpg', 'models/Reference/etri-vilab--koala-700m-llava-cap.jpg', 'models/Reference/juggernautXL_v9Rdphoto2Lightning.jpg', 'models/Reference/juggernautXL_v9Rundiffusionphoto2.jpg', 'models/Reference/juggernaut_reborn.jpg', 'models/Reference/kandinsky-community--kandinsky-2-2-decoder.jpg', 'models/Reference/latent-consistency--lcm-sdxl.jpg', 'models/Reference/playgroundai--playground-v1.jpg', 'models/Reference/playgroundai--playground-v2-1024px-aesthetic.jpg', 'models/Reference/playgroundai--playground-v2.5-1024px-aesthetic.jpg', 'models/Reference/salesforce--blipdiffusion.jpg', 'models/Reference/sd_xl_base_1.0.jpg', 'models/Reference/sdxl_turbo.jpg', 'models/Reference/segmind--SegMoE-2x1-v0.jpg', 'models/Reference/segmind--SegMoE-4x2-v0.jpg', 'models/Reference/segmind--SegMoE-SD-4x2-v0.jpg', 'models/Reference/segmind--Segmind-Vega.jpg', 'models/Reference/segmind--tiny-sd.jpg', 'models/Reference/stabilityai--stable-cascade.jpg', 'models/Reference/stabilityai--stable-diffusion-2-1-base.jpg', 'models/Reference/stabilityai--stable-diffusion-2-1.jpg', 'models/Reference/stabilityai--stable-video-diffusion-img2vid-xt.jpg', 'models/Reference/stabilityai--stable-video-diffusion-img2vid.jpg', 'models/Reference/thu-ml--unidiffuser-v1.jpg', 'models/Reference/v1-5-pruned-fp16-emaonly.jpg', 'models/Reference/warp-ai--wuerstchen.jpg', 'ENV_DIR/', 'images/', 'modules/lora/', 'modules/lycoris/', 'repositories/BLIP/', 'repositories/CodeFormer/', 'repositories/k-diffusion/', 'repositories/stable-diffusion-stability-ai/', 'repositories/taming-transformers/']
2024-07-31 06:17:48,305 | sd | INFO | installer | Verifying requirements
2024-07-31 06:17:48,311 | sd | INFO | installer | Verifying packages
2024-07-31 06:17:48,317 | sd | DEBUG | installer | Repository update time: Tue Jul 30 23:23:21 2024
2024-07-31 06:17:48,317 | sd | DEBUG | installer | Previous setup time: Wed Jul 31 06:16:08 2024
2024-07-31 06:17:48,317 | sd | INFO | installer | Extensions: disabled=[]
2024-07-31 06:17:48,318 | sd | INFO | installer | Extensions: enabled=['a1111-sd-webui-lycoris', 'SwinIR', 'sd-webui-controlnet', 'Lora', 'multidiffusion-upscaler-for-automatic1111', 'sd-extension-system-info', 'sd-dynamic-thresholding', 'ScuNET', 'stable-diffusion-webui-images-browser', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-rembg', 'LDSR', 'sdnext-modernui', 'sd-extension-chainner'] extensions-builtin
2024-07-31 06:17:48,321 | sd | INFO | installer | Extensions: enabled=['adetailer'] extensions
2024-07-31 06:17:48,322 | sd | DEBUG | installer | Latest extensions time: Wed Jul 31 06:16:17 2024
2024-07-31 06:17:48,322 | sd | DEBUG | installer | Timestamps: version:1722353001 setup:1722377768 extension:1722377777
2024-07-31 06:17:48,322 | sd | INFO | launch | Startup: standard
2024-07-31 06:17:48,323 | sd | INFO | installer | Verifying submodules
2024-07-31 06:17:48,537 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-chainner / main
2024-07-31 06:17:48,544 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-system-info / main
2024-07-31 06:17:48,549 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-webui-agent-scheduler / main
2024-07-31 06:17:48,554 | sd | DEBUG | installer | Submodule: extensions-builtin/sdnext-modernui / dev
2024-07-31 06:17:48,559 | sd | DEBUG | installer | Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
2024-07-31 06:17:48,564 | sd | DEBUG | installer | Submodule: modules/k-diffusion / master
2024-07-31 06:17:48,569 | sd | DEBUG | installer | Submodule: wiki / master
2024-07-31 06:17:48,573 | sd | DEBUG | paths | Register paths
2024-07-31 06:17:48,603 | sd | DEBUG | installer | Installed packages: 231
2024-07-31 06:17:48,603 | sd | DEBUG | installer | Extensions all: ['a1111-sd-webui-lycoris', 'SwinIR', 'sd-webui-controlnet', 'Lora', 'multidiffusion-upscaler-for-automatic1111', 'sd-extension-system-info', 'sd-dynamic-thresholding', 'ScuNET', 'stable-diffusion-webui-images-browser', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-rembg', 'LDSR', 'sdnext-modernui', 'sd-extension-chainner']
2024-07-31 06:17:48,659 | sd | DEBUG | installer | Running extension installer: /automatic/extensions-builtin/sd-webui-controlnet/install.py
2024-07-31 06:17:49,038 | sd | DEBUG | installer | Running extension installer: /automatic/extensions-builtin/stable-diffusion-webui-images-browser/install.py
2024-07-31 06:17:49,191 | sd | DEBUG | installer | Running extension installer: /automatic/extensions-builtin/sd-webui-agent-scheduler/install.py
2024-07-31 06:17:49,348 | sd | DEBUG | installer | Running extension installer: /automatic/extensions-builtin/stable-diffusion-webui-rembg/install.py
2024-07-31 06:17:49,591 | sd | DEBUG | installer | Extensions all: ['adetailer']
2024-07-31 06:17:49,592 | sd | DEBUG | installer | Running extension installer: /automatic/extensions/adetailer/install.py
2024-07-31 06:17:49,761 | sd | INFO | installer | Extensions enabled: ['a1111-sd-webui-lycoris', 'SwinIR', 'sd-webui-controlnet', 'Lora', 'multidiffusion-upscaler-for-automatic1111', 'sd-extension-system-info', 'sd-dynamic-thresholding', 'ScuNET', 'stable-diffusion-webui-images-browser', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-rembg', 'LDSR', 'sdnext-modernui', 'sd-extension-chainner', 'adetailer']
2024-07-31 06:17:49,763 | sd | INFO | installer | Verifying requirements
2024-07-31 06:17:49,764 | sd | DEBUG | launch | Setup complete without errors: 1722377870
2024-07-31 06:17:49,767 | sd | DEBUG | installer | Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
2024-07-31 06:17:49,767 | sd | DEBUG | launch | Starting module: <module 'webui' from '/automatic/webui.py'>
2024-07-31 06:17:49,768 | sd | INFO | launch | Command line args: ['-f', '--listen', '--port', '7860', '--insecure', '--docs'] insecure=True listen=True f=True docs=True
2024-07-31 06:17:49,769 | sd | DEBUG | launch | Env flags: []
2024-07-31 06:17:53,333 | sd | INFO | loader | Load packages: {'torch': '2.4.0+cu121', 'diffusers': '0.29.1', 'gradio': '3.43.2'}
2024-07-31 06:17:54,012 | sd | INFO | shared | VRAM: Detected=24.0 GB Optimization=none
2024-07-31 06:17:54,015 | sd | DEBUG | shared | Read: file="config.json" json=94 bytes=4325 time=0.000
2024-07-31 06:17:54,015 | sd | DEBUG | shared | Unknown settings: ['cross_attention_options', 'token_merging_ratio', 'token_merging_ratio_img2img', 'token_merging_ratio_hr', 'memmon_poll_rate', 'cuda_allow_tf32', 'cuda_allow_tf16_reduced', 'disable_gc', 'diffusers_allow_safetensors', 'diffusers_refiner_latents', 'diffusers_attention_slicing', 'grid_only_if_multiple', 'grid_prevent_empty_spots', 'hidden_tabs', 'ui_tab_reorder', 'eta_ddim', 'eta_ancestral', 'always_discard_next_to_last_sigma', 'upscaling_max_images_in_cache', 'realesrgan_enabled_models', 'ESRGAN_tile', 'ESRGAN_tile_overlap', 'SCUNET_tile', 'SCUNET_tile_overlap', 'use_old_hires_fix_width_height', 'dont_fix_second_order_samplers_schedule', 'ui_extra_networks_tab_reorder', 'extra_networks_card_lazy', 'lyco_patch_lora', 'lora_disable', 'extra_networks_add_text_separator', 'image_browser_debug_level', 'image_browser_pages_perload', 'image_browser_height_auto', 'image_browser_use_thumbnail']
2024-07-31 06:17:54,016 | sd | INFO | shared | Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad
2024-07-31 06:17:54,039 | sd | INFO | shared | Device: device=NVIDIA GeForce RTX 3090 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=90100 driver=560.70
2024-07-31 06:17:54,042 | sd | DEBUG | shared | Read: file="html/reference.json" json=46 bytes=26128 time=0.000
2024-07-31 06:17:54,196 | sd | DEBUG | __init__ | ONNX: version=1.18.1 provider=CUDAExecutionProvider, available=['AzureExecutionProvider', 'CPUExecutionProvider']
2024-07-31 06:17:54,311 | sd | DEBUG | sd_hijack | Importing LDM
2024-07-31 06:17:54,317 | sd | DEBUG | webui | Entering start sequence
2024-07-31 06:17:54,320 | sd | DEBUG | webui | Initializing
2024-07-31 06:17:54,359 | sd | INFO | sd_vae | Available VAEs: path="/automatic/models/VAE" items=0
2024-07-31 06:17:54,361 | sd | DEBUG | sd_unet | Available UNets: path="models/UNET" items=0
2024-07-31 06:17:54,361 | sd | INFO | extensions | Disabled extensions: ['a1111-sd-webui-lycoris', 'multidiffusion-upscaler-for-automatic1111', 'sd-webui-controlnet', 'sdnext-modernui']
2024-07-31 06:17:54,409 | sd | DEBUG | shared | Read: file="cache.json" json=2 bytes=215 time=0.000
2024-07-31 06:17:54,411 | sd | DEBUG | shared | Read: file="metadata.json" json=222 bytes=333895 time=0.001
2024-07-31 06:17:54,466 | sd | DEBUG | modelloader | Scanning diffusers cache: folder=/automatic/models/Diffusers items=0 time=0.00
2024-07-31 06:17:54,466 | sd | INFO | sd_models | Available models: path="/automatic/models/Stable-diffusion" items=43 time=0.10
2024-07-31 06:17:54,629 | sd | DEBUG | webui | Load extensions
2024-07-31 06:17:54,718 | sd | INFO | networks | LoRA networks: available=76 folders=4
2024-07-31 06:17:54,813 | sd | INFO | script_loading | Extension: script='extensions-builtin/sd-dynamic-thresholding/scripts/dynamic_thresholding.py' ======
2024-07-31 06:17:54,815 | sd | INFO | script_loading | Extension: script='extensions-builtin/sd-dynamic-thresholding/scripts/dynamic_thresholding.py' Warning! Using legacy KDiff version! Is your WebUI up to date?
2024-07-31 06:17:54,817 | sd | INFO | script_loading | Extension: script='extensions-builtin/sd-dynamic-thresholding/scripts/dynamic_thresholding.py' ======
2024-07-31 06:17:55,291 | sd | INFO | script_loading | Extension: script='extensions-builtin/sd-webui-agent-scheduler/scripts/task_scheduler.py' Using sqlite file: extensions-builtin/sd-webui-agent-scheduler/task_scheduler.sqlite3
2024-07-31 06:17:55,447 | sd | WARNING | image_browser | debug_level: 1
2024-07-31 06:17:55,449 | sd | INFO | script_loading | Extension: script='extensions-builtin/stable-diffusion-webui-images-browser/scripts/image_browser.py' 06:17:55-447180 WARNING  debug_level: 1
2024-07-31 06:17:57,024 | sd | INFO | script_loading | Extension: script='extensions/adetailer/scripts/!adetailer.py' [-] ADetailer initialized. version: 24.6.0, num models: 10
2024-07-31 06:17:57,034 | sd | DEBUG | webui | Extensions init time: 2.40 Lora=0.06 sd-dynamic-thresholding=0.10 sd-webui-agent-scheduler=0.46 stable-diffusion-webui-images-browser=0.16 adetailer=1.57
2024-07-31 06:17:57,040 | sd | DEBUG | shared | Read: file="html/upscalers.json" json=4 bytes=2640 time=0.000
2024-07-31 06:17:57,040 | sd | DEBUG | shared | Read: file="extensions-builtin/sd-extension-chainner/models.json" json=24 bytes=2693 time=0.000
2024-07-31 06:17:57,041 | sd | DEBUG | chainner_model | chaiNNer models: path="models/chaiNNer" defined=24 discovered=0 downloaded=0
2024-07-31 06:17:57,041 | sd | INFO | upscaler | Upscaler create: folder="/automatic/models/ScuNET"
2024-07-31 06:17:57,043 | sd | DEBUG | modelloader | Load upscalers: total=53 downloaded=0 user=0 time=0.01 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'SwinIR', 'LDSR', 'ESRGAN', 'RealESRGAN', 'SD', 'SCUNet', 'AuraSR']
2024-07-31 06:17:57,049 | sd | DEBUG | styles | Load styles: folder="models/styles" items=288 time=0.01
2024-07-31 06:17:57,050 | sd | DEBUG | webui | Creating UI
2024-07-31 06:17:57,051 | sd | DEBUG | theme | UI themes available: type=Standard themes=12
2024-07-31 06:17:57,051 | sd | INFO | theme | UI theme: type=Standard name="black-orange"
2024-07-31 06:17:57,055 | sd | DEBUG | ui_javascript | UI theme: css="/automatic/javascript/black-orange.css" base="sdnext.css" user="None"
2024-07-31 06:17:57,056 | sd | DEBUG | ui_txt2img | UI initialize: txt2img
2024-07-31 06:17:57,687 | sd | DEBUG | ui_extra_networks | Networks: page='model' items=88 subfolders=11 tab=txt2img folders=['/automatic/models/Stable-diffusion', '/automatic/models/Diffusers', 'models/Reference'] list=0.39 thumb=0.19 desc=0.06 info=0.23 workers=4 sort=Default
2024-07-31 06:17:57,742 | sd | DEBUG | ui_extra_networks | Networks: page='lora' items=76 subfolders=4 tab=txt2img folders=['/automatic/models/LyCORIS', '/automatic/models/LyCORIS'] list=0.48 thumb=0.22 desc=0.09 info=0.43 workers=4 sort=Default
2024-07-31 06:17:57,764 | sd | DEBUG | ui_extra_networks | Networks: page='style' items=288 subfolders=1 tab=txt2img folders=['models/styles', 'html'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4 sort=Default
2024-07-31 06:17:57,766 | sd | DEBUG | ui_extra_networks | Networks: page='embedding' items=0 subfolders=0 tab=txt2img folders=['/automatic/models/embeddings'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4 sort=Default
2024-07-31 06:17:57,767 | sd | DEBUG | ui_extra_networks | Networks: page='vae' items=0 subfolders=0 tab=txt2img folders=['/automatic/models/VAE'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4 sort=Default
2024-07-31 06:17:57,940 | sd | DEBUG | ui_img2img | UI initialize: img2img
2024-07-31 06:17:58,144 | sd | DEBUG | ui_control_helpers | UI initialize: control models=models/control
2024-07-31 06:17:58,580 | sd | DEBUG | shared | Read: file="ui-config.json" json=21 bytes=1488 time=0.000
2024-07-31 06:17:58,666 | sd | ERROR | shared_items | Not available: pipeline=Kolors diffusers=0.29.1 path=/automatic/venv/lib/python3.10/site-packages/diffusers/__init__.py
2024-07-31 06:17:58,668 | sd | ERROR | shared_items | Not available: pipeline=AuraFlow diffusers=0.29.1 path=/automatic/venv/lib/python3.10/site-packages/diffusers/__init__.py
2024-07-31 06:17:58,768 | sd | DEBUG | theme | UI themes available: type=Standard themes=12
2024-07-31 06:17:59,940 | sd | DEBUG | ui_extensions | Extension list: processed=391 installed=15 enabled=11 disabled=4 visible=391 hidden=0
2024-07-31 06:18:00,172 | sd | DEBUG | webui | Root paths: ['/automatic']
2024-07-31 06:18:00,606 | sd | INFO | webui | Local URL: http://localhost:7860/
2024-07-31 06:18:00,607 | sd | INFO | webui | API Docs: http://localhost:7860/docs
2024-07-31 06:18:00,608 | sd | INFO | webui | API ReDocs: http://localhost:7860/redocs
2024-07-31 06:18:00,609 | sd | DEBUG | webui | Gradio functions: registered=2712
2024-07-31 06:18:00,610 | sd | DEBUG | middleware | FastAPI middleware: ['Middleware', 'Middleware']
2024-07-31 06:18:00,613 | sd | DEBUG | webui | Creating API
2024-07-31 06:18:00,890 | sd | INFO | task_runner | [AgentScheduler] Task queue is empty
2024-07-31 06:18:00,892 | sd | INFO | api | [AgentScheduler] Registering APIs
2024-07-31 06:18:01,109 | sd | DEBUG | webui | Scripts setup: ['IP Adapters:0.039', 'AnimateDiff:0.018', 'Dynamic Thresholding (CFG Scale Fix):0.017', 'ADetailer:0.125', 'Prompt Matrix:0.006', 'X/Y/Z Grid:0.019', 'Face:0.022', 'Image-to-Video:0.011', 'LEdits++:0.005', 'Stable Video Diffusion:0.008']
2024-07-31 06:18:01,109 | sd | DEBUG | sd_models | Model metadata: file="metadata.json" no changes
2024-07-31 06:18:01,109 | sd | DEBUG | devices | Torch mode: deterministic=False
2024-07-31 06:18:01,131 | sd | DEBUG | devices | Desired Torch parameters: dtype=FP16 no-half=False no-half-vae=False upscast=False
2024-07-31 06:18:01,131 | sd | INFO | devices | Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=no_grad fp16=True bf16=None optimization=Scaled-Dot-Product
2024-07-31 06:18:01,134 | sd | DEBUG | modeldata | Model requested: fn=<lambda>
2024-07-31 06:18:01,134 | sd | INFO | sd_models | Select: model="duchaitenPonyXLNo_ponyNoScoreV50 [b5bda9465c]"
2024-07-31 06:18:01,137 | sd | DEBUG | sd_models | Load model: existing=False target=/automatic/models/Stable-diffusion/duchaitenPonyXLNo_ponyNoScoreV50.safetensors info=None
2024-07-31 06:18:01,137 | sd | DEBUG | sd_models | Diffusers loading: path="/automatic/models/Stable-diffusion/duchaitenPonyXLNo_ponyNoScoreV50.safetensors"
2024-07-31 06:18:01,137 | sd | ERROR | shared_items | Not available: pipeline=Kolors diffusers=0.29.1 path=/automatic/venv/lib/python3.10/site-packages/diffusers/__init__.py
2024-07-31 06:18:01,138 | sd | ERROR | shared_items | Not available: pipeline=AuraFlow diffusers=0.29.1 path=/automatic/venv/lib/python3.10/site-packages/diffusers/__init__.py
2024-07-31 06:18:01,140 | sd | INFO | sd_models | Autodetect: model="Stable Diffusion XL" class=StableDiffusionXLPipeline file="/automatic/models/Stable-diffusion/duchaitenPonyXLNo_ponyNoScoreV50.safetensors" size=6617MB
2024-07-31 06:18:02,515 | sd | DEBUG | sd_models | Setting model: pipeline=StableDiffusionXLPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'extract_ema': False, 'config': 'configs/sdxl', 'use_safetensors': True, 'cache_dir': '/root/.cache/huggingface/hub'}
2024-07-31 06:18:02,516 | sd | INFO | textual_inversion | Load embeddings: loaded=0 skipped=0 time=0.00
2024-07-31 06:18:02,518 | sd | DEBUG | sd_models | Setting model: enable VAE slicing
2024-07-31 06:18:02,546 | sd | DEBUG | shared | Read: file="/automatic/configs/sdxl/vae/config.json" json=15 bytes=642 time=0.000
2024-07-31 06:18:04,839 | sd | DEBUG | devices | GC: utilization={'gpu': 34, 'ram': 5, 'threshold': 80} gc={'collected': 270, 'saved': 0.0} before={'gpu': 8.06, 'ram': 1.47} after={'gpu': 8.06, 'ram': 1.47, 'retries': 0, 'oom': 0} device=cuda fn=load_diffuser time=0.33
2024-07-31 06:18:04,851 | sd | INFO | sd_models | Load model: time=3.37 load=1.38 move=1.96 native=1024 {'ram': {'used': 1.47, 'total': 31.3}, 'gpu': {'used': 8.06, 'total': 24.0}, 'retries': 0, 'oom': 0}
2024-07-31 06:18:04,854 | sd | DEBUG | script_callbacks | Script callback init time: image_browser.py:ui_tabs=0.59 system-info.py:app_started=0.12 task_scheduler.py:app_started=0.25
2024-07-31 06:18:04,854 | sd | INFO | webui | Startup time: 15.08 torch=2.54 gradio=0.77 diffusers=0.24 libraries=0.98 extensions=2.40 models=0.10 face-restore=0.16 ui-en=0.85 ui-txt2img=0.15 ui-img2img=0.16 ui-control=0.21 ui-extras=0.06 ui-models=0.05 ui-settings=0.65 ui-extensions=0.74 ui-defaults=0.12 launch=0.53 api=0.13 app-started=0.37 checkpoint=3.74
2024-07-31 06:18:04,859 | sd | DEBUG | shared | Save: file="config.json" json=94 bytes=4325 time=0.006
2024-07-31 06:18:04,860 | sd | DEBUG | shared | Unused settings: ['cross_attention_options', 'token_merging_ratio', 'token_merging_ratio_img2img', 'token_merging_ratio_hr', 'memmon_poll_rate', 'cuda_allow_tf32', 'cuda_allow_tf16_reduced', 'disable_gc', 'diffusers_allow_safetensors', 'diffusers_refiner_latents', 'diffusers_attention_slicing', 'grid_only_if_multiple', 'grid_prevent_empty_spots', 'hidden_tabs', 'ui_tab_reorder', 'eta_ddim', 'eta_ancestral', 'always_discard_next_to_last_sigma', 'upscaling_max_images_in_cache', 'realesrgan_enabled_models', 'ESRGAN_tile', 'ESRGAN_tile_overlap', 'SCUNET_tile', 'SCUNET_tile_overlap', 'use_old_hires_fix_width_height', 'dont_fix_second_order_samplers_schedule', 'ui_extra_networks_tab_reorder', 'extra_networks_card_lazy', 'lyco_patch_lora', 'lora_disable', 'extra_networks_add_text_separator']
2024-07-31 06:18:49,164 | sd | DEBUG | sd_models | Pipeline switch: from=StableDiffusionXLPipeline to=StableDiffusionXLPAGPipeline components=['vae', 'text_encoder', 'text_encoder_2', 'tokenizer', 'tokenizer_2', 'unet', 'scheduler', 'image_encoder', 'feature_extractor', 'force_zeros_for_empty_prompt'] skipped=[] missing=[]
2024-07-31 06:18:49,164 | sd | DEBUG | __init__ | <class 'diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl.StableDiffusionXLPipeline'>: args={'pag_scale': 10.0, 'pag_adaptive_scaling': 0.5, 'pag_applied_layers_index': ['m0']}
2024-07-31 06:18:49,209 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLPAGPipeline
2024-07-31 06:18:49,211 | sd | DEBUG | sd_samplers | Sampler: sampler="Euler a" config={'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'scaled_linear', 'prediction_type': 'epsilon', 'rescale_betas_zero_snr': False, 'timestep_spacing': 'linspace'}
2024-07-31 06:18:49,675 | sd | DEBUG | processing_helpers | Torch generator: device=cuda seeds=[197176006]
2024-07-31 06:18:49,675 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLPAGPipeline task=DiffusersTaskType.TEXT_2_IMAGE batch=1/1x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 7.0, 'num_inference_steps': 50, 'eta': 0.5, 'guidance_rescale': 0.7, 'denoising_end': None, 'output_type': 'latent', 'width': 768, 'height': 1024, 'pag_scale': 10.0, 'pag_adaptive_scaling': 0.5, 'pag_applied_layers_index': ['m0'], 'parser': 'Full parser'}
2024-07-31 06:19:04,356 | sd | DEBUG | sd_vae_taesd | VAE load: type=taesd model=models/TAESD/taesdxl_decoder.pth
2024-07-31 06:19:07,494 | sd | INFO | face_details | Loading: type=FaceHires model=/automatic/models/yolo/yolov8n-face.pt
2024-07-31 06:19:08,603 | sd | DEBUG | face_details | Face HiRes: faces=[{'score': 0.76, 'size': '530x565'}] args={'conf': 0.4, 'iou': 0.5, 'max_det': 5} denoise=0.45 blur=10 resolution=1024x1024 padding=20
2024-07-31 06:19:08,604 | sd | DEBUG | sd_models | Pipeline switch: from=StableDiffusionXLPAGPipeline to=StableDiffusionXLPipeline components=['vae', 'text_encoder', 'text_encoder_2', 'tokenizer', 'tokenizer_2', 'unet', 'scheduler', 'image_encoder', 'feature_extractor', 'force_zeros_for_empty_prompt'] skipped=[] missing=[]
2024-07-31 06:19:08,606 | sd | DEBUG | sd_models | Pipeline class change: original=StableDiffusionXLPipeline target=StableDiffusionXLInpaintPipeline device=cuda:0 fn=init
2024-07-31 06:19:08,623 | sd | DEBUG | masking | Mask: size=768x1024 masked=380156px area=0.48 auto=None blur=0.052 erode=0.010 dilate=0.104 type=Grayscale time=0.02
2024-07-31 06:19:08,719 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLInpaintPipeline
2024-07-31 06:19:08,720 | sd | WARNING | processing_helpers | Sampler: sampler="None" not found
2024-07-31 06:19:08,722 | sd | DEBUG | sd_samplers | Sampler: sampler="UniPC" config={'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'scaled_linear', 'prediction_type': 'epsilon', 'solver_order': 2, 'thresholding': False, 'sample_max_value': 1.0, 'predict_x0': 'bh1', 'lower_order_final': False, 'timestep_spacing': 'linspace'}
2024-07-31 06:19:09,131 | sd | DEBUG | processing_helpers | Torch generator: device=cuda seeds=[3805859889]
2024-07-31 06:19:09,139 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLInpaintPipeline task=DiffusersTaskType.INPAINTING batch=1/1x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 7.0, 'num_inference_steps': 112, 'eta': 0.5, 'guidance_rescale': 0.7, 'denoising_start': None, 'denoising_end': None, 'output_type': 'latent', 'image': [<PIL.Image.Image image mode=RGB size=1024x1024 at 0x7F343A1747C0>], 'mask_image': <PIL.Image.Image image mode=L size=1024x1024 at 0x7F343A1ACF10>, 'strength': 0.45, 'height': 1024, 'width': 1024, 'parser': 'Full parser'}
2024-07-31 06:19:27,467 | sd | ERROR | processing_helpers | Failed to validate samples: sample=(1024, 1024, 3) min=0.00 max=0.00 mean=0.00 invalid=3145728
2024-07-31 06:19:27,503 | sd | DEBUG | sd_models | Pipeline class change: original=StableDiffusionXLInpaintPipeline target=StableDiffusionXLPipeline device=cuda:0 fn=process_images_inner
2024-07-31 06:19:27,504 | sd | INFO | processing | Processed: images=1 time=18.90 its=2.65 memory={'ram': {'used': 2.65, 'total': 31.3}, 'gpu': {'used': 8.85, 'total': 24.0}, 'retries': 0, 'oom': 0}
2024-07-31 06:19:28,123 | sd | INFO | images | Save: image="images/outputs/txt2img-images/02173-photorealistic picture of a woman.webp" type=WEBP resolution=768x1024 size=459146
2024-07-31 06:19:28,127 | sd | INFO | processing | Processed: images=1 time=38.96 its=1.28 memory={'ram': {'used': 2.68, 'total': 31.3}, 'gpu': {'used': 8.85, 'total': 24.0}, 'retries': 0, 'oom': 0}

Backend

Diffusers

UI

API

Branch

Dev

Model

Other

Acknowledgements

eadnams22 commented 1 month ago

I would think a solution would be to allow us to select a (default) sampler, either as default, or via the txt2img api.

or just “same as primary” being the default.

it doesn’t fix the UniPC problem specifically for me, but it does allow me to bypass this odd bug.

vladmandic commented 1 week ago

issue is that for txt2img api requests, denoising_strength is not set so its interpreted as 0 and that causes face-hires to fail. add denoising_strength value to your api request or set it globally in settings -> postprocessing -> face restore strength. regarding sampler, set hr_sampler_name in api request as well.

core issue is that api needs exact params. you're sending txt2img api request, but face-hires is internally img2img operation, so it gets triggered with default values not set by api server since it only initialized defaults for txt2img from original api request.

i'll add better handling of defaults for api in the future, but that will be handled as a feature item.