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.71k stars 425 forks source link

[Issue]: Control Output Preview Image Is Stretched (Always defaults to 896 x 1024) #2782

Closed gohan2091 closed 9 months ago

gohan2091 commented 9 months ago

Issue Description

In the Control menu with a 1.5 checkpoint loaded, I upload an image that's for example 896 x 1024, I choose the ControlNet model and processor (can be Depth, Canny, anything really). I set the image size under FIXED to 512 x 768. After the image has generated, wtihin the Control menu interface, the preview image is stretched to 896 x 1024. This happens even if I upload an image that's 512 x 768 and keep the FIXED size the same, the preview image is always stretched to 896 x 1024, Opening the preview image in my web browser or going to the folder where it's stored (AppData\Local\Temp\gradio) confirms it is stretched. When I open the actual output file that's stored in (\automatic\outputs\control) the image is not stretched and has obeyed the dimensions I set. Here are some examples: Screenshot 2024-01-30 182049 Screenshot 2024-01-30 175718 Screenshot 2024-01-30 183852

Version Platform Description

Dev branch 30-01-2024 hash 5faa144a, Windows 11 23H2 Screenshot 2024-01-30 152209

Relevant log output

2024-01-30 18:35:49,101 | sd | INFO | launch | Starting SD.Next
2024-01-30 18:35:49,104 | sd | INFO | installer | Logger: file="C:\Users\USER\SD.Next\automatic\sdnext.log" level=INFO size=65 mode=append
2024-01-30 18:35:49,105 | sd | INFO | installer | Python 3.11.7 on Windows
2024-01-30 18:35:49,238 | sd | INFO | installer | Version: app=sd.next updated=2024-01-30 hash=5faa144a url=https://github.com/vladmandic/automatic/tree/dev
2024-01-30 18:35:49,794 | sd | INFO | installer | Latest published version: 9bf08c5493925b6ddb3451f6a6e00460ca92aedd 2024-01-30T14:29:51Z
2024-01-30 18:35:49,802 | sd | INFO | launch | Platform: arch=AMD64 cpu=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD system=Windows release=Windows-10-10.0.22631-SP0 python=3.11.7
2024-01-30 18:35:49,803 | sd | DEBUG | installer | Setting environment tuning
2024-01-30 18:35:49,804 | sd | DEBUG | installer | HF cache folder: C:\Users\USER\.cache\huggingface\hub
2024-01-30 18:35:49,804 | sd | DEBUG | installer | Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
2024-01-30 18:35:49,804 | sd | DEBUG | installer | Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True
2024-01-30 18:35:49,806 | sd | INFO | installer | nVidia CUDA toolkit detected: nvidia-smi present
2024-01-30 18:35:49,900 | sd | DEBUG | installer | Repository update time: Tue Jan 30 18:03:47 2024
2024-01-30 18:35:49,900 | sd | INFO | launch | Startup: standard
2024-01-30 18:35:49,901 | sd | INFO | installer | Verifying requirements
2024-01-30 18:35:49,912 | sd | INFO | installer | Verifying packages
2024-01-30 18:35:49,914 | sd | INFO | installer | Verifying submodules
2024-01-30 18:35:52,152 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-chainner / main
2024-01-30 18:35:52,217 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-system-info / main
2024-01-30 18:35:52,279 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-webui-agent-scheduler / main
2024-01-30 18:35:52,344 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-webui-controlnet / main
2024-01-30 18:35:52,463 | sd | DEBUG | installer | Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main
2024-01-30 18:35:52,524 | sd | DEBUG | installer | Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
2024-01-30 18:35:52,589 | sd | DEBUG | installer | Submodule: modules/k-diffusion / master
2024-01-30 18:35:52,662 | sd | DEBUG | installer | Submodule: modules/lora / main
2024-01-30 18:35:52,755 | sd | DEBUG | installer | Submodule: wiki / master
2024-01-30 18:35:52,799 | sd | DEBUG | paths | Register paths
2024-01-30 18:35:52,916 | sd | DEBUG | installer | Installed packages: 239
2024-01-30 18:35:52,917 | sd | DEBUG | installer | Extensions all: ['clip-interrogator-ext', 'Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg']
2024-01-30 18:35:52,917 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions-builtin\clip-interrogator-ext\install.py
2024-01-30 18:35:56,728 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions-builtin\sd-extension-system-info\install.py
2024-01-30 18:35:57,110 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions-builtin\sd-webui-agent-scheduler\install.py
2024-01-30 18:35:57,494 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions-builtin\stable-diffusion-webui-images-browser\install.py
2024-01-30 18:35:57,883 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions-builtin\stable-diffusion-webui-rembg\install.py
2024-01-30 18:35:58,268 | sd | DEBUG | installer | Extensions all: ['adetailer', 'canvas-zoom', 'OneButtonPrompt', 'openpose-editor', 'sd-dynamic-prompts', 'sd-webui-3d-open-pose-editor', 'sd-webui-aspect-ratio-helper', 'sd-webui-infinite-image-browsing', 'sd-webui-inpaint-anything', 'sd-webui-photopea-embed', 'sd-webui-reactor', 'sdwebui-close-confirmation-dialogue', 'stable-diffusion-webui-two-shot', 'ultimate-upscale-for-automatic1111']
2024-01-30 18:35:58,269 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\adetailer\install.py
2024-01-30 18:35:58,668 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\canvas-zoom\install.py
2024-01-30 18:36:01,393 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\sd-dynamic-prompts\install.py
2024-01-30 18:36:01,818 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\sd-webui-3d-open-pose-editor\install.py
2024-01-30 18:36:02,219 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\sd-webui-infinite-image-browsing\install.py
2024-01-30 18:36:08,270 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\sd-webui-inpaint-anything\install.py
2024-01-30 18:36:12,627 | sd | DEBUG | installer | Running extension installer: C:\Users\USER\SD.Next\automatic\extensions\sd-webui-reactor\install.py
2024-01-30 18:36:15,236 | sd | INFO | installer | Extensions enabled: ['clip-interrogator-ext', 'Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'adetailer', 'canvas-zoom', 'OneButtonPrompt', 'openpose-editor', 'sd-dynamic-prompts', 'sd-webui-3d-open-pose-editor', 'sd-webui-aspect-ratio-helper', 'sd-webui-infinite-image-browsing', 'sd-webui-inpaint-anything', 'sd-webui-photopea-embed', 'sd-webui-reactor', 'sdwebui-close-confirmation-dialogue', 'stable-diffusion-webui-two-shot', 'ultimate-upscale-for-automatic1111']
2024-01-30 18:36:15,238 | sd | INFO | installer | Verifying requirements
2024-01-30 18:36:15,248 | sd | DEBUG | launch | Setup complete without errors: 1706639775
2024-01-30 18:36:15,253 | sd | INFO | installer | Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
2024-01-30 18:36:15,255 | sd | DEBUG | launch | Starting module: <module 'webui' from 'C:\\Users\\USER\\SD.Next\\automatic\\webui.py'>
2024-01-30 18:36:15,255 | sd | INFO | launch | Command line args: [] 
2024-01-30 18:36:15,256 | sd | DEBUG | launch | Env flags: []
2024-01-30 18:36:19,480 | sd | INFO | loader | Load packages: torch=2.1.2+cu121 diffusers=0.25.1 gradio=3.43.2
2024-01-30 18:36:20,153 | sd | DEBUG | shared | Read: file="config.json" json=39 bytes=1701 time=0.000
2024-01-30 18:36:20,154 | sd | DEBUG | shared | Unknown settings: ['multiple_tqdm']
2024-01-30 18:36:20,155 | sd | INFO | shared | Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad
2024-01-30 18:36:20,195 | sd | INFO | shared | Device: device=NVIDIA GeForce RTX 4090 n=1 arch=sm_90 cap=(8, 9) cuda=12.1 cudnn=8801 driver=551.23
2024-01-30 18:36:20,925 | sd | DEBUG | sd_hijack | Importing LDM
2024-01-30 18:36:20,945 | sd | DEBUG | webui | Entering start sequence
2024-01-30 18:36:20,946 | sd | DEBUG | webui | Initializing
2024-01-30 18:36:20,969 | sd | INFO | sd_vae | Available VAEs: path="models\VAE" items=3
2024-01-30 18:36:20,972 | sd | INFO | extensions | Disabled extensions: ['sd-webui-controlnet', 'multidiffusion-upscaler-for-automatic1111']
2024-01-30 18:36:20,974 | sd | DEBUG | modelloader | Scanning diffusers cache: models\Diffusers models\Diffusers items=4 time=0.00
2024-01-30 18:36:20,975 | sd | DEBUG | shared | Read: file="cache.json" json=2 bytes=11733 time=0.001
2024-01-30 18:36:20,979 | sd | DEBUG | shared | Read: file="metadata.json" json=268 bytes=1173517 time=0.004
2024-01-30 18:36:20,985 | sd | INFO | sd_models | Available models: path="models\Stable-diffusion" items=70 time=0.01
2024-01-30 18:36:21,187 | sd | DEBUG | webui | Load extensions
2024-01-30 18:36:21,364 | sd | INFO | networks | LoRA networks: available=92 folders=9
2024-01-30 18:36:21,367 | sd | INFO | script_loading | Extension: script='extensions-builtin\Lora\scripts\lora_script.py' 18:36:21-364002 INFO     LoRA networks: available=92 folders=9
2024-01-30 18:36:21,615 | 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-01-30 18:36:22,657 | sd | INFO | script_loading | Extension: script='extensions\adetailer\scripts\!adetailer.py' [-] ADetailer initialized. version: 24.1.2, num models: 9
2024-01-30 18:36:24,015 | sd | DEBUG | shared | Read: file="html/upscalers.json" json=4 bytes=2672 time=0.000
2024-01-30 18:36:24,015 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
2024-01-30 18:36:24,016 | sd | DEBUG | chainner_model | chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=3
2024-01-30 18:36:24,019 | sd | DEBUG | modelloader | Load upscalers: total=52 downloaded=7 user=0 time=0.01 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-01-30 18:36:24,019 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
2024-01-30 18:36:24,020 | sd | DEBUG | chainner_model | chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=3
2024-01-30 18:36:24,022 | sd | DEBUG | modelloader | Load upscalers: total=52 downloaded=7 user=0 time=0.00 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-01-30 18:36:24,025 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.001
2024-01-30 18:36:24,025 | sd | DEBUG | chainner_model | chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=3
2024-01-30 18:36:24,027 | sd | DEBUG | modelloader | Load upscalers: total=52 downloaded=7 user=0 time=0.00 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-01-30 18:36:24,028 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
2024-01-30 18:36:24,029 | sd | DEBUG | chainner_model | chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=3
2024-01-30 18:36:24,031 | sd | DEBUG | modelloader | Load upscalers: total=52 downloaded=7 user=0 time=0.00 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-01-30 18:36:24,354 | sd | INFO | script_loading | Extension: script='extensions\sd-webui-inpaint-anything\scripts\inpaint_anything.py' Creating custom formatter for non UTF-8 environments due to attribute 'encoding' of '_io._TextIOBase' objects is not writable
2024-01-30 18:36:24,504 | sd | INFO | webui | Extensions init time: 3.32 img2imgalt.py=0.09 sd-webui-agent-scheduler=0.22 stable-diffusion-webui-images-browser=0.17 adetailer=0.87 OneButtonPrompt=1.37 sd-webui-inpaint-anything=0.27 sd-webui-reactor=0.14
2024-01-30 18:36:24,506 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
2024-01-30 18:36:24,508 | sd | DEBUG | chainner_model | chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=3
2024-01-30 18:36:24,510 | sd | DEBUG | modelloader | Load upscalers: total=52 downloaded=7 user=0 time=0.00 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-01-30 18:36:24,528 | sd | DEBUG | styles | Load styles: folder="models\styles" items=324 time=0.02
2024-01-30 18:36:24,532 | sd | DEBUG | webui | Creating UI
2024-01-30 18:36:24,532 | sd | INFO | theme | Load UI theme: name="huggingface/remilia/Ghostly" style=Auto base=base.css
2024-01-30 18:36:24,533 | sd | WARNING | theme | Using 3rd party theme which is not optimized for SD.Next
2024-01-30 18:36:24,815 | sd | DEBUG | ui_txt2img | UI initialize: txt2img
2024-01-30 18:36:24,893 | sd | DEBUG | shared | Read: file="html\reference.json" json=32 bytes=17153 time=0.002
2024-01-30 18:36:24,914 | sd | DEBUG | ui_extra_networks | Extra networks: page='model' items=102 subfolders=2 tab=txt2img folders=['models\\Stable-diffusion', 'models\\Diffusers', 'models\\Reference'] list=0.09 thumb=0.01 desc=0.04 info=0.07 workers=4
2024-01-30 18:36:24,929 | sd | DEBUG | ui_extra_networks | Extra networks: page='style' items=324 subfolders=1 tab=txt2img folders=['models\\styles', 'html'] list=0.09 thumb=0.00 desc=0.00 info=0.00 workers=4
2024-01-30 18:36:24,931 | sd | DEBUG | ui_extra_networks | Extra networks: page='embedding' items=16 subfolders=0 tab=txt2img folders=['models\\embeddings'] list=0.08 thumb=0.00 desc=0.01 info=0.05 workers=4
2024-01-30 18:36:24,933 | sd | DEBUG | ui_extra_networks | 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
2024-01-30 18:36:24,934 | sd | DEBUG | ui_extra_networks | Extra networks: page='vae' items=3 subfolders=0 tab=txt2img folders=['models\\VAE'] list=0.03 thumb=0.02 desc=0.00 info=0.01 workers=4
2024-01-30 18:36:24,937 | sd | DEBUG | ui_extra_networks | Extra networks: page='lora' items=92 subfolders=0 tab=txt2img folders=['models\\Lora', 'models\\LyCORIS'] list=0.08 thumb=0.01 desc=0.04 info=0.06 workers=4
2024-01-30 18:36:25,038 | sd | DEBUG | ui_img2img | UI initialize: img2img
2024-01-30 18:36:25,390 | sd | DEBUG | ui_control_helpers | UI initialize: control models=models\control
2024-01-30 18:36:25,609 | sd | DEBUG | shared | Read: file="ui-config.json" json=92 bytes=11362 time=0.000
2024-01-30 18:36:25,722 | sd | DEBUG | theme | Themes: builtin=11 default=5 external=55
2024-01-30 18:36:28,153 | sd | DEBUG | ui_extensions | Extension list: processed=332 installed=23 enabled=21 disabled=2 visible=332 hidden=0
2024-01-30 18:36:28,391 | sd | INFO | webui | Local URL: http://127.0.0.1:7860/
2024-01-30 18:36:28,392 | sd | DEBUG | webui | Gradio functions: registered=2672
2024-01-30 18:36:28,393 | sd | INFO | middleware | Initializing middleware
2024-01-30 18:36:28,396 | sd | DEBUG | webui | Creating API
2024-01-30 18:36:28,591 | sd | INFO | task_runner | [AgentScheduler] Task queue is empty
2024-01-30 18:36:28,592 | sd | INFO | api | [AgentScheduler] Registering APIs
2024-01-30 18:36:28,976 | sd | DEBUG | webui | Scripts setup: ['X/Y/Z Grid:0.187', 'One Button Prompt:0.036', 'Face:0.01', 'AnimateDiff:0.005', 'ADetailer:0.045', 'Dynamic Prompts v2.17.1:0.015', 'ReActor:0.019', 'Latent Couple extension:0.021']
2024-01-30 18:36:28,976 | sd | DEBUG | sd_models | Model metadata: file="metadata.json" no changes
2024-01-30 18:36:28,977 | sd | DEBUG | modeldata | Model requested: fn=<lambda>
2024-01-30 18:36:28,977 | sd | INFO | sd_models | Select: model="epicrealism_naturalSinRC1VAE [84d76a0328]"
2024-01-30 18:36:28,978 | sd | DEBUG | sd_models | Load model: existing=False target=C:\Users\USER\SD.Next\automatic\models\Stable-diffusion\epicrealism_naturalSinRC1VAE.safetensors info=None
2024-01-30 18:36:28,993 | sd | DEBUG | devices | Desired Torch parameters: dtype=FP16 no-half=False no-half-vae=False upscast=False
2024-01-30 18:36:28,993 | sd | INFO | devices | Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=inference_mode fp16=True bf16=None
2024-01-30 18:36:28,995 | sd | DEBUG | sd_models | Diffusers loading: path="C:\Users\USER\SD.Next\automatic\models\Stable-diffusion\epicrealism_naturalSinRC1VAE.safetensors"
2024-01-30 18:36:28,996 | sd | INFO | sd_models | Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline file="C:\Users\USER\SD.Next\automatic\models\Stable-diffusion\epicrealism_naturalSinRC1VAE.safetensors" size=2034MB
2024-01-30 18:36:31,477 | sd | DEBUG | sd_models | Setting model: pipeline=StableDiffusionPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'extract_ema': True, 'use_safetensors': True}
2024-01-30 18:36:31,478 | sd | DEBUG | sd_models | Setting model: enable VAE slicing
2024-01-30 18:36:31,478 | sd | DEBUG | sd_models | Setting model: enable VAE tiling
2024-01-30 18:36:32,849 | sd | INFO | server | MOTD: N/A
2024-01-30 18:36:34,472 | sd | INFO | textual_inversion | Load embeddings: loaded=14 skipped=2 time=0.05
2024-01-30 18:36:34,725 | sd | DEBUG | devices | GC: collected=5199 device=cuda {'ram': {'used': 2.39, 'total': 63.91}, 'gpu': {'used': 3.7, 'total': 23.99}, 'retries': 0, 'oom': 0} time=0.25
2024-01-30 18:36:34,729 | sd | INFO | sd_models | Load model: time=5.49 load=5.49 native=512 {'ram': {'used': 2.39, 'total': 63.91}, 'gpu': {'used': 3.7, 'total': 23.99}, 'retries': 0, 'oom': 0}
2024-01-30 18:36:34,732 | sd | DEBUG | shared | Save: file="config.json" json=39 bytes=1647 time=0.001
2024-01-30 18:36:34,733 | sd | DEBUG | shared | Unused settings: ['multiple_tqdm']
2024-01-30 18:36:34,733 | sd | DEBUG | script_callbacks | Script callback init time: image_browser.py:ui_tabs=0.60 system-info.py:app_started=0.06 task_scheduler.py:app_started=0.44
2024-01-30 18:36:34,733 | sd | INFO | webui | Startup time: 19.47 torch=3.12 gradio=1.06 libraries=1.44 extensions=3.32 face-restore=0.20 ui-en=0.59 ui-txt2img=0.08 ui-img2img=0.26 ui-settings=0.20 ui-extensions=2.38 ui-defaults=0.07 launch=0.14 api=0.07 app-started=0.51 checkpoint=5.76
2024-01-30 18:36:37,726 | sd | DEBUG | theme | Themes: builtin=11 default=5 external=55
2024-01-30 18:36:37,974 | sd | INFO | api | Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
2024-01-30 18:37:25,462 | sd | DEBUG | generation_parameters_copypaste | Paste prompt: type="current" prompt="Man standing on a hill looking at a city, cosmic horror concept art, dramatic green lighting, singularity, dream sequence, (natural skin texture, hyperrealism, sharp, detailed skin), HDR, UHD 8K, full detail, film grain, photorealistic
Negative prompt: (deformed, distorted, disfigured, doll:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, 3d, illustration, cartoon
Steps: 34, Seed: 740595922, Sampler: DPM++ 2M, CFG scale: 6, Size: 512x768, Batch: 10x1, Index: 3x1, Parser: Full parser, Model: reliberate_v10, Model hash: 980cb713af, VAE: vae-ft-mse-840000-ema-pruned, Styles: Reliberate, Backend: Original, App: SD.Next, Version: bee397e, Operations: hires; txt2img, Second pass: True, Hires force: False, Hires steps: 30, Hires upscaler: Latent (nearest-exact), Hires upscale: 2, Hires resize: 0x0, Hires size: 1024x1536, Denoising strength: 0.55, Latent sampler: DPM++ 2M SDE, Image CFG scale: 6, CFG rescale: 0.7, Sampler brownian: False, Sampler sigma: karras"
2024-01-30 18:37:25,462 | sd | DEBUG | generation_parameters_copypaste | Settings overrides: ['Sampler brownian: False', 'Sampler sigma: karras']
2024-01-30 18:37:27,948 | sd | DEBUG | ui_control_helpers | Control input: type=PIL.Image input=[<PIL.Image.Image image mode=RGB size=1024x1536 at 0x19FC3F42050>]
2024-01-30 18:37:56,127 | sd | DEBUG | controlnet | Control ControlNet model loading: id="Canny FP16" path="Aptronym/SDNext/ControlNet11/controlnet11Models_canny.safetensors"
2024-01-30 18:37:57,689 | sd | DEBUG | controlnet | Control ControlNet model loaded: id="Canny FP16" path="Aptronym/SDNext/ControlNet11/controlnet11Models_canny.safetensors" time=1.56
2024-01-30 18:37:58,641 | sd | DEBUG | processors | Control Processor loading: id="Canny" class=CannyDetector
2024-01-30 18:37:58,642 | sd | DEBUG | processors | Control Processor loaded: id="Canny" class=CannyDetector time=0.00
2024-01-30 18:37:59,760 | sd | DEBUG | launch | Server: alive=True jobs=1 requests=76 uptime=100 memory=2.41/63.91 backend=Backend.DIFFUSERS state=idle
2024-01-30 18:38:00,370 | sd | DEBUG | processors | Control Processor: id="Canny" mode=RGB args={'low_threshold': 100, 'high_threshold': 200} time=0.04
2024-01-30 18:38:05,229 | sd | DEBUG | ui_control_helpers | Control input: type=PIL.Image input=[<PIL.Image.Image image mode=RGB size=1024x1536 at 0x19FB0EC4A90>]
2024-01-30 18:38:05,624 | sd | DEBUG | run | Control ControlNet unit: i=1 process=Canny model=Canny FP16 strength=1.0 guess=False start=0 end=1
2024-01-30 18:38:05,634 | sd | DEBUG | controlnet | Control ControlNet pipeline: class=StableDiffusionControlNetPipeline time=0.01
2024-01-30 18:38:05,653 | sd | DEBUG | sd_models | Setting model: enable VAE slicing
2024-01-30 18:38:05,654 | sd | DEBUG | sd_models | Setting model: enable VAE tiling
2024-01-30 18:38:05,661 | sd | DEBUG | images | Image resize: input=<PIL.Image.Image image mode=RGB size=1024x1536 at 0x19FB0EC4A90> mode=1 target=512x768 upscaler=ESRGAN 4x Ultrasharp function=control_run
2024-01-30 18:38:05,685 | sd | DEBUG | processors | Control Processor: id="Canny" mode=RGB args={'low_threshold': 100, 'high_threshold': 200} time=0.01
2024-01-30 18:38:05,743 | sd | INFO | sd_hijack_hypertile | Applying hypertile: unet=256
2024-01-30 18:38:05,823 | sd | DEBUG | sd_samplers | Sampler: sampler="DPM++ 2M" config={'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'scaled_linear', 'prediction_type': 'epsilon', 'thresholding': False, 'sample_max_value': 1.0, 'algorithm_type': 'sde-dpmsolver++', 'solver_type': 'midpoint', 'lower_order_final': True, 'use_karras_sigmas': True}
2024-01-30 18:38:06,042 | sd | DEBUG | processing_diffusers | Diffuser pipeline: StableDiffusionControlNetPipeline task=DiffusersTaskType.TEXT_2_IMAGE set={'prompt_embeds': torch.Size([1, 77, 768]), 'negative_prompt_embeds': torch.Size([1, 77, 768]), 'guidance_scale': 6, 'generator': device(type='cuda'), 'output_type': 'latent', 'num_inference_steps': 30, 'eta': 1.0, 'width': 512, 'height': 768, 'controlnet_conditioning_scale': 1.0, 'control_guidance_start': 0.0, 'control_guidance_end': 1.0, 'guess_mode': False, 'image': <class 'list'>, 'parser': 'Full parser'}
2024-01-30 18:38:06,076 | sd | DEBUG | sd_samplers | Sampler: sampler="DPM++ 2M" config={'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'scaled_linear', 'prediction_type': 'epsilon', 'thresholding': False, 'sample_max_value': 1.0, 'algorithm_type': 'sde-dpmsolver++', 'solver_type': 'midpoint', 'lower_order_final': True, 'use_karras_sigmas': True}
2024-01-30 18:38:07,493 | sd | DEBUG | sd_vae_taesd | VAE load: type=taesd model=models\TAESD\taesd_decoder.pth
2024-01-30 18:38:10,227 | sd | DEBUG | images | Saving: image="outputs\control\00089-epicrealism_naturalSinRC1VAE-Man standing on a hill looking at a.png" type=PNG resolution=512x768 size=0
2024-01-30 18:38:10,341 | sd | INFO | processing | Processed: images=1 time=4.52 its=6.64 memory={'ram': {'used': 1.94, 'total': 63.91}, 'gpu': {'used': 4.69, 'total': 23.99}, 'retries': 0, 'oom': 0}
2024-01-30 18:38:10,352 | sd | DEBUG | images | Image resize: input=<PIL.Image.Image image mode=RGB size=512x768 at 0x19FB175C310> mode=1 target=896x1024 upscaler=ESRGAN 4x Ultrasharp function=control_run
2024-01-30 18:38:10,399 | sd | INFO | esrgan_model | Upscaler loaded: type=ESRGAN model=models\ESRGAN\ESRGAN-UltraSharp-4x.pth
2024-01-30 18:38:12,486 | sd | DEBUG | ui_tempdir | Saving temp: image="C:\Users\USER\AppData\Local\Temp\gradio\tmpcrr9sbtv.png" resolution=896x1024 size=1549468
2024-01-30 18:38:12,573 | sd | INFO | run | Control: pipeline units=1 process=1 time=4.73 init=0.01 proc=0.09 ctrl=4.62 outputs=1

Backend

Diffusers

Branch

Dev

Model

SD 1.5

Acknowledgements

gohan2091 commented 9 months ago

Screenshot 2024-01-30 184234 a side note: mask preview image is so large, unsure why.

I see it picks up that I set the target dimensions here:

2024-01-30 18:38:05,661 | sd | DEBUG | images | Image resize: input=<PIL.Image.Image image mode=RGB size=1024x1536 at 0x19FB0EC4A90> mode=1 target=512x768 upscaler=ESRGAN 4x Ultrasharp function=control_run

then it shows this:

2024-01-30 18:38:10,352 | sd | DEBUG | images | Image resize: input=<PIL.Image.Image image mode=RGB size=512x768 at 0x19FB175C310> mode=1 target=896x1024 upscaler=ESRGAN 4x Ultrasharp function=control_run

vladmandic commented 9 months ago

can you check with latest dev?

gohan2091 commented 9 months ago

can you check with latest dev?

I have updated and now using dev version: 2024-02-01 hash=060c92c0. Unfortunately I do not see any improvement. It's still doing exactly the same thing.

The preview in the output gallery within Control menu is stretched:

Screenshot 2024-02-01 012338

The image located in \AppData\Local\Temp\gradio is saved as stretched. The image located in \automatic\outputs\control is fine.

Screenshot 2024-02-01 012615 sdnext.log

gohan2091 commented 9 months ago

While I am sure you have more important things to spend your time with, I would love to hear an update on this issue as I am having to minimise SD.Next and open the image in the outputs\control folder everytime I generate an image. and want to see the result.

vladmandic commented 9 months ago

i just tried and cannot reproduce with latest dev. try to reproduce and if you still have a problem, try to explain the workflow once again - maybe i missed something. also, set env variable SD_CONTROL_DEBUG=true before starting the server, it will increase verbosity of logging so I can see what is triggering apparent second resize.

gohan2091 commented 9 months ago

Ok, I will try to explain the best I can in as much detail as I can.

I am currently using version: 2024-02-04 hash=a4dbdc04. Here is how to replicate the problem (but there are other ways, this example is very simple):

1) Open an already generated image into the Process tab. As an example, let's use this one:

00040-epicrealism_pureEvolutionV5-Candid Moment photo of a police officer casually

2) Send this to Control using the >Control button in the Process tab (Settings aren' important, let's leave them according to the PNG file.) Here is a cropped screenshot:

Screenshot 2024-02-04 215026

3) Load a Controlnet such as Depth Zoe XL with Zoe Depth then hit the generate button

