AIrjen / OneButtonPrompt

One Button Prompt
GNU General Public License v3.0
825 stars 85 forks source link

OBP Forge issue: AttributeError: 'Group' object has no attribute 'update' #214

Open Jonseed opened 1 month ago

Jonseed commented 1 month ago

In SD Forge, when setting the dropdown to "custom" I get this error in the console, and no settings are shown in the UI:

File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\gradio\route_utils.py", line 285, in call_process_api
    output = await app.get_blocks().process_api(
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1923, in process_api
    result = await self.call_function(
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1508, in call_function
    prediction = await anyio.to_thread.run_sync(  # type: ignore
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "d:\repos\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 818, in wrapper
    response = f(*args, **kwargs)
  File "D:\repos\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 1122, in obppreset_changed
    + [maingroup.update(visible=True)]
AttributeError: 'Group' object has no attribute 'update'
AIrjen commented 1 month ago

Hi, thanks for reporting. It looks like Forge upgraded to gradio 4. The gradio code that One Button Prompt uses, seems to be deprecated in version 4. I will have a look into this, to see if I can make something that works both in Gradio 3 (A1111 etc) and Gradio 4. Not sure if thats possible.

I am quite busy at home right now, so I can't commit to timeline of addressing this issue.

AIrjen commented 1 month ago

Update: I know how to fix it. It's a time consuming change. Basically, I have to rewrite much of the Gradio stuff so it works on both Gradio 3 and 4. It's next on my todo list! I want to play around with Flux as well in forge ;)

I'll give update progress here, but I am not sure when I will have enough time.

RalFingerLP commented 1 month ago

Thank you for considering the update, appreciate it!

Jonseed commented 3 weeks ago

So, for those who might wonder, the extension still works in Forge, you just can't currently change any of the settings from the UI. But you can adjust the settings in the JSON file in /userfiles/obp_presets.json. I've been testing out Flux with OBP, and it is pretty great.

AIrjen commented 2 weeks ago

Hi everyone, I have been away for a while and development has thus been slow (and will be for a bit sorry!)

For now, I have spend some time on the Gradio4 move. There is a branch for this. The code is working on the old WebUI environment (which is on gradio 3), but it still doesn't work on Forge.

It is now getting this error message: File "copy.py", line 206, in _deepcopy_list File "copy.py", line 172, in deepcopy File "copy.py", line 271, in _reconstruct File "copy.py", line 146, in deepcopy File "copy.py", line 231, in _deepcopy_dict File "copy.py", line 172, in deepcopy File "copy.py", line 271, in _reconstruct File "copy.py", line 146, in deepcopy File "copy.py", line 231, in _deepcopy_dict File "copy.py", line 172, in deepcopy File "copy.py", line 271, in _reconstruct File "copy.py", line 146, in deepcopy File "copy.py", line 231, in _deepcopy_dict File "copy.py", line 161, in deepcopy TypeError: cannot pickle '_thread.lock' object

so basically where I am at is:

If anyone recognized this, please let me know :D