stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Option for custom discord channel hook for auto-uploading/sharing

Open Reinbowsaur opened this issue 2 years ago • 10 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Would allow for uploading and sharing to discord channels directly upon generation. Useful for communties sharing a web ui or just making channel dumps on discords reliable network for easy viewing for colab/paperspace users.

Proposed workflow

  1. Go to settings
  2. Add a section to input and save a link to a discord hook
  3. Prompt and image are posted to hooked discord channel upon completetion of generation within webui.

Additional information

https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks https://discord.com/developers/docs/resources/webhook

Reinbowsaur avatar Oct 21 '22 07:10 Reinbowsaur

@Reinbowsaur The extension is 1/2 done. Now, I only need to make the part that shares to discord and add a button to share the generated images!

Ju1-js avatar Nov 10 '22 02:11 Ju1-js

The repo is also public, you can track my progress here.

Ju1-js avatar Nov 10 '22 02:11 Ju1-js

@Reinbowsaur What is your proposed method of crediting the person who generated it? Should there be a box that doesn't save where the person could input their discord tag which if left blank defaults to "Anonymous", currently I am looking into this to see if it is even possible.

Ju1-js avatar Nov 16 '22 02:11 Ju1-js

@Reinbowsaur What is your proposed method of crediting the person who generated it? Should there be a box that doesn't save where the person could input their discord tag which if left blank defaults to "Anonymous", currently I am looking into this to see if it is even possible.

That sounds like the only real solution, a temporary client side field that you provide you name in, if not provided then just uploaded as anonymous.

Reinbowsaur avatar Nov 16 '22 02:11 Reinbowsaur

@Reinbowsaur Discord embeds also have a limitation of 4 images per embed. How would you like to get around this bug? Some possible solutions are:

  • Using an API like Imgur to host a "gallery" of each batch generation and showing the first or randomly selected 4 images
  • Using some other API to host the images (please provide a link)
  • Only showing the first or randomly selected 4 images
  • Sending multiple embeds (Could cause spam if the user generates a lot of images) Also, should there be a warning? Ex. Warning: The "Generated by" field uses the name provided by the users, it might not be the actual person who generated the images. image

Ju1-js avatar Nov 16 '22 02:11 Ju1-js

@Reinbowsaur Discord embeds also have a limitation of 4 images per embed. How would you like to get around this bug?

I assume you mean for if someone were to generate a batch size of over 4... It doesn't seem like something that will happen too often as batches of 4 seem to be the norm. I'd say just embed the first 4 images of each batch.

Reinbowsaur avatar Nov 17 '22 05:11 Reinbowsaur

Ah, as for the "generated by" warning... I guess there is no way to set this temporarily client side? Would have to make the webui read from the clients field each time generate is executed. Sounds like abit of problem if its set server side for everyone. I guess the warning note is warranted.

Reinbowsaur avatar Nov 17 '22 07:11 Reinbowsaur

@Reinbowsaur Honestly, I'd just have a pinned message in the channel, I'm just overthinking things 🤣

Ju1-js avatar Nov 18 '22 01:11 Ju1-js

Oh yeah a pinned message! that's a way better idea! Yeah the warning filling each embed would be annoyong.

Reinbowsaur avatar Nov 18 '22 01:11 Reinbowsaur

@Reinbowsaur Since I don't see any callbacks for when the images are done processing and there hasn't been any activity on #4757, I'm going to look into adding a button to the generation pages.

Ju1-js avatar Nov 20 '22 05:11 Ju1-js

@Reinbowsaur How should the image sharing of the first 4 images from each batch work? Should it skip the image grid if it was generated? Or include it as one of the 3 images?

Ju1-js avatar Nov 28 '22 00:11 Ju1-js

@Ju1-js I completely forgot about the fact we had an option to save image grids.

If the user has grid saving enabled and batch generated is more than 4, embed first 3 + the grid, and if not over 4 just default to the embedding first 4 function. If this is too hard to program, ofc just embedding the grid for batches of over 4 would be fine.

If grid saving is not enabled just default to the embedding the first 4 generations.

Is how I'd ideally do it! ...If you can make it possible or not I don't know! But thanks for keeping on asking for my input, it's really cool.

Reinbowsaur avatar Nov 28 '22 01:11 Reinbowsaur

@Reinbowsaur After quite a while... The extension has finally reached its alpha stage, feel free to try it out! A lot is going to change, the code needs a lot of cleanup and some features still need to be finished, but the basic sharing functionality is working!

Ju1-js avatar Apr 06 '23 01:04 Ju1-js

Closing as this was already mentioned months ago it should be an extension. https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/3977#issuecomment-1298349761

catboxanon avatar Aug 08 '23 05:08 catboxanon