Here is the result according to the UI

Screenshot 2024-02-04 214818

This preview image is stored in: C:\Users\USERNAME\AppData\Local\Temp\gradio

It's stretched to 896 x 1024 and looks like this:

tmpt9ezfre9

4) Navigate to \automatic\outputs\control and the image looks like the below which is correct:

00186-newrealityxl_20-Candid Moment photo of a police officer casually

The actual image is generated correctly with the correct size and aspect ratio. It's the preview image displayed in the UI (which is stored in the Temp\gradio folder) that's the problem. Here is a fresh sdnext.log and I have tried (although I may have done it wrong) to set the env variable as you asked. Here is a screenshot to show this.

Screenshot 2024-02-04 215602

vladmandic commented 9 months ago

debug flag is set correctly. using your image and your workflow, i cannot reproduce - see screenshot:

image

only way i can reproduce is if i explicitly set size -> after -> and then enter incorrect size. and that is exactly what i see in your log.

2024-02-04 21:47:16,675 | sd | INFO | processing | Processed: images=1 time=16.19 its=1.85 memory={'ram': {'used': 2.57, 'total': 63.91}, 'gpu': {'used': 12.92, 'total': 23.99}, 'retries': 0, 'oom': 0}
2024-02-04 21:47:16,706 | sd | TRACE | run | Control resize: op=after image=<PIL.Image.Image image mode=RGB size=1024x1536 at 0x1CA31840F50> width=896 height=1024 mode=1 name=ESRGAN 4x Ultrasharp
2024-02-04 21:47:16,707 | sd | DEBUG | images | Image resize: input=<PIL.Image.Image image mode=RGB size=1024x1536 at 0x1CA31840F50> mode=1 target=896x1024 upscaler=ESRGAN 4x Ultrasharp function=control_run
2024-02-04 21:47:16,728 | sd | TRACE | ui_control | Control received: type=<class 'tuple'> (<PIL.Image.Image image mode=RGB size=896x1024 at 0x1CA3139DF10>, <PIL.Image.Image image mode=RGB size=1024x1536 at 0x1CD818FFBD0>, 'Control output | 1 of 1 | Image 896x1024')

