

/r/StableDiffusion is an unofficial community embracing the open-source material of all related. Post art, ask questions, create discussions, contribute new tech, or browse the subreddit. It’s up to you.
Any steeps on how to make How to make an AI Image generation site?
Question - Help
I was looking to make an AI image generation site similar to https://legacy.mage.space/ on a smaller scale for friends and personal use, but I have no idea where to start or where and how to host it. Does anyone know any good steps to take when building one?
Archived post. New comments cannot be posted and votes cannot be cast.
Sort by:
Best
Open comment sort options
Best
Top
New
Controversial
Old
Q&A
This is like asking "I want to build a car like a Ferrari. Where to start?"
that's easy
Tl;Dr: It's quite involved, this method is based on my image generator website I made, will take 1+ days depending on your coding skills, you can start off simple with just a prompt and negative prompt and work your way up!
Heya, Developer of the JSCammie Image Generator . I can't give you a step by step guide but I can give you some pointers!
Typically services like these (and mine) have 2 parts to them, A front-end (the website you see) for users to input prompts, aspect ratio's and other settings. And a back-end, (the image generator) where the GPU(s) generate the images from a queue.
Here is how to set it up running locally (This is based on how I setup my generator website... ROUGHLY):
IF you are running this on your own computer (locally), then firstly I'd recommend playing around with and using Huggingface's Diffusers library, as this is a simple way to load models, loras and generate images & it supports all popular os's (windows, linux, mac arm/mac x86), this requires pytorch.
I'd recommend reading the documentation I've linked for the Huggingface Diffusers Library and learn how to load a model > then generate an image > and lastly save said image. For image saving and loading I'd recommend pillow!
Secondly, start very very basic at first, I'd recommend creating the AI Image Generator part of it, using:
Flask (Connecting your Image Generator to the Website)
Huggingface Diffusers (Model Loading, Image Generation, Lora Loading)
Pillow (general image loading/saving/manipulation)
BytesIO & base64 (converting the image to base64 to be sent to the user)
Here is a mockup I made based off the JSCammie AI Image Generator:
https://pastecode.io/s/ef6mvyv6
& For the website code you could do something basic like this just to get started:
https://pastecode.io/s/vdiu3464
This is just 1 example of a front-end and back-end for an AI Image generator, If you want to you can look at the back-end code for JSCammie on its Github!
Meta/Google/Amazon buying up all GPU's and selling computations for a small fee... start to think it is really cost efficient to subscribe to one of their cloud gpu's/platforms to host site.
I'd just set up a website in Flask and make calls to Auto1111's API.
If you don't mind paying for the electricity yourself, you can run inference on your own PC and then use port forwarding to expose the website to the outside world. I heard that this may count as a TOS violation for some ISPs, though...