×
Login Register an account
Top Submissions Explore Upgoat Search Random Subverse Random Post Colorize! Site Rules Donate
5

How to hack the worker for HordeAI to store what it generates for other users

submitted by puremadness to AI 6 monthsOct 21, 2024 05:36:56 ago (+5/-0)     (github.com)

https://github.com/Haidra-Org/AI-Horde/blob/main/README_StableHorde.md#joining-the-horde

Ok, so the horde thing is basically stable diffusion but the users pay kudos to workers who generate the images.
idk wtf you can do with kudos other than use them for hordeAI, so probably useless.

Anyway you can get them for free by letting your machine act as a worker.
on the horde FAQ, they mention its technically possible with some "know how" for a worker to save those images.

So here's how to do it:
- follow link, install the worker, run all the python shit to set it up
- register (no email needed, just pick a name) and get a api key
- pop that key into the config xml file
- follow the configuration section to determine what to allow,etc
- get it up and running
- ctrl-c to stop it

find the file: horde_worker_regen\process_management\process_manager.py
- open it text editor
- goto line 12, get a new line and enter this:

from time import gmtime, strftime

- goto line 2412, get a new line and enter this:

jb = strftime("%Y%m%d_%H-%M-%S", gmtime())
image_as_pil.save("hordespy\\"+jb+"_buffer.webp",format="WebP",quality=95,method=6)
logger.info(f"||||||Stored -> hordespy\\{jb}{'_buffer.webp'}")`

- start the worker back up
- create the subfolder "hordespy"
- watch it fill up with images generated by users of the horde ai network


15 comments block


[ - ] MaryXmas 0 points 6 monthsOct 23, 2024 06:45:36 ago (+0/-0)

So what are the images? Just porn?

[ - ] puremadness [op] 0 points 6 monthsOct 23, 2024 12:23:05 ago (+0/-0)

no, mostly bad ai art attempts, some people use it to illustrate the LLM story output.
You can turn the filters on and off for things like NSFW output.

Also looks like lots of folks trying to generate gaza children in sad scenes

[ - ] MaryXmas 0 points 6 monthsOct 23, 2024 14:18:58 ago (+0/-0)

Hmm, maybe so they can make propaganda? Sounds like it.

[ - ] puremadness [op] 1 point 6 monthsOct 23, 2024 16:11:13 ago (+1/-0)

yea theres a shocking number of images that do seem to be generated for agitprop.

[ - ] SmokeyMeadow 1 point 6 monthsOct 24, 2024 16:33:51 ago (+1/-0)

I got the worker going, but could not do the hordespy edit to work. It seems like there's something wrong with how I entered the line 2412 part. Can you upload your process_manager.py?

[ - ] puremadness [op] 1 point 6 monthsOct 25, 2024 01:36:21 ago (+1/-0)*

Sure, lemme find somewhere to plop it

for the moment,
the part in-between red is all we have to add
I started on the line after 2412

https://i.imgflip.com/97vbrk.jpg

The rest outside the red lines can stay so no other part of the program is affected.

whole file https://ufile.io/q094uiop

The strftime and gmtime need to be imported (from time)
but I only did that to give them unique names, mostly because in this function I didn't have the request info or I would have saved the prompts too.

oh and I called CWD to confirm I wasnt in the subfolder where process_management was. It wasnt. Can remove the os.CWD line.

The real program takes image_as_pil and copies it into image_buffer where it can be submitted back to the horde like nothing happened.

I just copied that block and replaced the buffer with a filename, so it saves the file first.

I sometimes let it run overnight, never more than a few hours.
I still dont know what "Kudos" do but I've got about 5,000 of them

Total Kudos Accumulated: 5,846.00

[ - ] SmokeyMeadow 1 point 6 monthsOct 25, 2024 10:16:24 ago (+1/-0)

Nice, it works. Thanks for your help. I had it going for a second and it gave me a wizard bitch with three legs and a chunky nigress drawn as a 50's pinup girl. I was hoping it would save the metadata for these images, so I could drag them into my own local AI and adjust the prompts. Doesn't seem to be the case. Still good for a laugh.

[ - ] puremadness [op] 1 point 6 monthsOct 25, 2024 11:01:13 ago (+1/-0)

I think the metadata (the prompt etc) is going to be stuck into completed_job_info.sdk_api_job_info (few lines above where we were, line 2380)

it gave me a wizard bitch with three legs and a chunky nigress drawn as a 50's pinup girl

Yep it's working.

For the record there is a text generation component too, uses koboldcpp and similar modification works there to save both input prompt and the output to a txt file. It's a lot of text and these people are disgusting btw.

[ - ] SmokeyMeadow 1 point 6 monthsOct 25, 2024 14:09:49 ago (+1/-0)

That's funny. I always like seeing the contrast between what someone wants their AI to make vs actually gets generated. Having AI make a picture is like having a drunk friend pick up items for you at the store. You can assume he'll probably only pay close attention to the top of the list, or what you underline to emphasize.

[ - ] Sheitstrom 2 points 6 monthsOct 21, 2024 07:40:38 ago (+2/-0)

Very cool.

[ - ] FacelessOne 2 points 6 monthsOct 21, 2024 08:48:11 ago (+2/-0)

Nerd

[ - ] puremadness [op] 1 point 6 monthsOct 22, 2024 03:05:35 ago (+1/-0)

[ - ] observation1 2 points 6 monthsOct 21, 2024 14:49:25 ago (+2/-0)

So basically you get to see images generated by other people?

But why?

[ - ] puremadness [op] 1 point 6 monthsOct 21, 2024 21:43:59 ago (+1/-0)

...because I can...

sure as shit has more purpose than a normal worker who just slaves away for literally internet points.

I have infinite crowd sources lolcats. Turn it on and watch it go brrrrrr.

This was the only reason I installed the worker, I wanted to try and make it do what its not supposed to do.
As you can see, it was a tad anticlimactic and super easy.

[ - ] observation1 1 point 6 monthsOct 25, 2024 22:52:53 ago (+1/-0)

I respect that