after everything was done there is one more resize which results in incorrect dimensions you're seing. and that resize after is definitely NOT enabled or set by default - that is your setting.

gohan2091 commented 9 months ago

So from reading your reply back 5 times, I finally understand. The Resize AFTER is messing up the final output even though I am only using Resize BEFORE. So the two menus Resize BEFORE and Resize AFTER are used together? and aren't independant of each other? I did not touch Resize AFTER at all however when I installed SD.Next, I went through the different sections, opening up menus and configuring values that I commonly use and I set those as new defaults and menu states as new defaults. So I can only assume that the Resize AFTER is permanently set to that fixed value of 896 x 1024 despite whatever image I send to it. Now I know, thanks for your help.

vladmandic commented 9 months ago

resize before and resize after are both used. before is used on init image before processing. after is used on final output.

for example, if you have 2k input image, you cannot process that on normal gpu. but you can resize before 0.5, process at 1k and then resize after 2x back to 2k.

gohan2091 commented 9 months ago

resize before and resize after are both used. before is used on init image before processing. after is used on final output.

for example, if you have 2k input image, you cannot process that on normal gpu. but you can resize before 0.5, process at 1k and then resize after 2x back to 2k.

That's good to know, thanks for explaining that. There is so much about the Control menu I do not know but with time I can learn and I will feel more comfortable with it especially if you continue to improve it. Not necessarily with new features (although this is welcomed) but more about improving on what it can already do, making it more intuitive to use for newbies etc. The upcoming documentation should help.