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.68k stars 421 forks source link

[Issue]: Control only preprocesses, but does not do the actual image generation #2838

Open lanice opened 8 months ago

lanice commented 8 months ago

Issue Description

When using the Control tab, the preprocessor runs successfully, but it never continues to actually generate an image. Using Control XS Canny here, but also tested with Lite and the normal ControlNet.

In some cases, I had it that the very first image was generated, but whenever I hit "Generate" after the first image, it would not do anything anymore. But in recent tries it did not even generate the first image.

Using a fresh install of the dev branch btw. Also tried master, same issue. Will include a complete log with --debug and SD_CONTROL_DEBUG=true SD_PROCESS_DEBUG=true below.

Version Platform Description

Starting SD.Next Logger: file="/home/lanice/automatic/sdnext.log" level=DEBUG size=64 mode=create Python 3.10.13 on Linux Version: app=sd.next updated=2024-02-11 hash=3f8da51e url=https://github.com/vladmandic/automatic.git/tree/dev Updating main repository Upgraded to version: 3f8da51e Sun Feb 11 13:44:39 2024 +0300 Platform: arch=x86_64 cpu= system=Linux release=6.7.2-zen1 python=3.10.13 nVidia CUDA toolkit detected: nvidia-smi present Startup: standard Extensions enabled: ['stable-diffusion-webui-images-browser', 'sd-extension-system-info', Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0} Command line args: ['--listen', '--port', '9000', '--insecure', '--debug', '--upgrade'] insecure=True Load packages: {'torch': '2.2.0+cu121', 'diffusers': '0.26.2', 'gradio': '3.43.2'} Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad Device: device=NVIDIA GeForce RTX 3060 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8902 driver=545.29.06

Relevant log output

