Code Monkey home page Code Monkey logo

sd-webui-stable-horde-worker's Introduction

SD WebUI ❤️ Stable Horde

python issues pr license Lint

Stable Horde Worker Bridge for Stable Diffusion WebUI

An unofficial Stable Horde worker bridge as a Stable Diffusion WebUI extension.

Features

This extension is still WORKING IN PROGRESS, and is not ready for production use.

  • Get jobs from Stable Horde, generate images and submit generations
  • Configurable interval between every jobs
  • Enable and disable extension whenever
  • Detect current model and fetch corresponding jobs on the fly
  • Show generation images in the Stable Diffusion WebUI
  • Save generation images with png info text to local

Install

  • Run the following command in the root directory of your Stable Diffusion WebUI installation:

    git clone https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git extensions/stable-horde-worker
  • Launch the Stable Diffusion WebUI, You would see the Stable Horde Worker tab page.

    settings

  • Register an account on Stable Horde and get your API key if you don't have one.

    Note: the default anonymous key 00000000 is not working for a worker, you need to register an account and get your own key.

  • Setup your API key here.

  • Setup Worker name here with a proper name.

  • Make sure Enable is checked.

  • Click the Apply settings buttons.

Compatibility

Here is the compatibilities with the official bridge.

Features Supported?
img2img ✔️
Inpainting ✔️
Interrogate
Tiling ✔️
Hi-res Fix ✔️
Clip Skip
Face Restoration (GFPGAN) ✔️
Upscale (ESRGAN) ✔️
Sample Karras Scheduler ⭕*
R2 upload ✔️
R2 source image
Multiple Models ✔️

* Karras scheduler is partially supported in SD-WebUI Bridge, see below.

Samplers Official Bridge SD-WebUI Bridge
No Karras Karras No Karras Karras
k_lms ✔️ ✔️ ✔️ ✔️
k_heun ✔️ ✔️ ✔️ ✔️
k_euler ✔️ ✔️ ✔️ ✔️
k_euler_a ✔️ ✔️ ✔️ ✔️
k_dpm_2 ✔️ ✔️ ✔️ ✔️
k_dpm_2_a ✔️ ✔️ ✔️ ✔️
k_dpm_fast ✔️ ✔️ ✔️ ✔️
k_dpm_adaptive ✔️ ✔️ ✔️ ✔️
k_dpmpp_2s_a ✔️ ✔️ ✔️ ✔️
k_dpmpp_2m ✔️ ✔️ ✔️ ✔️
k_dpmpp_sde ✔️ ✔️ ✔️ ✔️
dpmsolver ✔️ ✔️
ddim ✔️
plms ✔️

License

This project is licensed under the terms of the AGPL-3.0 License.

sd-webui-stable-horde-worker's People

Contributors

gabriel20xx avatar jmsether avatar maeyanie avatar maikotan avatar prodigy avatar theupsider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sd-webui-stable-horde-worker's Issues

[Bug]: "Save Images" saves correctly but always loads as false in the UI but works anyway

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

I check off Save Images. I Apply Settings. I look at the config.json. It is correct. The next time I start A1111 the checkbox is not checked. I look at the config again. It is correct. I look at the file system and verify the The worker is saving images. It is. I Apply Settings. I look at the config. It saved the setting as false (as indicated in the UI but not reflecting the current behavior).

Current work around: I check it off every time I start up because I don't want it false in the config.

Steps to reproduce

No response

What did you expect to happen?

UI is correct

Stable Diffusion WebUI Commit SHA

https://google.com/search?q=b4391b7978d973427a4a2a3ed0e67b18ebe34e213904575043d6c9faec75c22d

What operating system are you seeing the problem on?

macOS

What browsers are you seeing the problem on?

Other

Additional information

Tested in both Safari and Chrome.

validation error: ldsr cached

raise ValidationError(errors, field.type_)
pydantic.error_wrappers.ValidationError: 1 validation error for Options
response -> ldsr_cached
value is not None (type=type_error.not_none)

[Bug]: Model not found on StableHorde

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

No matter what model I try to use, the script calculates the md5sum, and says that it's not supported by StableHorde. I've tried 1.5 (ckpt), deliberate_v1 (ckpt, safetensors) and deliberate_v2 (safetensors).

Steps to reproduce

No response

What did you expect to happen?

