sd-webui-discord icon indicating copy to clipboard operation
sd-webui-discord copied to clipboard

Multiple new features

Open ste-art opened this issue 10 months ago • 1 comments

This should be several different PRs, but I got a little carried away, so here all the changes.

Features

  • /preset command that applyes settings presets specified in config.json. Quite useful for swithing between SDXL and Lightning models that requires specific cfg_scale, steps and sampler. Also, it could be used for quick apply square/portrait/album image size.
  • Support FreeU and Self Attention Guidance, available in Forge-UI. /freeu and /sag commands for configuration. This feature only enabled if webui supports FreeU and SAG. If not - commands will not be added.
  • Added max load check to prevent huge requests like 2048x2048 x 100 steps x 4 images. Default limit is 65536 that equals to a single image 1024x1024 x 256 steps, or 2048x2048 x 64 steps, or 4 images 1024x1024 x 64 steps.

Small changes

  • Option filter now case-insensetive.
  • Added n_iter and seed values to the /settings command.

Bug fixes

  • The bot no longer recreates /lora-list and /cluster_status command on each lauch. Caused by extra space symbol in the description.
  • The bot no longer recreates commands that have options with minimum values. Caused by comparing pointer addresses instead of actual values.
  • It's no longer possible to set unlimited width, height and steps using /settings command. Also, all option constraints in /settings, /txt2imgand/img2img` are unified.
  • Fixed option filter - options no longer disappear when a filter tries to return more than 25 items.

Internal changes

  • Replaced DefaultSetting with StableConfig. They are grow bigger and it odd to have both of them with the same exact settings.

ste-art avatar Apr 13 '24 16:04 ste-art

This PR is broken currently:

2024/07/25 10:02:04 Adding/Updating commands...
2024/07/25 10:02:04 Cannot create 'txt2img' command: HTTP 400 Bad Request, {"message": "Invalid Form Body", "code": 50035, "errors": {"options": {"1": {"description": {"_errors": [{"code": "BASE_TYPE_BAD_LENGTH", "message": "Must be between 1 and 100 in length."}]}}}}}
panic: Cannot create 'txt2img' command: HTTP 400 Bad Request, {"message": "Invalid Form Body", "code": 50035, "errors": {"options": {"1": {"description": {"_errors": [{"code": "BASE_TYPE_BAD_LENGTH", "message": "Must be between 1 and 100 in length."}]}}}}}

goroutine 1 [running]:
log.Panicf({0xed8dbb?, 0x7?}, {0xc000049d18?, 0x0?, 0x0?})
        /usr/lib/go-1.22/src/log/log.go:439 +0x65
github.com/SpenserCai/sd-webui-discord/dbot.(*DiscordBot).SyncCommands(0xc000482050)
        /home/eidenz/sdwebuidiscord/dbot/handler.go:96 +0x565
github.com/SpenserCai/sd-webui-discord/dbot.(*DiscordBot).Run(0xc000482050)
        /home/eidenz/sdwebuidiscord/dbot/dbot.go:63 +0xc9
main.main()
        /home/eidenz/sdwebuidiscord/main.go:163 +0x458

I just pulled, built and tested. This is what I get when I have some default settings in config.

Eidenz avatar Jul 25 '24 10:07 Eidenz