Create and activate python venv
Launching launch.py...
12:26:51-768870 INFO     Starting SD.Next
12:26:51-771095 INFO     Logger: file="/home/lanice/automatic/sdnext.log" level=DEBUG size=64 mode=create
12:26:51-771800 INFO     Python 3.10.13 on Linux
12:26:51-781520 INFO     Version: app=sd.next updated=2024-02-11 hash=3f8da51e url=https://github.com/vladmandic/automatic.git/tree/dev
12:26:52-137048 INFO     Updating main repository
12:26:52-675356 INFO     Upgraded to version: 3f8da51e Sun Feb 11 13:44:39 2024 +0300
12:26:52-681160 INFO     Platform: arch=x86_64 cpu= system=Linux release=6.7.2-zen1 python=3.10.13
12:26:52-685134 DEBUG    Setting environment tuning
12:26:52-688041 DEBUG    HF cache folder: /home/lanice/.cache/huggingface/hub
12:26:52-690223 DEBUG    Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
12:26:52-692245 DEBUG    Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True
12:26:52-694146 INFO     nVidia CUDA toolkit detected: nvidia-smi present
12:26:52-707369 INFO     Startup: standard
12:26:52-708954 INFO     Verifying requirements
12:26:52-723830 INFO     Verifying packages
12:26:52-724867 INFO     Verifying submodules
12:26:53-118579 DEBUG    Submodule: extensions-builtin/sd-extension-chainner / main
12:26:53-580809 DEBUG    Submodule: extensions-builtin/sd-extension-system-info / main
12:26:53-985837 DEBUG    Submodule: extensions-builtin/sd-webui-agent-scheduler / main
12:26:54-431329 DEBUG    Submodule: extensions-builtin/sd-webui-controlnet / main
12:26:54-923312 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main
12:26:55-343970 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
12:26:55-799936 DEBUG    Submodule: modules/k-diffusion / master
12:26:56-231120 DEBUG    Submodule: wiki / master
12:26:56-654449 DEBUG    Register paths
12:26:56-693863 DEBUG    Installed packages: 262
12:26:56-694642 DEBUG    Extensions all: ['stable-diffusion-webui-images-browser', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-rembg', 'Lora', 'sd-extension-chainner']
12:26:56-700570 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main
12:26:57-056422 DEBUG    Running extension installer: /home/lanice/automatic/extensions-builtin/stable-diffusion-webui-images-browser/install.py
12:26:57-214711 DEBUG    Submodule: extensions-builtin/sd-extension-system-info / main
12:26:57-614262 DEBUG    Running extension installer: /home/lanice/automatic/extensions-builtin/sd-extension-system-info/install.py
12:26:57-785553 DEBUG    Submodule: extensions-builtin/sd-webui-agent-scheduler / main
12:26:58-175169 DEBUG    Running extension installer: /home/lanice/automatic/extensions-builtin/sd-webui-agent-scheduler/install.py
12:26:58-338616 DEBUG    Submodule: extensions-builtin/sd-webui-controlnet / main
12:26:58-756932 DEBUG    Running extension installer: /home/lanice/automatic/extensions-builtin/sd-webui-controlnet/install.py
12:26:58-933145 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
12:26:59-314874 DEBUG    Running extension installer: /home/lanice/automatic/extensions-builtin/stable-diffusion-webui-rembg/install.py
12:26:59-881201 DEBUG    Submodule: extensions-builtin/sd-extension-chainner / main
12:27:00-329013 DEBUG    Extensions all: []
12:27:00-329674 INFO     Extensions enabled: ['stable-diffusion-webui-images-browser', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-rembg', 'Lora', 'sd-extension-chainner']
12:27:00-330338 INFO     Verifying requirements
12:27:00-340721 INFO     Updating Wiki
12:27:00-346427 DEBUG    Submodule: /home/lanice/automatic/wiki / master
12:27:00-772052 DEBUG    Setup complete without errors: 1707672421
12:27:00-774498 INFO     Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
12:27:00-775659 DEBUG    Starting module: <module 'webui' from '/home/lanice/automatic/webui.py'>
12:27:00-776743 INFO     Command line args: ['--listen', '--port', '9000', '--insecure', '--debug', '--upgrade'] insecure=True listen=True port=9000 debug=True upgrade=True
12:27:00-778205 DEBUG    Env flags: ['SD_PROCESS_DEBUG=true', 'SD_CONTROL_DEBUG=true']
12:27:02-556611 DEBUG    Package not found: olive-ai
12:27:03-087434 INFO     Load packages: {'torch': '2.2.0+cu121', 'diffusers': '0.26.2', 'gradio': '3.43.2'}
12:27:03-410852 DEBUG    Read: file="config.json" json=38 bytes=1694 time=0.000
12:27:03-411801 DEBUG    Unknown settings: ['image_browser_use_thumbnail']
12:27:03-412700 INFO     Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad
12:27:03-427293 INFO     Device: device=NVIDIA GeForce RTX 3060 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8902 driver=545.29.06
12:27:03-851739 TRACE    Trace: PROCESS
12:27:03-972160 DEBUG    ONNX: version=1.17.0 provider=CUDAExecutionProvider, available=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']
12:27:04-007267 TRACE    Trace: PROCESS
12:27:04-008092 TRACE    Trace: PROCESS
12:27:04-011319 DEBUG    Importing LDM
12:27:04-017948 DEBUG    Entering start sequence
12:27:04-018923 DEBUG    Initializing
12:27:04-024986 INFO     Available VAEs: path="models/VAE" items=1
12:27:04-025801 INFO     Disabled extensions: ['sd-webui-controlnet']
12:27:04-026635 DEBUG    Scanning diffusers cache: ['models/Diffusers'] items=0 time=0.00
12:27:04-027380 DEBUG    Read: file="cache.json" json=1 bytes=352 time=0.000
12:27:04-028238 DEBUG    Read: file="metadata.json" json=38 bytes=39468 time=0.000
12:27:04-029369 INFO     Available models: path="models/Stable-diffusion" items=29 time=0.00
12:27:04-046136 DEBUG    Load extensions
12:27:04-129417 INFO     LoRA networks: available=9 folders=2
12:27:04-405076 INFO     Extension: script='extensions-builtin/sd-webui-agent-scheduler/scripts/task_scheduler.py' Using sqlite file: extensions-builtin/sd-webui-agent-scheduler/task_scheduler.sqlite3
12:27:04-527674 INFO     Extensions init time: 0.48 img2imgalt.py=0.07 sd-webui-agent-scheduler=0.26 stable-diffusion-webui-images-browser=0.12
12:27:04-532215 DEBUG    Read: file="html/upscalers.json" json=4 bytes=2640 time=0.000
12:27:04-533134 DEBUG    Read: file="extensions-builtin/sd-extension-chainner/models.json" json=24 bytes=2693 time=0.000
12:27:04-534039 DEBUG    chaiNNer models: path="models/chaiNNer" defined=24 discovered=0 downloaded=0
12:27:04-535078 DEBUG    Load upscalers: total=52 downloaded=0 user=0 time=0.01 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'SwinIR', 'SD', 'RealESRGAN', 'SCUNet', 'ESRGAN', 'LDSR']
12:27:04-539927 DEBUG    Load styles: folder="models/styles" items=276 time=0.00
12:27:04-541326 DEBUG    Creating UI
12:27:04-542029 INFO     UI theme: name="black-teal" style=Auto base=sdnext.css
12:27:04-544469 DEBUG    UI initialize: txt2img
12:27:04-550266 DEBUG    List items: function=create_items
12:27:04-605712 DEBUG    Read: file="html/reference.json" json=36 bytes=18838 time=0.000
12:27:04-616491 DEBUG    Extra networks: page='model' items=65 subfolders=7 tab=txt2img folders=['models/Stable-diffusion', 'models/Diffusers', 'models/Reference'] list=0.06 thumb=0.00 desc=0.02 info=0.09 workers=4
12:27:04-629431 DEBUG    Extra networks: page='style' items=276 subfolders=0 tab=txt2img folders=['models/styles', 'html'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4
12:27:04-631279 DEBUG    Extra networks: page='embedding' items=17 subfolders=0 tab=txt2img folders=['models/embeddings'] list=0.05 thumb=0.04 desc=0.00 info=0.00 workers=4
12:27:04-632687 DEBUG    Extra networks: page='hypernetwork' items=0 subfolders=0 tab=txt2img folders=['models/hypernetworks'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
12:27:04-634033 DEBUG    Extra networks: page='vae' items=1 subfolders=0 tab=txt2img folders=['models/VAE'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
12:27:04-635395 DEBUG    Extra networks: page='lora' items=9 subfolders=0 tab=txt2img folders=['models/Lora', 'models/LyCORIS'] list=0.05 thumb=0.01 desc=0.00 info=0.07 workers=4
12:27:04-681643 DEBUG    UI initialize: img2img
12:27:04-752430 TRACE    Trace: CONTROL
12:27:04-753709 TRACE    Trace: CONTROL
12:27:04-756579 TRACE    Trace: CONTROL
12:27:04-757455 TRACE    Trace: CONTROL
12:27:04-759942 TRACE    Trace: CONTROL
12:27:04-760849 TRACE    Trace: CONTROL
12:27:04-761373 TRACE    Trace: CONTROL
12:27:04-762638 DEBUG    UI initialize: control models=models/control
12:27:04-782975 TRACE    Control list processors: path=models/control/processor models=['None', 'OpenPose', 'DWPose', 'MediaPipe Face', 'Canny', 'Edge', 'LineArt Realistic', 'LineArt Anime', 'HED', 'PidiNet', 'Midas Depth Hybrid', 'Leres Depth', 'Zoe Depth', 'Marigold Depth', 'Normal Bae', 'SegmentAnything', 'MLSD', 'Shuffle', 'DPT Depth Hybrid', 'GLPN Depth', 'Depth Anything']
12:27:04-784271 TRACE    Control list ControlNet: path=models/control/controlnet models=['None']
12:27:04-790345 TRACE    Control list T2I-Adapter: path=models/control/adapter models=['None']
12:27:04-795700 TRACE    Control list ControlNet-XS: path=models/control/xs models=['None']
12:27:04-801691 TRACE    Control list ControlLLLite: path=models/control/lite models=['None']
12:27:04-912044 DEBUG    Read: file="ui-config.json" json=0 bytes=2 time=0.000
12:27:04-955555 DEBUG    Themes: builtin=11 gradio=5 huggingface=55
12:27:05-372253 INFO     Extension list is empty: refresh required
12:27:05-398954 DEBUG    Extension list: processed=7 installed=7 enabled=6 disabled=1 visible=7 hidden=0
12:27:05-508790 DEBUG    Root paths: ['/home/lanice/automatic']
12:27:05-565367 INFO     Local URL: http://localhost:9000/
12:27:05-566093 DEBUG    Gradio functions: registered=2063
12:27:05-566717 INFO     Initializing middleware
12:27:05-569112 DEBUG    Creating API
12:27:05-688045 INFO     [AgentScheduler] Task queue is empty
12:27:05-688839 INFO     [AgentScheduler] Registering APIs
12:27:05-943324 DEBUG    Scripts setup: ['IP Adapters:0.006', 'X/Y/Z Grid:0.007', 'Face:0.007']
12:27:05-944169 DEBUG    Model metadata: file="metadata.json" no changes
12:27:05-945362 DEBUG    Model requested: fn=<lambda>
12:27:05-946400 INFO     Select: model="xl/sd_xl_base_1.0 [31e35c80fc]"
12:27:05-947283 DEBUG    Load model: existing=False target=/home/lanice/automatic/models/Stable-diffusion/xl/sd_xl_base_1.0.safetensors info=None
12:27:05-954359 DEBUG    Desired Torch parameters: dtype=FP16 no-half=False no-half-vae=False upscast=False
12:27:05-955127 INFO     Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=no_grad fp16=True bf16=None
12:27:05-955943 INFO     Loading VAE: model=models/VAE/sdxl_vae.safetensors source=settings
12:27:05-956514 DEBUG    Diffusers VAE load config: {'low_cpu_mem_usage': False, 'torch_dtype': torch.float16, 'use_safetensors': True, 'variant': 'fp16', 'force_upcast': False}
12:27:05-957280 INFO     Autodetect: vae="Stable Diffusion XL" class=StableDiffusionXLPipeline file="/home/lanice/automatic/models/Stable-diffusion/xl/sd_xl_base_1.0.safetensors" size=6617MB
12:27:06-101307 DEBUG    Diffusers loading: path="/home/lanice/automatic/models/Stable-diffusion/xl/sd_xl_base_1.0.safetensors"
12:27:06-102261 INFO     Autodetect: model="Stable Diffusion XL" class=StableDiffusionXLPipeline file="/home/lanice/automatic/models/Stable-diffusion/xl/sd_xl_base_1.0.safetensors" size=6617MB
12:27:09-348188 DEBUG    Setting model: pipeline=StableDiffusionXLPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'extract_ema': True, 'use_safetensors': True}
12:27:09-349457 DEBUG    Setting model VAE: name=sdxl_vae.safetensors
12:27:09-350118 DEBUG    Setting model VAE: upcast=True
12:27:09-350664 DEBUG    Setting model: enable VAE slicing
12:27:10-075885 INFO     Load embeddings: loaded=1 skipped=16 time=0.04
12:27:10-250060 DEBUG    GC: collected=5052 device=cuda {'ram': {'used': 9.56, 'total': 62.63}, 'gpu': {'used': 7.25, 'total': 11.74}, 'retries': 0, 'oom': 0} time=0.17
12:27:10-256732 INFO     Load model: time=4.13 load=4.13 native=512 {'ram': {'used': 9.56, 'total': 62.63}, 'gpu': {'used': 7.25, 'total': 11.74}, 'retries': 0, 'oom': 0}
12:27:10-258205 DEBUG    Save: file="config.json" json=38 bytes=1694 time=0.000
12:27:10-259044 DEBUG    Script callback init time: image_browser.py:ui_tabs=0.34 task_scheduler.py:app_started=0.27
12:27:10-259777 INFO     Startup time: 9.47 torch=1.75 gradio=0.53 libraries=0.92 extensions=0.48 ui-en=0.17 ui-control=0.06 ui-settings=0.12 ui-extensions=0.39 ui-defaults=0.06 launch=0.10 api=0.06 app-started=0.31 checkpoint=4.31
12:27:18-136208 INFO     MOTD: N/A
12:27:26-574739 DEBUG    Themes: builtin=11 gradio=5 huggingface=55
12:27:28-228809 INFO     Browser session: user=None client=100.86.64.65 agent=Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
12:27:32-601501 TRACE    Control list ControlNet: path=models/control/controlnet models=['None', 'Canny Small XL', 'Canny Mid XL', 'Canny XL', 'Depth Zoe XL', 'Depth Mid XL', 'OpenPose XL']
12:27:32-935835 TRACE    Control list ControlNet: path=models/control/controlnet models=['None', 'Canny Small XL', 'Canny Mid XL', 'Canny XL', 'Depth Zoe XL', 'Depth Mid XL', 'OpenPose XL']
12:27:33-278757 TRACE    Control list ControlNet: path=models/control/controlnet models=['None', 'Canny Small XL', 'Canny Mid XL', 'Canny XL', 'Depth Zoe XL', 'Depth Mid XL', 'OpenPose XL']
12:27:36-450410 TRACE    Control select input: source=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48433880> init=None type=0 mode=Select
12:27:36-451496 DEBUG    Control input: type=PIL.Image input=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48433880>]
12:27:36-452271 TRACE    Control select input: source=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48433880>] init=None mode=Select
12:27:46-601600 TRACE    Control list ControlNet-XS: path=models/control/xs models=['None', 'Canny', 'Depth']
12:27:48-989033 DEBUG    Control Processor loading: id="Canny" class=CannyDetector
12:27:48-990995 TRACE    Control Processor config={'cache_dir': 'models/control/processor'}
12:27:48-991717 DEBUG    Control Processor loaded: id="Canny" class=CannyDetector time=0.00
12:27:50-663977 DEBUG    Control ControlNet-XS model loading: id="Canny" path="UmerHA/ConrolNetXS-SDXL-canny" {'cache_dir': 'models/control/xs', 'learn_embedding': True, 'time_embedding_mix': 0}
12:27:51-072832 DEBUG    Control ControlNet-XS model loaded: id="Canny" path="UmerHA/ConrolNetXS-SDXL-canny" time=0.41
12:27:54-595829 TRACE    Control select input: source=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890> init=None type=0 mode=Select
12:27:54-597683 DEBUG    Control input: type=PIL.Image input=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890>]
12:27:54-598940 TRACE    Control select input: source=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890>] init=None mode=Select
12:27:54-600740 TRACE    Trace: CONTROL
12:27:54-601399 TRACE    Control: tab="xs" job=task(abwj5ahl9r6m5hh) args=(0, '', '', [], 20, 0, -1.0, -1.0, 0, 0, 0, 6, 1, 6, 0.7, 0, 1, True, False, False, 0, 0, 0, 0, False, 4, 0.95, False, 0.6, 1, '#000000', 0, 1, 'None', 1024, 1024, 1, 0, 1, 'None', 512, 512, 1, 0, 0.5, 1, 1, 0, 'None', 2, True, 1, 0, 0, 1, 'None', 'None', 'None', 'None', 0.5, 0.5, 0.5, 0.5, None, None, None, None, 'None', 16, 'None', 1, True, 'None', 2, True, 1, 0, True, 'none', 3, 4, 0.25, 0.25, '', '', 0.5, '* `CFG Scale` should be 2 or lower.', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 14, True, 1, 3, 6, 0.5, 0.1, 'None', 2, True, 1, 0, 0, '', [], 0, '', [], 0, '', [], False, True, False, False, False, False, 0, 'None', [], 'FaceID Base', True, True, 1, 1, 1, 0.5, True, 'person', 1, 0.5, True)
12:27:54-606118 TRACE    Control: type=xs input=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890>] init=None type=0
12:27:54-607161 TRACE    Control unit: i=1 type=xs enabled=True
12:27:54-607963 DEBUG    Control ControlNet-XS unit: i=1 process=Canny model=Canny strength=1.0 guess=False start=0 end=1
12:27:54-608965 TRACE    Control unit: i=2 type=xs enabled=False
12:27:54-609887 TRACE    Control unit: i=3 type=xs enabled=False
12:27:54-610863 TRACE    Control active: process=1 model=1
12:27:54-611775 TRACE    Control: run type=xs models=True
12:27:54-632838 DEBUG    Control ControlNet-XS pipeline: class=StableDiffusionXLControlNetXSPipeline time=0.02
12:27:54-633665 TRACE    Control pipeline: class=StableDiffusionXLControlNetXSPipeline args={'outpath_samples': 'outputs/sync/control', 'outpath_grids': 'outputs/sync/grids', 'prompt': '', 'prompt_for_display': None, 'negative_prompt': '', 'styles': [], 'seed': -1.0, 'subseed': -1.0, 'subseed_strength': 0, 'seed_resize_from_h': 0, 'seed_resize_from_w': 0, 'sampler_name': 'Default', 'hr_sampler_name': 'Default', 'batch_size': 1, 'n_iter': 1, 'steps': 20, 'hr_second_pass_steps': 0, 'cfg_scale': 6, 'scale_by': 1, 'image_cfg_scale': 6, 'diffusers_guidance_rescale': 0.7, 'sag_scale': 0, 'cfg_end': 1, 'width': 1024, 'height': 1024, 'full_quality': True, 'restore_faces': False, 'tiling': False, 'do_not_save_samples': False, 'do_not_save_grid': False, 'extra_generation_params': {'Control model': 'Canny', 'Control conditioning': 1.0, 'Control mode': 'ControlNet-XS'}, 'overlay_images': None, 'eta': None, 'do_not_reload_embeddings': False, 'paste_to': None, 'color_corrections': None, 'denoising_strength': 0.5, 'override_settings': {}, 'override_settings_restore_afterwards': True, 'is_using_inpainting_conditioning': False, 'disable_extra_networks': False, 'token_merging_ratio': 0, 'token_merging_ratio_hr': 0, 'per_script_args': {}, 'all_prompts': [''], 'all_negative_prompts': [''], 'all_seeds': [1419629982], 'all_subseeds': [1835601449], 'clip_skip': 1, 'iteration': 0, 'is_control': False, 'is_hr_pass': False, 'is_refiner_pass': False, 'hr_force': False, 'enable_hr': None, 'hr_scale': None, 'hr_upscaler': None, 'hr_resize_x': 0, 'hr_resize_y': 0, 'hr_upscale_to_x': 0, 'hr_upscale_to_y': 0, 'truncate_x': 0, 'truncate_y': 0, 'applied_old_hires_behavior_to': None, 'refiner_steps': 5, 'refiner_start': 0, 'refiner_prompt': '', 'refiner_negative': '', 'ops': ['control'], 'resize_mode': 0, 'resize_name': 'None', 'ddim_discretize': 'uniform', 's_min_uncond': 0.0, 's_churn': 0.0, 's_noise': 1.0, 's_min': 0.0, 's_max': 0.0, 's_tmin': 0.0, 's_tmax': inf, 'task_args': {}, 'refiner_switch_at': 0, 'hr_prompt': '', 'all_hr_prompts': [], 'hr_negative_prompt': '', 'all_hr_negative_prompts': [], 'comments': {}, 'is_api': False, 'scripts_value': None, 'script_args_value': [], 'scripts_setup_complete': Field(name=None,type=None,default=False,default_factory=<dataclasses._MISSING_TYPE object at 0x72fea236d600>,init=False,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object at 0x72fea236d600>,_field_type=None), 'ip_adapter_names': None, 'ip_adapter_scales': 0.0, 'ip_adapter_images': None, 'hdr_mode': 0, 'hdr_brightness': 0, 'hdr_color': 0, 'hdr_sharpen': 0, 'hdr_clamp': False, 'hdr_boundary': 4, 'hdr_threshold': 0.95, 'hdr_maximize': False, 'hdr_max_center': 0.6, 'hdr_max_boundry': 1, 'hdr_color_picker': '#000000', 'hdr_tint_ratio': 0, 'scheduled_prompt': False, 'prompt_embeds': [], 'positive_pooleds': [], 'negative_embeds': [], 'negative_pooleds': [], 'init_images': None, 'init_latent': None, 'image_mask': None, 'latent_mask': None, 'mask_for_overlay': None, 'mask_blur_x': 4, 'mask_blur_y': 4, 'mask_blur': 4, 'inpainting_fill': 1, 'inpaint_full_res': False, 'inpaint_full_res_padding': 0, 'inpainting_mask_invert': 0, 'initial_noise_multiplier': 1.0, 'mask': None, 'nmask': None, 'image_conditioning': None, 'is_batch': False, 'sampler': None, 'strength': None, 'adapter_conditioning_scale': None, 'adapter_conditioning_factor': 1.0, 'guess_mode': None, 'controlnet_conditioning_scale': 1.0, 'control_guidance_start': 0.0, 'control_guidance_end': 1.0, 'reference_attn': None, 'reference_adain': None, 'attention_auto_machine_weight': None, 'gn_auto_machine_weight': None, 'style_fidelity': None, 'ref_image': None, 'image': None, 'query_weight': None, 'adain_weight': None, 'attention': 'Attention', 'fidelity': 0.5, 'mask_image': None, 'override': None}
12:27:54-677655 TRACE    Control device=cuda dtype=torch.float16
12:27:54-678433 DEBUG    Setting model VAE: upcast=True
12:27:54-679031 DEBUG    Setting model: enable VAE slicing
12:27:54-686758 TRACE    Control Control image: 1 of 1
12:27:54-687349 TRACE    Control Init image: none
12:27:54-687888 TRACE    Control: input image=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890>
12:27:54-688535 TRACE    Control: i=1 process="Canny" input=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48B0E890> override=None
12:27:54-711943 DEBUG    Control Processor: id="Canny" mode=RGB args={'low_threshold': 100, 'high_threshold': 200} time=0.02
12:27:54-712912 TRACE    Control processed: 1
12:27:54-713543 TRACE    Control yield: process | 1 of 1 | Image 1024x1024
12:27:54-714190 TRACE    Control received: type=<class 'tuple'> (None, <PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD48433EE0>, 'Control process | 1 of 1 | Image 1024x1024')
12:28:00-325652 DEBUG    Server: alive=True jobs=1 requests=28 uptime=57 memory=9.64/62.63 backend=Backend.DIFFUSERS state=idle
12:28:14-911756 TRACE    Control select input: source=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD43F73400> init=None type=0 mode=Select
12:28:14-912808 DEBUG    Control input: type=PIL.Image input=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD43F73400>]
12:28:14-913565 TRACE    Control select input: source=[<PIL.Image.Image image mode=RGB size=1024x1024 at 0x72FD43F73400>] init=None mode=Select