I believe the "not supported by Stable Horde" message shouldn't be there, as the model is clearly being used by the horde, according to https://aqualxx.github.io/stable-ui/dashboard

Stable Diffusion WebUI Commit SHA

0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox, Chrome

Additional information

No response

[Bug]: Sygil-Dev no longer the source for nataili

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

https://github.com/Sygil-Dev/* is no longer the canonical repo for nataili or related projects.

Please refer to the repos found at https://github.com/db0/nataili and https://github.com/db0/AI-Horde-image-model-reference for now.

Steps to reproduce

No response

What did you expect to happen?

See above.

Stable Diffusion WebUI Commit SHA

0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What operating system are you seeing the problem on?

Other

What browsers are you seeing the problem on?

Other

Additional information

Please come to the official discord or message db0 for more information.

[Bug]: model references `db.json` would be outdated

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

The model references db.json we downloaded from https://raw.githubusercontent.com/Sygil-Dev/nataili-model-reference/main/db.json didn't get updates after downloading, which causes the model hash conflict like #55

Steps to reproduce

  1. Run the extension
  2. Ignore it several days or months after stable horde updated their db.json
  3. Still able to use the old model!

What did you expect to happen?

Update the db.json file correspondingly

Stable Diffusion WebUI Commit SHA

any

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Chrome

Additional information

No response

[Feature]: add maintenance mode switch

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

The maintenance mode was not implemented on our side.

Proposed Solution

Add a checkbox "Maintenance mode".

Additional Information

No response

[Bug]: in on_app_started, run_until_complete(horde.run()) blocks, prevents other startup callbacks

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Firing up AUTOMATIC1111 webui with this extension installed breaks other modules that depend on on_app_started callbacks by preventing them from running at all.

Civitai’s helper and others fail to register their APIs completely, for example.

I’m not familiar enough with Python’s async to triage what the bug is: it looks like the invocation of loop.run_until_complete does indeed expect a coroutine object which is returned as a result of invoking an async def method (so () on a function with an infinite loop itself is not a bug, it seems), so it must be that horde.run() with its infinite loop is waited on until the never-going-to-happen completion.

This bug is particularly insidious, because it doesn’t reveal the extent of breakage in the webUI, because the UI starts to work even before startup is done. It’s just that other extensions look half broken.

