ArtVentureX / sd-webui-agent-scheduler

605 stars 61 forks source link

Latest update causes runtime errors on image save #170

Open vladmandic opened 8 months ago

vladmandic commented 8 months ago

commit https://github.com/ArtVentureX/sd-webui-agent-scheduler/commit/c32395e42a6095db79ad6715e28d578984a6c89f creates an error:

│ /home/vlado/dev/sdnext-master/extensions-builtin/sd-webui-agent-scheduler/agent_scheduler/task_runner.py:524 in __on_image_saved                                                                     │
│                                                                                                                                                                                                      │
│   523 │   def __on_image_saved(self, data: script_callbacks.ImageSaveParams):                                                                                                                        │
│ ❱ 524 │   │   if data.filename.startswith(data.p.outpath_grids):                                                                                                                                     │
│   525 │   │   │   self.__saved_images_path.insert(0, data.filename)

note that there is no data.p.outpath_grids, there is data.outpath_grids - ImageSaveParams object does not have p as its member! and even that is not guaranteed to exist, so access should be optional.

@tungnguyensipher

artventuredev commented 8 months ago

Understood. I saw p in ImageSaveParams and assumed it was still in use, similar to A1111. I've just pushed a fix for this issue.

image image

Additionally, I observed that window.submit has been changed to window.submit_txt2img, and I've implemented a fix for this as well.

vladmandic commented 8 months ago

re: submit, old one still exists, so you don't need special handler sdnext/a1111.

const submit = submit_txt2img;

re: p - issue with adding p to imagesaveparams is that p only exists during generate itself. but if image is not saved during generate (so it goes to /tmp/gradio/) and user uses save button later, there is no p object to use at all.