Backend

Diffusers

Branch

Dev

Model

SD-XL

Acknowledgements

vladmandic commented 8 months ago

i can see from your log exactly what you describe - control unit contains both valid processor and model, but after preprocess finishes, generate never executes

but i've tried to reproduce and both xs and lite work fine for me. need more info on how to reproduce.

lanice commented 8 months ago

Is there anything I can do to provide more info? I.e., more/different logs, or testing a different workflow?

Btw I have the same issue for ControlNet, T2I Adapter, and Reference, so basically all Control types.

vladmandic commented 8 months ago

Logs only confirm what you're saying - it doesn't get triggered.

Try documenting workflow step-by-step until reproduction.

lanice commented 8 months ago

Workflow that leads to this issue for me:

  1. Load SD.Next
  2. Open Control Tab
  3. Upload an image (1024x1024 in my case)
  4. In the tabs below, select XS, then refresh the ControlNet-XS dropdown
  5. Select "Canny" for both the Processor and the ControlNet-XS.
  6. Hit "Generate"

Nothing out of the ordinary unfortunately in terms of workflow.

vladmandic commented 8 months ago

Yeah, thats as simple as it gets. And I can't reproduce.

vladmandic commented 8 months ago

no matter what i do, i still cant reproduce image

lanice commented 8 months ago

