simple stable diffusion server that saves images to cloud storage – returns links to google cloud storage

Creators

netwrck logo

Checkout AI Characters to chat with at netwrck.com

Characters are narrated and written by many GPT models trained on 1000s of fantasy novels and chats.

Also for LLMs for making Text – Checkout Text-Generator.io for a Open Source text generator that uses many AI models to generate the best along with image understanding and OCR networks.

Setup

. Create a virtual environment (optional)

python3 -m venv venv
source venv/bin/activate

. Install dependencies

pip install -r requirements.txt
pip install -r dev-requirements.txt

. Edit settings in env.py
. download your Google cloud credentials to secrets/google-credentials.json
. Run the server

GOOGLE_APPLICATION_CREDENTIALS=secrets/google-credentials.json gunicorn  -k uvicorn.workers.UvicornWorker -b :8000 main:app --timeout 600 -w 1 

. Make a Request

http://localhost:8000/create_and_upload_image?prompt=good%20looking%20elf%20fantasy%20character&save_path=created/elf.png

Response

{"path":"https://storage.googleapis.com/static.netwrck.com/static/uploads/created/elf.png"}

http://localhost:8000/docs

Check to see that “good Looking elf fantasy character” was created

elf.png
elf2.png

Testing

GOOGLE_APPLICATION_CREDENTIALS=secrets/google-credentials.json pytest .

Read More