Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Extension]: sd-webui-agent-scheduler fails when posting a txt2img queue API request #3680

Closed
1 task done
DrakeRichards opened this issue Jan 2, 2025 · 2 comments
Closed
1 task done
Labels
extension Extension is not working correctly

Comments

@DrakeRichards
Copy link
Contributor

DrakeRichards commented Jan 2, 2025

Issue Description

Issue

When sending a txt2img request to the agent scheduler API endpoint (/agent-scheduler/v1/queue/txt2img), the request will fail with the error message AttributeError: 'ResTxt2Img' object has no attribute 'override_settings'.

I have not tested this with the img2img endpoint, but I assume it would produce the same result.

Steps to Reproduce

  1. Make a fresh clone of the repo and follow the normal installation process.
  2. Launch SD.Next with the --docs argument.
  3. Access the docs endpoint by navigating to http://127.0.0.1:7860/docs
  4. Expand the docs entry for /agent-scheduler/v1/queue/txt2img
  5. Click "Try it Out"
  6. Execute using the example request.

Expected Behavior

The request should be added to the image generation queue.

Actual Behavior

The console will show that the request fails with the error AttributeError: 'ResTxt2Img' object has no attribute 'override_settings'.

Log Excerpt

2025-01-01 18:36:37,818 | sd | INFO | launch | Starting SD.Next
2025-01-01 18:36:37,818 | sd | INFO | installer | Logger: file="F:\ai\stable-diffusion\sdnext\sdnext.log" level=INFO size=6121474 mode=append
2025-01-01 18:36:37,818 | sd | INFO | installer | Python: version=3.11.7 platform=Windows bin="F:\ai\stable-diffusion\sdnext\venv\Scripts\Python.exe" venv="F:\ai\stable-diffusion\sdnext\venv"
2025-01-01 18:36:38,100 | sd | INFO | installer | Version: app=sd.next updated=2025-01-01 hash=c4ecee3c branch=master url=git@github.com:vladmandic/automatic.git/tree/master ui=dev
2025-01-01 18:36:38,100 | sd | DEBUG | installer | Branch mismatch: sdnext=master ui=dev
2025-01-01 18:36:38,434 | sd | DEBUG | installer | Branch sync failed: sdnext=master ui=main
2025-01-01 18:36:39,116 | sd | INFO | launch | Platform: arch=AMD64 cpu=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD system=Windows release=Windows-10-10.0.22631-SP0 python=3.11.7 docker=False
2025-01-01 18:36:39,132 | sd | DEBUG | installer | Packages: venv=venv site=['venv', 'venv\\Lib\\site-packages']
2025-01-01 18:36:39,132 | sd | INFO | launch | Args: ['--data-dir', 'F:\\ai\\stable-diffusion\\sdnext-configs\\standard', '--listen', '--docs']
2025-01-01 18:36:39,132 | sd | DEBUG | installer | Setting environment tuning
2025-01-01 18:36:39,132 | sd | DEBUG | installer | Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
2025-01-01 18:36:39,147 | sd | DEBUG | installer | Torch overrides: cuda=False rocm=False ipex=False directml=False openvino=False zluda=False
2025-01-01 18:36:39,179 | sd | INFO | installer | CUDA: nVidia toolkit detected
2025-01-01 18:36:39,427 | sd | INFO | installer | Install: verifying requirements
2025-01-01 18:36:39,427 | sd | INFO | installer | Verifying packages
2025-01-01 18:36:40,463 | sd | DEBUG | installer | Timestamp repository update time: Wed Jan  1 14:49:14 2025
2025-01-01 18:36:40,463 | sd | DEBUG | installer | Timestamp previous setup time: Wed Jan  1 18:28:31 2025
2025-01-01 18:36:40,463 | sd | INFO | installer | Extensions: disabled=[]
2025-01-01 18:36:40,463 | sd | INFO | installer | Extensions: enabled=['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg'] extensions-builtin
2025-01-01 18:36:40,463 | sd | INFO | installer | Extensions: enabled=['sd-webui-mosaic-outpaint', 'ultimate-upscale-for-automatic1111'] extensions
2025-01-01 18:36:40,463 | sd | DEBUG | installer | Timestamp latest extensions time: Wed Jan  1 18:36:38 2025
2025-01-01 18:36:40,463 | sd | DEBUG | installer | Timestamp: version:1735764554 setup:1735777711 extension:1735778198
2025-01-01 18:36:40,463 | sd | INFO | launch | Startup: standard
2025-01-01 18:36:40,479 | sd | INFO | installer | Verifying submodules
2025-01-01 18:36:43,534 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-extension-chainner / main
2025-01-01 18:36:43,675 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-extension-system-info / main
2025-01-01 18:36:43,785 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-webui-agent-scheduler / main
2025-01-01 18:36:43,937 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/sdnext-modernui" reattach=dev
2025-01-01 18:36:43,937 | sd | DEBUG | installer | Git submodule: extensions-builtin/sdnext-modernui / dev
2025-01-01 18:36:44,047 | sd | DEBUG | installer | Git submodule: extensions-builtin/stable-diffusion-webui-rembg / master
2025-01-01 18:36:44,163 | sd | DEBUG | installer | Git submodule: modules/k-diffusion / master
2025-01-01 18:36:44,275 | sd | DEBUG | installer | Git submodule: wiki / master
2025-01-01 18:36:44,338 | sd | DEBUG | paths | Register paths
2025-01-01 18:36:44,468 | sd | DEBUG | installer | Installed packages: 235
2025-01-01 18:36:44,468 | sd | DEBUG | installer | Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
2025-01-01 18:36:44,877 | sd | DEBUG | installer | Extension installer: F:\ai\stable-diffusion\sdnext\extensions-builtin\sd-webui-agent-scheduler\install.py
2025-01-01 18:36:47,831 | sd | DEBUG | installer | Extension installer: F:\ai\stable-diffusion\sdnext\extensions-builtin\stable-diffusion-webui-rembg\install.py
2025-01-01 18:36:54,787 | sd | DEBUG | installer | Extensions all: ['sd-webui-mosaic-outpaint', 'ultimate-upscale-for-automatic1111']
2025-01-01 18:36:54,988 | sd | INFO | installer | Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg', 'sd-webui-mosaic-outpaint', 'ultimate-upscale-for-automatic1111']
2025-01-01 18:36:54,988 | sd | INFO | installer | Install: verifying requirements
2025-01-01 18:36:54,988 | sd | DEBUG | launch | Setup complete without errors: 1735778215
2025-01-01 18:36:54,988 | sd | DEBUG | installer | Extension preload: {'extensions-builtin': 0.0, 'F:\\ai\\stable-diffusion\\sdnext-configs\\standard\\extensions': 0.0}
2025-01-01 18:36:54,988 | sd | INFO | launch | Command line args: ['--data-dir', 'F:\\ai\\stable-diffusion\\sdnext-configs\\standard', '--listen', '--docs'] data_dir=F:\ai\stable-diffusion\sdnext-configs\standard listen=True docs=True
2025-01-01 18:36:54,988 | sd | DEBUG | launch | Env flags: []
2025-01-01 18:36:54,988 | sd | DEBUG | launch | Starting module: <module 'webui' from 'F:\\ai\\stable-diffusion\\sdnext\\webui.py'>
2025-01-01 18:37:03,852 | sd | INFO | shared | Device detect: memory=8.0 optimization=balanced
2025-01-01 18:37:03,852 | sd | DEBUG | shared | Read: file="F:\ai\stable-diffusion\sdnext-configs\standard\config.json" json=41 bytes=2140 time=0.000 fn=<module>:load
2025-01-01 18:37:04,150 | sd | INFO | shared | Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad
2025-01-01 18:37:04,150 | sd | DEBUG | shared | Read: file="html\reference.json" json=62 bytes=32535 time=0.000 fn=_call_with_frames_removed:<module>
2025-01-01 18:37:04,205 | sd | INFO | devices | Torch parameters: backend=cuda device=cuda config=FP16 dtype=torch.float16 context=no_grad nohalf=False nohalfvae=False upcast=True deterministic=False fp16=pass bf16=pass optimization="Scaled-Dot-Product"
2025-01-01 18:37:04,636 | sd | DEBUG | __init__ | ONNX: version=1.20.1 provider=CUDAExecutionProvider, available=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider']
2025-01-01 18:37:04,793 | sd | DEBUG | __init__ | ONNX failed to initialize XL pipelines: module 'optimum.onnxruntime.modeling_diffusion' has no attribute 'ORTPipelinePart'
2025-01-01 18:37:04,856 | sd | INFO | shared | Device: device=NVIDIA GeForce RTX 3060 Ti n=1 arch=sm_90 capability=(8, 6) cuda=12.4 cudnn=90100 driver=566.36
2025-01-01 18:37:06,221 | sd | INFO | loader | Torch: torch==2.5.1+cu124 torchvision==0.20.1+cu124
2025-01-01 18:37:06,221 | sd | INFO | loader | Packages: diffusers==0.33.0.dev0 transformers==4.47.1 accelerate==1.2.1 gradio==3.43.2
2025-01-01 18:37:06,378 | sd | DEBUG | webui | Entering start sequence
2025-01-01 18:37:06,378 | sd | INFO | webui | Using data path: F:\ai\stable-diffusion\sdnext-configs\standard
2025-01-01 18:37:06,378 | sd | DEBUG | webui | Initializing
2025-01-01 18:37:06,378 | sd | DEBUG | shared | Read: file="F:\ai\stable-diffusion\sdnext-configs\standard\metadata.json" json=151 bytes=362703 time=0.000 fn=initialize:init_metadata
2025-01-01 18:37:06,378 | sd | DEBUG | shared | Read: file="F:\ai\stable-diffusion\sdnext-configs\standard\cache.json" json=2 bytes=8730 time=0.000 fn=initialize:init_cache
2025-01-01 18:37:06,378 | sd | DEBUG | webui | Huggingface cache: path="C:\Users\thoma\.cache\huggingface\hub"
2025-01-01 18:37:06,426 | sd | INFO | sd_vae | Available VAEs: path="F:\ai\stable-diffusion\models\VAE" items=9
2025-01-01 18:37:06,426 | sd | INFO | sd_unet | Available UNets: path="F:\ai\stable-diffusion\models\UNET" items=0
2025-01-01 18:37:06,426 | sd | INFO | model_te | Available TEs: path="F:\ai\stable-diffusion\models\Text-encoder" items=0
2025-01-01 18:37:06,442 | sd | INFO | sd_checkpoint | Available Models: items=18 safetensors="F:\ai\stable-diffusion\models\Stable-diffusion":13 diffusers="F:\ai\stable-diffusion\models\Diffusers":5 time=0.02
2025-01-01 18:37:06,457 | sd | INFO | networks | Available LoRAs: path="F:\ai\stable-diffusion\models\Lora" items=43 folders=2 time=0.00
2025-01-01 18:37:06,489 | sd | INFO | styles | Available Styles: folder="F:\ai\stable-diffusion\models\styles" items=319 time=0.02
2025-01-01 18:37:06,598 | sd | INFO | yolo | Available Yolo: path="F:\ai\stable-diffusion\models\yolo" items=6 downloaded=0
2025-01-01 18:37:06,598 | sd | DEBUG | extensions | Extensions: disabled=['Lora']
2025-01-01 18:37:06,598 | sd | INFO | webui | Load extensions
2025-01-01 18:37:07,727 | 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
2025-01-01 18:37:07,743 | sd | DEBUG | webui | Extensions init time: total=1.14 pulid_ext.py=0.50 sd-webui-agent-scheduler=0.49
2025-01-01 18:37:07,743 | sd | DEBUG | shared | Read: file="html/upscalers.json" json=4 bytes=2640 time=0.000 fn=__init__:__init__
2025-01-01 18:37:07,743 | sd | DEBUG | shared | Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2693 time=0.000 fn=__init__:find_scalers
2025-01-01 18:37:07,759 | sd | DEBUG | chainner_model | chaiNNer models: path="F:\ai\stable-diffusion\models\chaiNNer" defined=24 discovered=0 downloaded=9
2025-01-01 18:37:07,759 | sd | INFO | modelloader | Available Upscalers: items=52 downloaded=9 user=0 time=0.02 types=['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'AuraSR', 'ESRGAN', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2025-01-01 18:37:07,759 | sd | DEBUG | webui | UI start sequence
2025-01-01 18:37:07,759 | sd | INFO | theme | UI theme: type=Modern name="Default" available=34
2025-01-01 18:37:07,774 | sd | DEBUG | ui_javascript | UI theme: css="extensions-builtin\sdnext-modernui\themes\Default.css" base="base.css" user="None"
2025-01-01 18:37:07,774 | sd | DEBUG | ui_txt2img | UI initialize: txt2img
2025-01-01 18:37:07,916 | sd | DEBUG | ui_extra_networks | Networks: page='model' items=79 subfolders=13 tab=txt2img folders=['F:\\ai\\stable-diffusion\\models\\Stable-diffusion', 'F:\\ai\\stable-diffusion\\models\\Diffusers', 'models\\Reference'] list=0.11 thumb=0.03 desc=0.00 info=0.03 workers=8
2025-01-01 18:37:07,931 | sd | DEBUG | ui_extra_networks | Networks: page='lora' items=43 subfolders=9 tab=txt2img folders=['F:\\ai\\stable-diffusion\\models\\Lora'] list=0.09 thumb=0.02 desc=0.08 info=0.17 workers=8
2025-01-01 18:37:07,947 | sd | DEBUG | ui_extra_networks | Networks: page='style' items=319 subfolders=7 tab=txt2img folders=['F:\\ai\\stable-diffusion\\models\\styles', 'html'] list=0.11 thumb=0.02 desc=0.00 info=0.00 workers=8
2025-01-01 18:37:07,947 | sd | DEBUG | ui_extra_networks | Networks: page='embedding' items=0 subfolders=0 tab=txt2img folders=['F:\\ai\\stable-diffusion\\models\\embeddings'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=8
2025-01-01 18:37:07,947 | sd | DEBUG | ui_extra_networks | Networks: page='vae' items=9 subfolders=2 tab=txt2img folders=['F:\\ai\\stable-diffusion\\models\\VAE'] list=0.06 thumb=0.06 desc=0.00 info=0.00 workers=8
2025-01-01 18:37:07,947 | sd | DEBUG | ui_extra_networks | Networks: page='history' items=0 subfolders=0 tab=txt2img folders=[] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=8
2025-01-01 18:37:08,292 | sd | DEBUG | ui_img2img | UI initialize: img2img
2025-01-01 18:37:08,544 | sd | DEBUG | ui_control_helpers | UI initialize: control models=F:\ai\stable-diffusion\models\control
2025-01-01 18:37:08,826 | sd | DEBUG | scripts | Script: op=before-component total=0.01 scripts=['Video: Allegro:0.01']
2025-01-01 18:37:09,344 | sd | DEBUG | scripts | Script: op=before-component total=0.02 scripts=['Prompt matrix:0.02']
2025-01-01 18:37:09,375 | sd | DEBUG | shared | Read: file="F:\ai\stable-diffusion\sdnext-configs\standard\ui-config.json" json=14 bytes=643 time=0.000 fn=__init__:read_from_file
2025-01-01 18:37:09,704 | sd | DEBUG | scripts | Script: op=after-component total=0.02 scripts=['Video: Hunyuan Video:0.02']
2025-01-01 18:37:09,893 | sd | DEBUG | scripts | Script: op=after-component total=0.02 scripts=['LUT Color grading:0.02']
2025-01-01 18:37:10,990 | sd | DEBUG | ui_extensions | Extension list: processed=366 installed=8 enabled=7 disabled=1 visible=366 hidden=0
2025-01-01 18:37:11,179 | sd | DEBUG | webui | Root paths: ['F:\\ai\\stable-diffusion\\sdnext', 'F:\\ai\\stable-diffusion\\sdnext-configs\\standard']
2025-01-01 18:37:13,296 | sd | INFO | webui | Local URL: http://localhost:7860/
2025-01-01 18:37:13,296 | sd | INFO | webui | API Docs: http://localhost:7860/docs
2025-01-01 18:37:13,296 | sd | INFO | webui | API ReDocs: http://localhost:7860/redocs
2025-01-01 18:37:13,296 | sd | DEBUG | middleware | API middleware: [<class 'starlette.middleware.base.BaseHTTPMiddleware'>, <class 'starlette.middleware.gzip.GZipMiddleware'>]
2025-01-01 18:37:13,296 | sd | DEBUG | webui | API initialize
2025-01-01 18:37:13,547 | sd | INFO | task_runner | [AgentScheduler] Task queue is empty
2025-01-01 18:37:13,547 | sd | INFO | api | [AgentScheduler] Registering APIs
2025-01-01 18:37:13,986 | sd | DEBUG | webui | Scripts setup: time=0.564 ['K-Diffusion Samplers:0.125', 'XYZ Grid:0.074', 'IP Adapters:0.047', 'Video: LTX Video:0.036', 'Face: Multiple ID Transfers:0.031', 'Ultimate SD upscale:0.03', 'ConsiStory: Consistent Image Generation:0.029', 'Video: VGen Image-to-Video:0.021', 'Video: AnimateDiff:0.017', 'Outpainting:0.016', 'SD Upscale:0.016', 'Prompts from file:0.016', 'PuLID: ID Customization:0.016', 'Kohya HiRes Fix:0.016', 'Differential diffusion: Individual Pixel Strength:0.016', 'LUT Color grading:0.016', 'Video: Allegro:0.015', 'FreeScale: Tuning-Free Scale Fusion:0.012']
2025-01-01 18:37:13,986 | sd | DEBUG | sd_checkpoint | Model metadata: file="F:\ai\stable-diffusion\sdnext-configs\standard\metadata.json" no changes
2025-01-01 18:37:13,986 | sd | DEBUG | modeldata | Model requested: fn=run:<lambda>
2025-01-01 18:37:13,986 | sd | INFO | sd_checkpoint | Load model: select="fantasy\corEpicaByZovya_v0Beta [fcf7d472d9]"
2025-01-01 18:37:13,986 | sd | INFO | sd_vae | Load module: type=VAE model="F:\ai\stable-diffusion\models\VAE\sdxl_vae.safetensors" source=settings config={'low_cpu_mem_usage': False, 'torch_dtype': torch.float16, 'use_safetensors': True, 'variant': 'fp16', 'config': 'configs/sdxl\\vae'}
2025-01-01 18:37:15,665 | sd | DEBUG | sd_models | Setting model: pipeline=StableDiffusionXLPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'extract_ema': True, 'config': 'configs/sdxl', 'use_safetensors': True, 'cache_dir': 'C:\\Users\\thoma\\.cache\\huggingface\\hub'}
2025-01-01 18:37:15,665 | sd | INFO | textual_inversion | Load network: type=embeddings loaded=0 skipped=0 time=0.00
2025-01-01 18:37:15,665 | sd | DEBUG | sd_models | Cache clear
2025-01-01 18:37:15,665 | sd | DEBUG | sd_models | Setting model: component=VAE name="sdxl_vae.safetensors"
2025-01-01 18:37:15,665 | sd | DEBUG | sd_models | Setting model: component=VAE slicing=True
2025-01-01 18:37:15,665 | sd | DEBUG | sd_models | Setting model: attention="Scaled-Dot-Product"
2025-01-01 18:37:15,696 | sd | INFO | sd_models_compile | Quantization: type=NNCF modules=['Model', 'VAE']
2025-01-01 18:37:46,614 | sd | DEBUG | devices | GC: current={'gpu': 3.92, 'ram': 7.18, 'oom': 0} prev={'gpu': 3.92, 'ram': 6.68} load={'gpu': 49, 'ram': 45} gc={'gpu': 0.0, 'py': 127} fn=apply_compile_to_model:nncf_compress_model why=force time=3.01
2025-01-01 18:37:48,885 | sd | DEBUG | devices | GC: current={'gpu': 1.07, 'ram': 7.69, 'oom': 0} prev={'gpu': 3.92, 'ram': 7.69} load={'gpu': 13, 'ram': 48} gc={'gpu': 2.85, 'py': 127} fn=apply_compile_to_model:nncf_compress_model why=force time=0.48
2025-01-01 18:37:49,876 | sd | DEBUG | devices | GC: current={'gpu': 1.23, 'ram': 7.76, 'oom': 0} prev={'gpu': 1.23, 'ram': 7.76} load={'gpu': 15, 'ram': 49} gc={'gpu': 0.0, 'py': 254} fn=apply_compile_to_model:nncf_compress_model why=force time=0.42
2025-01-01 18:37:50,386 | sd | DEBUG | devices | GC: current={'gpu': 1.07, 'ram': 7.85, 'oom': 0} prev={'gpu': 1.23, 'ram': 7.85} load={'gpu': 13, 'ram': 49} gc={'gpu': 0.16, 'py': 254} fn=load_diffuser:nncf_compress_weights why=force time=0.42
2025-01-01 18:37:50,386 | sd | INFO | sd_models_compile | Quantization: type=NNCF time=34.69
2025-01-01 18:37:50,396 | sd | DEBUG | sd_models | Setting model: offload=model limit=0.0
2025-01-01 18:37:50,456 | sd | DEBUG | shared | Read: file="F:\ai\stable-diffusion\sdnext\configs\sdxl\vae\config.json" json=15 bytes=643 time=0.000 fn=apply_vae_config:get_vae_config
2025-01-01 18:37:50,837 | sd | DEBUG | devices | GC: current={'gpu': 1.07, 'ram': 7.85, 'oom': 0} prev={'gpu': 1.07, 'ram': 7.85} load={'gpu': 13, 'ram': 49} gc={'gpu': 0.0, 'py': 67} fn=reload_model_weights:load_diffuser why=force time=0.37
2025-01-01 18:37:50,837 | sd | INFO | sd_models | Load model: time=total=36.48 options=34.73 load=1.25 vae=0.42 move=0.07 native=1024 memory={'ram': {'used': 7.85, 'total': 15.95}, 'gpu': {'used': 1.07, 'total': 8.0}, 'retries': 0, 'oom': 0}
2025-01-01 18:37:50,997 | sd | DEBUG | script_callbacks | Script callback init time: system-info.py:app_started=0.09 task_scheduler.py:app_started=0.45
2025-01-01 18:37:50,997 | sd | INFO | webui | Startup time: total=47.26 checkpoint=36.86 torch=2.64 launch=2.20 extensions=1.14 ui-extensions=0.97 ui-settings=0.67 app-started=0.55 ui-networks=0.38 ui-models=0.35 ui-txt2img=0.30 ui-control=0.28 ui-img2img=0.19 libraries=0.14 api=0.14 detailer=0.09 ui-defaults=0.09 ui-extras=0.06
2025-01-01 18:37:51,007 | sd | DEBUG | shared | Save: file="F:\ai\stable-diffusion\sdnext-configs\standard\config.json" json=41 bytes=2072 time=0.010
2025-01-01 18:38:00,015 | sd | DEBUG | launch | Server: alive=True requests=5 memory=7.86/15.95 status='idle' task='' timestamp=None id='' job=0 jobs=0 total=1 step=0 steps=0 queued=0 uptime=60 elapsed=46.03 eta=None progress=0
2025-01-01 18:38:28,086 | sd | ERROR | middleware | API error: POST: http://kathari.local:7860/agent-scheduler/v1/queue/txt2img {'error': 'AttributeError', 'code': 500, 'detail': '', 'body': '', 'errors': "'ResTxt2Img' object has no attribute 'override_settings'"}
2025-01-01 18:38:28,086 | sd | ERROR | errors | HTTP API: AttributeError
2025-01-01 18:38:36,375 | sd | INFO | webui | Exiting

Root Cause

This occurs because of the SD.Next API refactor (#2814), which changed the override_settings property of the ResImg2Img and ResTxt2Img classes to parameters.

Partial Workaround

Changing override_settings to parameters in extensions-builtin/sd-webui-agent-scheduler/agent_scheduler/task_runner.py and extensions-builtin/sd-webui-agent-scheduler/agent_scheduler/task_helpers.py allows you to add requests to the queue as expected.

Further Issues

Doing this will then cause the processing of those requests to fail with the error [AgentScheduler] Task 59a4dd21-df67-4e4d-87bf-4440eec439e9 failed: 'Api' object has no attribute 'text2imgapi'. This is because the static method text2imgapi was removed from modules/api/api.py -> class Api in the API refactor.

Example log excerpt after changing override_settings to parameters:

2025-01-01 18:32:16,377 | sd | WARNING | task_helpers | Checkpoint string not found, use current system model
2025-01-01 18:32:16,377 | sd | WARNING | task_helpers | VAE string not found, use current system vae
2025-01-01 18:32:16,385 | sd | INFO | task_runner | [AgentScheduler] Total pending tasks: 1
2025-01-01 18:32:16,389 | sd | INFO | task_runner | [AgentScheduler] Executing task 7a02e975-ff2d-446c-a08b-d40d16acbd13
2025-01-01 18:32:16,389 | sd | INFO | task_runner | <modules.api.api.Api object at 0x0000028A3E993BD0>
2025-01-01 18:32:16,393 | sd | ERROR | task_runner | [AgentScheduler] Task 7a02e975-ff2d-446c-a08b-d40d16acbd13 failed: 'Api' object has no attribute 'text2imgapi'
2025-01-01 18:32:16,397 | sd | DEBUG | task_runner | NoneType: None

2025-01-01 18:32:16,397 | sd | ERROR | helpers | [ArtVenture] Error while uploading result
2025-01-01 18:32:16,401 | sd | ERROR | helpers | 'NoneType' object is not subscriptable
2025-01-01 18:32:16,405 | sd | DEBUG | helpers | Traceback (most recent call last):
  File "F:\ai\stable-diffusion\sdnext\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\helpers.py", line 171, in request_with_retry
    res = make_request()
          ^^^^^^^^^^^^^^
  File "F:\ai\stable-diffusion\sdnext\extensions-builtin\sd-webui-agent-scheduler\agent_scheduler\api.py", line 75, in <lambda>
    images=result["images"],
           ~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

2025-01-01 18:32:16,405 | sd | INFO | task_runner | [AgentScheduler] Task queue is empty

Version Platform Description

Environment

  • Python version=3.11.7
  • platform=Windows
  • bin="F:\ai\stable-diffusion\sdnext\venv\Scripts\Python.exe"
  • venv="F:\ai\stable-diffusion\sdnext\venv"
  • Version: app=sd.next
  • updated=2025-01-01
  • hash=c4ecee3c
  • branch=master
  • url=git@github.com:vladmandic/automatic.git/tree/master
  • ui=dev

Platform

  • arch=AMD64
  • cpu=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
  • system=Windows
  • release=Windows-10-10.0.22631-SP0
  • python=3.11.7
  • docker=False

Packages

  • venv=venv
  • site=['venv', 'venv\Lib\site-packages']

Args

  • ['--data-dir', 'F:\\ai\\stable-diffusion\\sdnext-configs\\standard', '--listen', '--docs']

Torch overrides

  • cuda=False
  • rocm=False
  • ipex=False
  • directml=False
  • openvino=False
  • zluda=False

CUDA

  • CUDA: nVidia toolkit detected

Extensions

  • disabled=[]
  • enabled=['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg'] extensions-builtin
  • enabled=['sd-webui-mosaic-outpaint', 'ultimate-upscale-for-automatic1111'] extensions

URL link of the extension

https://github.com/ArtVentureX/sd-webui-agent-scheduler

URL link of the issue reported in the extension repository

SipherAGI/sd-webui-agent-scheduler#259

Acknowledgements

  • I have read the above and searched for existing issues
@DrakeRichards DrakeRichards added the extension Extension is not working correctly label Jan 2, 2025
@DrakeRichards
Copy link
Contributor Author

Using the "Enqueue" button in the "Standard" web UI does work as expected; this issue only applies to the API.

@vladmandic
Copy link
Owner

Expand the docs entry for /agent-scheduler/v1/queue/txt2img
Click "Try it Out"

this is not really a valid way to test api as it will populate fields based on what?
for any api issue, please provide simple curl statement.

anyhow, i've managed to trace it down, fix is included in latest update in dev branch.
note the minimal payload for agent-scheduler api request:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Extension is not working correctly
Projects
None yet
Development

No branches or pull requests

2 participants