Skip to content

kami2/ChaosPlayground

Repository files navigation

Process flow:

ai creations

Project Description: Automating Image Generation and Publishing

Project Overview

This project aims to automate the process of image generation, storage, and publishing through a combination of two services: a worker using Leonardo AI API and a central service hosted at chaotic.vercel.app. The worker generates images using prompts generated by ChatGPT and runs twice a day, sending the generated image information to the chaotic.vercel.app service. The chaotic.vercel.app service is responsible for uploading the generated image to Google Drive and inserting information about the image into a remote MySQL database. Additionally, a cron job is scheduled to run daily between 8:30 AM and 9:30 AM to post the oldest, non-deleted, and unpublished image on Instagram, updating the database with the publication status and date.

Project Components

Worker Service

  • The worker service uses the Leonardo AI API to generate images based on prompts provided by ChatGPT.
  • The worker runs twice a day, every 12 hours.
  • After generating an image, it sends information about the image to the chaotic.vercel.app service.

chaotic.vercel.app Service

  • This service is responsible for managing the storage and database operations.
  • It receives image information from the worker service.
  • Uploads the generated image to Google Drive for storage.
  • Inserts relevant information about the image (e.g., image URL) into a remote MySQL database.

Database

  • A remote MySQL database stores information about generated images, including their URLs, publication status, and other metadata.

Cron Job (Scheduled Task)

  • A cron job is scheduled to run daily between 8:30 AM and 9:30 AM.
  • This job performs the following tasks:
    • Looks for the oldest, non-deleted, and unpublished image in the database.
    • Retrieves the image URL from the database.
    • Posts the image on Instagram.
    • Sets the "isPublished" flag in the database to mark the image as published.
    • Records the publication date as "publishedDate" in the database.

Key Features

  • Automated image generation using AI prompts.
  • Efficient storage of generated images on Google Drive.
  • Database management for image metadata and publication status.
  • Automatic posting of images on Instagram.
  • Regularly scheduled updates for image publication.

Project Benefits

  • Increases efficiency by automating image generation and publication.
  • Provides a central repository for image storage and metadata.
  • Ensures a consistent posting schedule on Instagram.
  • Reduces manual intervention in the image generation and posting process.

About

Automating Image Generation and Publishing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published