Steps to reproduce

  1. Install the worker extension.
  2. Observe how the “Startup time: 11.6s (import torch:…” line never appears, indicating app_started_callback loop never completed.

What did you expect to happen?

The mere presence of the extension does not prevent initialization of other extensions.

Stable Diffusion WebUI Commit SHA

baf6946e06 (tag v1.3.2)

What operating system are you seeing the problem on?

Debian / Ubuntu

What browsers are you seeing the problem on?

Chrome

Additional information

No response

[Bug]: module 'modules.txt2img' has no attribute 'StableDiffusionProcessingTxt2Img'

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

It worked a day or two ago. I updated as usual and ran it tonight, I get this, it just repeats indefinitely.

Traceback (most recent call last):
File "/Users/timshea/work/A1111-horde/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 202, in run
await self.handle_request(req)
File "/Users/timshea/work/A1111-horde/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 353, in handle_request
p = txt2img.StableDiffusionProcessingTxt2Img(**params)
AttributeError: module 'modules.txt2img' has no attribute 'StableDiffusionProcessingTxt2Img'

Steps to reproduce

pull the latest A1111 and extension. Run it. Enable the horde worker.

What did you expect to happen?

worker ext to accept and process stable horde jobs

Stable Diffusion WebUI Commit SHA

latest as of the date of this issue creation

What operating system are you seeing the problem on?

macOS

What browsers are you seeing the problem on?

Other

Additional information

Not a browser issue. Running from shell (zsh).

Feature: model switching

Summary

Currently users should switch the model manually, which would lead to error.

Solution

Support auto switching models from payload, based on #2 , UI based on #10

[Bug]: Unknown sampler k_dpmpp_sde_ka

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Traceback (most recent call last):
File "/home/user/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 198, in run
await self.handle_request(req)
File "/home/user/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 303, in handle_request
raise Exception(f"ERROR: Unknown sampler {sampler_name}")
Exception: ERROR: Unknown sampler k_dpmpp_sde_ka

Steps to reproduce

No response

What did you expect to happen?

No error

Stable Diffusion WebUI Commit SHA

463d6a9fe8a4b56a4d69ef3692074c0617428dfd8e8f12f9efe3b1e9a71717ce

What operating system are you seeing the problem on?

Windows 11 / 10 / 8, Debian / Ubuntu

What browsers are you seeing the problem on?

Firefox, Chrome

Additional information

No response

[Bug]: Stable Horde hasnt been working for days

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

https://aqualxx.github.io/stable-ui/

Its 'Models' have been 'Down' for me for days, So i havent been able to generate anything. Is this a bug? Is it updates being performed? Can someone help me pls? Ty.

I dont know where the Stable Diffusion WebUI Commit SHA is on that website.

Steps to reproduce

No response

What did you expect to happen?

---------

Stable Diffusion WebUI Commit SHA

I cant find it because its made so hard to find

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox

Additional information

---------

[Bug]: "Save Images" saved wrong model name

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

After adding the multiple models support, the "Save Images" function saves wrong model information with current model name instead of the request model name.

Steps to reproduce

1.Go to the Stable Horde Worker tag on webui, check the status on coming request in the Preview.
It will show information like "Get popped generation id, model Anything v3, sampler k_euler_a"
We can get the information about the request model name, which is model "Anything v3" here.

2.Go check the saved image information, use any image browser extensions or even any text editors.
We can get the information about saved model name, which is model "model_1_5" here which was my current Stable Diffusion checkpoint(default model).

I have checked it with different requests ,and also changing the default model, the model info saved always be the default model name.

What did you expect to happen?

Please fix it with the actual model name

Stable Diffusion WebUI Commit SHA

0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What operating system are you seeing the problem on?

Debian / Ubuntu

What browsers are you seeing the problem on?

Chrome

Additional information

Request model name in Preview
Screenshot from 2023-03-08 12-41-01

Saved model name
Screenshot from 2023-03-08 12-42-06

[Feature]: Add hires_fix and clip_skip feature

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

Stable Horde side produced these feature that sd-webui could support with small changes.

Should also bump the version to 3 as well.

Proposed Solution

Add hires_fix parameters in the processing progress, and change clip_skip on the fly.

Additional Information

Haidra-Org/AI-Horde#172

Add bridge_agent

The Horde now requests that you send bridge_agent key when using /api/v2/generate/pop. Please check the API doc.

Also in horde terminology, what you have is a "bridge", not a worker.The worker is where the inference runs (in this case a1111), whereas the "bridge" is what communicates between horde and worker. So a more accurate name would be "Stable Horde Worker Bridge for Stable Diffusion WebUI" or just "Stable Horde Bridge for Stable Diffusion WebUI"

[Bug]: Values in ui_config.json override values in worker's config

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Somehow, I got the values for UI elements for Stable Horde Worker saved in $WEBUI_ROOT/ui_config.json.

    "stable-horde//visible": true,
    "stable-horde//value": "Status: Stopped",
    "stable-horde/Apply Settings/visible": true,
    "stable-horde/Enable/visible": true,
    "stable-horde/Enable/value": false,
    "stable-horde/Worker Name/visible": true,
    "stable-horde/Worker Name/value": "my-old-name",
    "stable-horde/Stable Horde API Key/visible": true,
    ...

These did not get updated when I applied the config in worker tab itself, so the worker would load with the correct config out of $WEBUI_ROOT/extensions/sd-webui-stable-horde-worker/config.json.

At first I thought this could be stable-diffusion-webui-state extension, but then I realized that it might be me using the "Extensions" tab and hitting "Save" to preserve the current state.

Or it might not require hitting "Save": I have even ctrl+c'd the webui and ui_config.json got populated with the new values.

Maybe I was somehow holding the tool wrong (though I am not sure how I did it), but it seems like either the worker config's UI elements should be excluded from being saved in the extension configuration, or maybe worker should not keep its own configuration unmanaged by the core of AUTOMATIC1111's webuI?

Again, I am not sure how those landed up there -- but the old values being present there meant any time I entered new information (such as the worker name) the config would get overwritten with old information.

This issue means it's hard to modify the currently active configuration -- and it's really easy to save the old one.

For bonus points: I can't reproduce now, but looks like maybe something in my setup (maybe it's in the default setup, maybe it's Safari) is sometimes also restoring the UI state from the browser, not just from the .json file.

Steps to reproduce

  1. Open ui-config.json
  2. Add "stable-horde/Worker Name/value": "some-bad-name-override", ensuring the value doesn't match what's in the extension'sconfig.json. Same for other values, in particular ` "stable-horde/Enable/value": false,
  3. Start UI: note that the worker name from extension's config.json is respected during registration, as is the enabled flag.
  4. Open UI in the browser: visit the horde worker's tab, and observe how the values match what's in ui_config.json and not what's in use by the extension.

What did you expect to happen?

The currently active configuration is displayed, rather than the old one that got saved into ui_config.json. Anything browser may try to populate in the fields on page open / reload should be discarded and fields should be populated solely by the currently active configuration (or, at the very least, contents of the extension's config.json).

Stable Diffusion WebUI Commit SHA

AUTOMATIC1111/stable-diffusion-webui@baf6946

What operating system are you seeing the problem on?

Debian / Ubuntu

What browsers are you seeing the problem on?

Other

Additional information

No response

[Bug]: Img2Img seems to ignore source image

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Source
image
AI Horde Worker | Webui
image

It seems this worker seems to ignore the source image in img2img. I am going to have to disable sending img2img to these workers until this is fixed.

Steps to reproduce

generate an img2img on the horde and send to the webui worker

What did you expect to happen?

The source image should be used

Stable Diffusion WebUI Commit SHA

All

What operating system are you seeing the problem on?

Other

What browsers are you seeing the problem on?

Other

Additional information

No response

Need to know

How can I see what is generated ? I see the text in my console, but the images are nowere on my computer, how can I see them ? It would be usefull to report a user generating bad things for exxemple.

[Bug]:

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

On startup from stable diffusion, this error occurs:
To create a public link, set share=True in launch().
Error executing callback app_started_callback for E:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\scripts\script.py
Traceback (most recent call last):
File "E:\StableDiffusion\stable-diffusion-webui\modules\script_callbacks.py", line 108, in app_started_callback
c.callback(demo, app)
File "E:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\scripts\script.py", line 18, in on_app_started
gradio.utils.synchronize_async(horde.run)
AttributeError: module 'gradio.utils' has no attribute 'synchronize_async'

Startup time: 25.2s (import torch: 8.3s, import gradio: 1.3s, import ldm: 0.8s, other imports: 2.0s, scripts before_ui_callback: 5.4s, create ui: 7.0s, gradio launch: 0.2s)

Stable horde worker is not working

Steps to reproduce

No response

What did you expect to happen?

There should be no error and stable horde worker should be working

Stable Diffusion WebUI Commit SHA

5ab7f213

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox, Chrome

Additional information

No response

[Feature]: Reject requests based on sampling steps

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

I know what my system is capable of delivering on time. And when a request at my max reasonable resolution comes in with 100+ sampling steps there's no way it's going to get done in the ~3 minute limit enforced by the horde. So the resulting images get rejected with

"Failed to submit job with status code400: Processing Generation with ID some-guid took too long to process"

There's no point in processing these requests.

The desired feature is to set a max step count in the extension settings.

Proposed Solution

The desired feature is to set a max step count in the extension settings.

Requests popped over that limit get rejected or simply discarded if there is no rejection support in the API.

Alternatively, such requests would simply have the step count reduced to the set limit.

Additional Information

No response

[Bug]: Receiving no jobs

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Steady jobs up to yesterday. None today. Posted issue to stable UI GitHub, they said it's working fine and suggesting the issue is use of an out of date API. I have not way to test this.

Latest commit.

Steps to reproduce

Run A1111 with ext.

What did you expect to happen?

It works.

Stable Diffusion WebUI Commit SHA

latest I update before every run

What operating system are you seeing the problem on?

macOS

What browsers are you seeing the problem on?

Other

Additional information

No response

[Feature]: Add warning about Stable Horde logging prompts and generations

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

The logo of this project,

indicates that generating anime images is considered an expected use.

I'd suggest adding an explicit warning that, contrary to the intuitions one might have about free and open source programs, Stable Horde is designed to make malicious changes to your inputs and log your prompts, as documented in this blog post from the developer, along with the ostensible justification ("think of the children!") specifically noting its use against images in the anime style.

Proposed Solution

  • Add something like ⚠️ Stable Horde logs your prompts and might report to you to the FBI if the developer decides your favored art style makes you a "pedo"

Additional Information

See this thread, where the developer (u/dbzer0/) calls anyone concerned about privacy "fash"

[Bug]: Unknown sampler k_dpmpp_2s_a_ka

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Traceback (most recent call last):
File "/home/user/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 198, in run
await self.handle_request(req)
File "/home/user/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 303, in handle_request
raise Exception(f"ERROR: Unknown sampler {sampler_name}")
Exception: ERROR: Unknown sampler k_dpmpp_2s_a_ka

Steps to reproduce

No response

What did you expect to happen?

No error

Stable Diffusion WebUI Commit SHA

463d6a9fe8a4b56a4d69ef3692074c0617428dfd8e8f12f9efe3b1e9a71717ce

What operating system are you seeing the problem on?

Windows 11 / 10 / 8, Debian / Ubuntu

What browsers are you seeing the problem on?

Firefox, Chrome

Additional information

No response

[Feature]: Add `r2_source` feature

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

It looks like all source_image in the response JSON would become an HTTP link rather than the base64 string, when supporting this feature.

Also see: Haidra-Org/AI-Horde#172

Proposed Solution

Download the source_image rather than use b64decode to decode the image.

Additional Information

No response

[Bug]: Hash check fails with uppercase hash

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Some of the model hash's in https://github.com/Haidra-Org/AI-Horde-image-model-reference/blob/main/stable_diffusion.json are all uppercase, these models always say that they are not supported, even if the hashes are correct (I checked myself). There are a bunch of models which have capitalised hashes, you can see by just scrolling down the file. I have tested this with 2 models randomly chosen to test that this was my problem. I randomly chose the model used in the steps below.

Steps to reproduce

  1. Download Hassaku model from the link provided in stable_diffusion.json
  2. Confirm hash matches the hash provided in stable_diffusion.json which is D3CD6...
  3. Run Auto1111
  4. Go to "Stable Hoard Worker" tab
  5. Select hassakuHentaiModel_v12.safetensors in "Selected models for sharing"
  6. Console says sha256 for hassakuHentaiModel_v12.safetensors is d3cd6ac55ae99c4848af5bde90b47306b17ee0a3a7b1aff4a7187284d3cdbf0e but it's not supported by StableHorde even though, that is the hash that is in stable_diffusion.json as shown in step 2

What did you expect to happen?

The model detects as supported as the other models do and says it is supported. The steps below are just copied from above, with the message on step 6 manually changed.

  1. Download Hassaku model from the link provided in stable_diffusion.json
  2. Confirm hash matches the hash provided in stable_diffusion.json which is D3CD6...
  3. Run Auto1111
  4. Go to "Stable Hoard Worker" tab
  5. Select hassakuHentaiModel_v12.safetensors in "Selected models for sharing"
  6. Console says sha256 for hassakuHentaiModel_v12.safetensors is d3cd6ac55ae99c4848af5bde90b47306b17ee0a3a7b1aff4a7187284d3cdbf0e and it's supported by StableHorde

Stable Diffusion WebUI Commit SHA

68f336bd994bed5442ad95bad6b6ad5564a5409a

What operating system are you seeing the problem on?

Other Linux

What browsers are you seeing the problem on?

Firefox

Additional information

I changed https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker/blob/master/stable_horde/horde.py#L139 to if local_hash.casefold() in (hash345.casefold() for hash345 in remote_hashes): (the number is because hash was already taken, and I couldn't be bothered finding a better name) to see if that solved the problem, but I just got an exception on the next line, and as someone who is not a python programmer, that was then outside my abilities.

[Feature]: Report faulted state to horde server

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

Since horde implement their state tracking for faulted jobs, we could now report a faulted state to the server.

see: Haidra-Org/AI-Horde#147

Proposed Solution

  1. add "state": "faulted" into the payload.

Additional Information

No response

[Feature]: Onboard the Anti-CSAM filter

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

Currently the AI Horde Worker relies on a custom builtm, anti-CSAM filter to prevent people abusing the service and protect the workers. It relies on using clip. The implementation is here: https://github.com/db0/AI-Horde-Worker/blob/main/worker/csam.py

It should be ported here as well.

Proposed Solution

Reimplement: https://github.com/db0/AI-Horde-Worker/blob/main/worker/csam.py

Additional Information

No response

[Bug]: Sampler problem ?

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

It was running fast yesterday, since the update of automatic's 1111 GUI it's dead sending error :

Traceback (most recent call last):
  File "C:\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 153, in run
    await self.handle_request(req)
  File "C:\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 221, in handle_request
    self.patch_sampler_names()
  File "C:\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 164, in patch_sampler_names
    from modules.sd_samplers import KDiffusionSampler, SamplerData
ImportError: cannot import name 'KDiffusionSampler' from 'modules.sd_samplers' (C:\stable-diffusion-webui\modules\sd_samplers.py)

To be sure I re-installed hord worker but nothing change. This may have to do with recent update on automatic1111 side.

Steps to reproduce

Install the extension, configure it, and watch the error popping for each request.

What did you expect to happen?

Nothing special, just the extension working like yesterday.

Stable Diffusion WebUI Commit SHA

ab059b6e4863eaa5e118a2043192584e6df51ed4

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

Additional information

No response

RFC: migrate to use custom tab page

Summary

The extension now has multiple actions that should not be on the settings page, which makes users confused.
I think it is better to have a dedicated tab page for our extension.

Imagine

Title: Stable Horde

Layout:

---------------------------------------------------------------------
| Current State: Running | Worker Type: Generation | Apply Settings |
|-------------------------------------------------------------------|
| [x] Enable                         |  Current ID: xxxx-xxxxxxxx   |
| [x] Maintainance Mode              |  [x] Show Image              |
| [x] Allow img2img                  |                              |
| [x] Allow inpainting               |                              |
| [x] Allow Unsafe IP Address        |        Current Image         |
|------------------------------------|                              |
|  Model Selection                   |------------------------------|
|------------------------------------|           Prompt             |
|  [x] Anything Diffusion            |                              |
|      Unknown Model                 |                              |
---------------------------------------------------------------------

[Bug]: re.error: bad escape \m at position 8 in console

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

error after starting, after every generation in console:

Traceback (most recent call last):
 File "D:\SD\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 202, in run 
await self.handle_request(req)
 File "D:\SD\stable-diffusion-webui\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 435, in handle_request 
infotext = sub(
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 209, in sub 
return _compile(pattern, flags).sub(repl, string, count)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 326, in _subx 
template = _compile_repl(template, pattern)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\re.py", line 317, in _compile_repl 
return sre_parse.parse_template(repl, pattern)
 File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\sre_parse.py", line 1054, in parse_template
raise s.error('bad escape %s' % this, len(this)) re.error: bad escape \m at position 8

Steps to reproduce

just Enable

What did you expect to happen?

no errors in console and work

Stable Diffusion WebUI Commit SHA

22bcc7be428c94e9408f589966c2040187245d81

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Chrome

Additional information

I managed to fix it just by commenting out these lines in horde.py:

#        infotext = sub(
#            "Model:(.*?),", "Model: " + local_model.split(".")[0] + ",", infotext
#        )
#        infotext = sub(
#            "Model hash:(.*?),", "Model hash: " + local_model_shorthash + ",", infotext
#        )

after that everything worked

[Feature]: Expose User Kudos int he extension UI.

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

As an API key user I want to see my current kudos balance.

Maybe a button for a popup with all the user's info from the API.

I am blind to how many kudos I have.

Proposed Solution

Maybe a button for a popup with all the user's info from the API.

Additional Information

I see in the API docs that the api key user's kudo count can be requested, but I don't know how to call it manually. It would be great if this UI called that endpoint and put it onscreen.

An explanation of how to call this myself (wget? postman?) would be a workaround I can live with.

FWIW, It's not shown in the client extension either.

About Adding License

Summary

It would be better to have a license for this repository.

But since we have copied images from natali which has an AGPL license, I am not sure whether or not should we use the same license as well.

Personally I would prefer MIT license though.

[Bug]: Unknown sampler k_lms_ka

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

while running the extension got this error in the console:

Exception: ERROR: Unknown sampler k_lms_ka
Traceback (most recent call last):
File "D:\stable-diffusion-webui_v1.9.3\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 198, in run
await self.handle_request(req)
File "D:\stable-diffusion-webui_v1.9.3\extensions\sd-webui-stable-horde-worker\stable_horde\horde.py", line 303, in handle_request
raise Exception(f"ERROR: Unknown sampler {sampler_name}")

Steps to reproduce

run the extention

What did you expect to happen?

it would like some advice so I can run the worker without being put into maintenance mode for dropping requests

Stable Diffusion WebUI Commit SHA

1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Chrome

Additional information

No response

[Feature]: Delay Horde poll when a non-Horde job is already running

Is there existing issue for this?

  • I didn't find similar issue, also checked the latest commit.

Feature Description

I've noticed the Horde poll will happen after the configured delay time from the previous submission, even if a local job submitted through the Web UI is running at the time.
When we're busy ideally it would be better to let another worker handle the request if one is available, and if the local render is particularly long it can even result in the job giving a timed-out error when it's eventually completed and submitted.

Proposed Solution

The simplest and most effective way would probably be, when the timer expires, check if the WebUI is idle. If it isn't, restart the timer instead of polling.

Additional Information

No response

[Bug]: NSFW filter censors everything

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Changed to not allow NSFW but then everything gets censored.

For example this prompt easter bunny with a easter egg with the Bitcoin logo, ((realistic)), ((RTX)), highres, ((photorealistic)), dreamlikeart got censored with the black "NSFW content detected and the client requested it to be blocked".

I have tried several images now but everything gets blocked. I get the black censor sometimes when NSFW is allowed as well but I assume that's because the client actually requested it.

Steps to reproduce

No response

What did you expect to happen?

Not accept prompts from stable horde with NSFW words in them.

Stable Diffusion WebUI Commit SHA

22bcc7be428c94e9408f589966c2040187245d81

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox

Additional information

sd-webui-stable-horde-worker commit hash a3e67b5

Only using standard extensions and sd-webui-controlnet.

[Bug]: No works. Here is error

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

Imagine my sad face when I see this stack filling my console again and again until Python crashes.

Traceback (most recent call last):
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 194, in run
    req = await HordeJob.get(
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/job.py", line 221, in get
    req = await r.json()
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://stablehorde.net/api/v2/generate/pop')

Steps to reproduce

install latest version of ext (i.e. this). Enable the worker ext. Exit and re-run A1111.

Can't tell if problem is with the ext, A1111, or the horde API itself. I use a script to launch A1111 than enables the worker in the ext config.json and then pulls the latest from the A1111 and all extension repos, then launches A1111 itself.

Traceback (most recent call last):
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/horde.py", line 194, in run
    req = await HordeJob.get(
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/extensions/sd-webui-stable-horde-worker/stable_horde/job.py", line 221, in get
    req = await r.json()
  File "/Users/userguy/work/somefolder/stable-diffusion-webui/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://stablehorde.net/api/v2/generate/pop')

What did you expect to happen?

It works as usual. Lots of joy. Now, no joy.

Stable Diffusion WebUI Commit SHA

latest as of the date-time of this issue.

What operating system are you seeing the problem on?

macOS

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge, Other

Additional information

Not a browser issue. Launching from shell. Don't even open the browser.
I have over 1/2 million kudos thanks to this ext so It definitely has worked great most of the time!

How does this work ?

I installed stable diffusion webui stable horde and created an account, inputed my key, but nothing is happenning. How do I know if the client is connected, receiving work or anything ?

All I got is : firefox_23-01-24 15-36(242)

I don't need to use the horde to generate and wanted my pc to be used for the horde. Do I need to install the hord software in addition to automatic's webui ?

Bug: Exception `Unknown sampler k_dpm_fast_ka`

Summary

Traceback (most recent call last):8it/s]
  File "E:\repo\diffusions\stable-diffusion-webui\extensions\stable-horde\stable_horde.py", line 330, in run
    await self.handle_request(req)
  File "E:\repo\diffusions\stable-diffusion-webui\extensions\stable-horde\stable_horde.py", line 375, in handle_request
    raise Exception(f"ERROR: Unknown sampler {sampler_name}")
Exception: ERROR: Unknown sampler k_dpm_fast_ka

Solution

Add "DPM fast Karras" sampler into sd_samplers

[Bug]: hash changes - model not found on StableHorde

Is there existing issue for this?

  • I checked and didn't find similar issue

Does this happen on the latest commit?

  • I have confirmed this happens on the latest commit

What happened?

new model hashing system not recognized by SDHordeWorker. no errors in terminal

Steps to reproduce

on cc8c9b7 of webui,

infobox shows: Current model Anything-V3.0-pruned.ckpt [543bcbc212] not found on StableHorde

using da0e8e8 of this extension

using an older version of webui - 9cfd10cde (Jan 11) still works with this model, on current extension version

What did you expect to happen?

connection success

Stable Diffusion WebUI Commit SHA

cc8c9b7

What operating system are you seeing the problem on?

Windows 11 / 10 / 8

What browsers are you seeing the problem on?

Firefox

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.