I've come a bit closer to an idea of why this is happening, I think it has something to do with the workload and resources. As I mentioned in the first post, sometimes it would generate one image, but nothing after that until I restart the server. I have now tried different resolution and batch counts, and found the following:

So I assume something weird is going on with workloads that go close to my VRAM limit? 3060 with 12gb VRAM.

image

lanice commented 8 months ago

And I found one more oddity: After being in the state mentioned above ("control 100% Finishing"), if I then go over to the Text tab and try to generate any image (with default settings), the log gives the following error:

00:37:51-609760 INFO     Applying hypertile: unet=256
00:37:51-779687 DEBUG    Diffuser pipeline: StableDiffusionXLControlNetXSPipeline task=DiffusersTaskType.TEXT_2_IMAGE
                         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': 6, 'generator': device(type='cuda'), 'output_type': 'latent', 'num_inference_steps': 20,
                         'eta': 1.0, 'width': 512, 'height': 512, 'parser': 'Full parser'}
00:37:51-797122 ERROR    Exception: image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of
                         numpy arrays or list of torch tensors, but is <class 'NoneType'>
00:37:51-798167 ERROR    Arguments: args=('task(xjp7x9w55mb7nbq)', 'a puppy dog', '', [], 20, 0, 0, True, False, False, 1, 1, 6, 6, 0.7,
                         0, 1, 1, -1.0, -1.0, 0, 0, 0, 512, 512, False, 0.5, 2, 'None', False, 20, 0, 0, 5, 0.8, '', '', 0, 0, 0, 0,
                         False, 4, 0.95, False, 0.6, 1, '#000000', 0, [], 0, 1, 'None', 'None', 'None', 'None', 0.5, 0.5, 0.5, 0.5,
                         None, None, None, None, 0, 0, 0, 0, 1, 1, 1, 1, 'None', 16, 'None', 1, True, 'None', 2, True, 1, 0, True,
                         'none', 3, 4, 0.25, 0.25, 3, 1, 1, 0.8, 8, 64, True, 1, 1, 0.5, 0.5, False, False, 'positive', 'comma', 0,
                         False, False, '', 'None', '', 1, '', 'None', True, 0, 'None', 2, True, 1, 0, 0, '', [], 0, '', [], 0, '', [],
                         False, True, False, False, False, False, 0, 5, 'all', 'all', 'all', '', '', '', '1', 'none', False, '', '',
                         'comma', '', True, '', '20', 'all', 'all', 'all', 'all', 0, '', True, '0', False, 'None', [], 'FaceID Base',
                         True, True, 1, 1, 1, 0.5, True, 'person', 1, 0.5, True) kwargs={}
