Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 3.61 KB

File metadata and controls

63 lines (49 loc) · 3.61 KB

ReDoodle

ReDoodle is a "daily" web puzzle game where you are given a starting image, and your goal is to transform it into a goal image through a series of prompts.

ReDoodleDemoVideo.mp4

This repo is meant as a proof of concept and is not production ready nor will it be maintained.

Installation

The installation instructions here are meant for local development and were primarily tested on a Linux server with a modern NVIDIA GPU.

Client

The client is built using Vite and uses the 'react-swc-ts' template. It also uses Tailwind CSS for styling.

Prerequisites

  1. nvm or nvm-windows to install Node.js versions
  2. nvm install 22 install Node.js 22
  3. nvm use 22 to use Node.js 22

Launch

  1. cd app
  2. npm install
  3. npm run dev

Server

The server is built using FastAPI in Python. It uses SQLite to persist game state. For comparing images we use a Vision Transformer (ViT) image feature model from Hugging Face. Installing the Poetry environment will also install PyTorch and the model will be loaded upon server start.

Prerequisites

  1. Install Python >=3.11
  2. Install Poetry
  3. cd server
  4. poetry install to install the virtual environment
  5. add-puzzles to load the puzzles in the data folder into the database

Launch

  1. cd server
  2. poetry shell to make sure the virtual environment is activated
  3. fastapi dev main.py --host 0.0.0.0 to run the server
    • The --host 0.0.0.0 flag is necessary to allow connections from other devices on the network as needed by the client.

Image Generation

For generating images we use ComfyUI. The ComfyUI server is run as a separate process from the main server.

Prerequisites

  1. NVIDIA GPU
  2. cd server/ComfyUI
  3. python3 -m venv .venv to create a new virtual environment for image generation
  4. source .venv/bin/activate to activate the new virtual environment
  5. pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
  6. pip install -r requirements.txt
  7. Download the model files and put them into the correct folders

Launch

  1. cd server/ComfyUI
  2. source .venv/bin/activate to activate the virtual environment on Linux. ComfyUI does not support Poetry for the environment, so we use the built in Python environment.
  3. python main.py to start the image generation server.