article-image-generator

Article Image Generator

Project for generating images for articles

article-image-generator

Article image generator is a web application that generates headline images for articles. It's build on GPT-3.5, Stable diffusion XL 2.2.2 and our custom model for image validation. The application is built with Svelte and FastAPI.

Table of contents

About

The project was created by students of the Secondary Industrial School Brno, Purkyňova under the guidance of AI Check on internship The project is open to all and free of charge.

Technologies

  1. Frontend: Svelte – Svelte is a modern JavaScript framework that enables the development of interactive user interfaces
  2. Backend: FastAPI – FastAPI is a powerful Python framework for building web applications.

AI Models

  1. Image generation: Stable diffusion XL 2.2.2 – Stable diffusion XL 2.2.2 is an advanced AI model specifically designed for generating high-quality images
  2. Text processing: gpt-35-turbo – cutting-edge text processing model developed by OpenAI

Requirements

  1. Python 3.9.2 – Python serves as the primary programming language for the backend implementation.
  2. NodeJS 18.16.0 LTS – NodeJS is essential for running the Svelte frontend and managing the necessary dependencies.

Project preview

Application design

Example:

How Important Is Web3 and Decentralization to Industry Ecosystems?

Getting Started

  1. Create Python virtual enviroment (optional, but will prevent some unexpected errors)
python -m venv pyaig
# Windows
pyaig\Scripts\activate
pip install -r requirements.txt
# Linux
source pyaig/bin/activate
pip install -r requirements.txt
  1. Get all svelte packages
cd ./frontend
npm install
cd ../
  1. Create .env file and fill it with your API keys
OPENAI_API_KEY=<your key>
OPENAI_API_ENGINE=<your engine>
OPENAI_API_ENGINE_EMBEDDING=<your engine>
OPENAI_CUSTOM_DOMAIN=<your domain>

STABILITY_API_KEY=<your key>
  1. Build svelte and run fastapi
cd ./frontend
npm run build
cd ../
python -m article_image_generator.main
  1. When first build is done, just run the python file
  2. When first build is done, just run the python file
    • don't forget to be in virtual enviroment
python -m article_image_generator.main

Optional 5. In article_image_generator.settings you can change settings of all aspects of project

Current style presets:

  • realistic
  • cinematic
  • cartoon
  • sketch

Top categories

Loading Svelte Themes