00:37:51-801225 ERROR    gradio call: TypeError
╭───────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────╮
│ /home/lanice/automatic/modules/call_queue.py:31 in f                                                                                 │
│                                                                                                                                      │
│   30 │   │   │   try:                                                                                                                │
│ ❱ 31 │   │   │   │   res = func(*args, **kwargs)                                                                                     │
│   32 │   │   │   │   progress.record_results(id_task, res)                                                                           │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/txt2img.py:88 in txt2img                                                                              │
│                                                                                                                                      │
│   87 │   if processed is None:                                                                                                       │
│ ❱ 88 │   │   processed = processing.process_images(p)                                                                                │
│   89 │   p.close()                                                                                                                   │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/processing.py:187 in process_images                                                                   │
│                                                                                                                                      │
│   186 │   │   │   with context_hypertile_vae(p), context_hypertile_unet(p):                                                          │
│ ❱ 187 │   │   │   │   processed = process_images_inner(p)                                                                            │
│   188                                                                                                                                │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/processing.py:297 in process_images_inner                                                             │
│                                                                                                                                      │
│   296 │   │   │   │   │   from modules.processing_diffusers import process_diffusers                                                 │
│ ❱ 297 │   │   │   │   │   x_samples_ddim = process_diffusers(p)                                                                      │
│   298 │   │   │   │   else:                                                                                                          │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/processing_diffusers.py:441 in process_diffusers                                                      │
│                                                                                                                                      │
│   440 │   │   t0 = time.time()                                                                                                       │
│ ❱ 441 │   │   output = shared.sd_model(**base_args) # pylint: disable=not-callable                                                   │
│   442 │   │   if isinstance(output, dict):                                                                                           │
│                                                                                                                                      │
│ /home/lanice/automatic/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py:115 in decorate_context                          │
│                                                                                                                                      │
│   114 │   │   with ctx_factory():                                                                                                    │
│ ❱ 115 │   │   │   return func(*args, **kwargs)                                                                                       │
│   116                                                                                                                                │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/control/units/xs_pipe.py:856 in __call__                                                              │
│                                                                                                                                      │
│    855 │   │   # 1. Check inputs. Raise error if not correct                                                                         │
│ ❱  856 │   │   self.check_inputs(                                                                                                    │
│    857 │   │   │   prompt,                                                                                                           │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/control/units/xs_pipe.py:517 in check_inputs                                                          │
│                                                                                                                                      │
│    516 │   │   ):                                                                                                                    │
│ ❱  517 │   │   │   self.check_image(image, prompt, prompt_embeds)                                                                    │
│    518 │   │   else:                                                                                                                 │
│                                                                                                                                      │
│ /home/lanice/automatic/modules/control/units/xs_pipe.py:559 in check_image                                                           │
│                                                                                                                                      │
│    558 │   │   ):                                                                                                                    │
│ ❱  559 │   │   │   raise TypeError(                                                                                                  │
│    560 │   │   │   │   f"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors, but is <class 'NoneType'>
vladmandic commented 8 months ago

"100% finishing" is typical vram spike during vae decode. and yes, control modules are memory hungry.

attempting to run txt2img afterwards fails because pipeline is still set to be controlnet pipeline and it expects an image as input. and its still set because pipeline restore is done AFTER vae decode.

00:37:51-779687 DEBUG Diffuser pipeline: StableDiffusionXLControlNetXSPipeline task=DiffusersTaskType.TEXT_2_IMAGE

i could do a pipeline reset to base in txt2img, but it would do nothing to solve original problem with vram - not much i can do there.

lanice commented 8 months ago

"100% finishing" is typical vram spike during vae decode. and yes, control modules are memory hungry.

Makes sense. What I don't understand is: The vae decode actually succeeds, but it's still stuck on "100% finishing". In the screenshot I posted above, in the "Output" section, while being on the Gallery tab it looks like it's still processing, but if I switch to the Image tab (in the Output section), it shows me the finished image. And the finished image is saved on disk.

vladmandic commented 8 months ago

thats interesting. i'll take a look at that, but since its near-impossible for me to reproduce, not sure how much i can do.

vladmandic commented 8 months ago

i cannot reproduce this last issue.

vladmandic commented 2 days ago

is this still an issue? its been sitting as "cannot reproduce" for a while now and in the meantime there have been many app updateds.

lanice commented 2 days ago

Yes, same issue. Just updated to latest master, and tried it again. It generates an image (which is actually saved), but the UI is stuck on "Generate 100% Finishing", and I need to restart the server.

image

lanice commented 1 day ago

Actually, it's not just using controlnet, it happens when using the Control tab specifically. Same issue, when using just a text prompt with nothing else:

image

Using the Text tab instead works with no issues.

vladmandic commented 1 day ago

can you try using chrome?

lanice commented 1 day ago

Just tried it, same issue.