diffusion_frontend_thing Svelte Themes

Diffusion_frontend_thing

random project to learn svelte and mess with semantic embeddings

diffusion frontend thing

this project is a simple frontend for animagine-xl-3.1 that i built, in order to test out a simple tag autocomplete/correction system.

running the project

if you haven't already set up the project, look at the setup guide.

you can run the project automatically with:

./run.sh

or on windows:

run.bat

or alternatively by running the backend script:

cd backend
python main.py

the program accepts a --device flag, to set the device that inference is run on. it tries to use mps (apple silicon) by default and falls back to cpu if unavailable. use cuda to run on nvida gpus.

you will probably need somewhere around 16GB of VRAM to run the program?

setup guide

automatic

  1. clone the repository:
    git clone https://github.com/e74000/diffusion_frontend_thing
    
  2. open project root:
    cd diffusion_frontend_thing
    
  3. run the setup script ./init.sh (alternatively init.bat for windows users). you may need to make the script executable,
  4. finally you can run the application with ./run.sh (alternatively run.bat for windows users). you may need to make the script executable,

manual

  1. clone the repository:
    git clone https://github.com/e74000/diffusion_frontend_thing
    
  2. open project root:
    cd diffusion_frontend_thing
    

frontend

  1. open frontend directory:
    cd frontend
    
  2. install npm dependencies:
    npm install
    
  3. build the frontend:
    npm run build
    
  4. return to project root:
    cd ..
    

backend

  1. open backend directory:
    cd backend
    
  2. init virtual environment:
    python -m venv venv
    
  3. activate virtual environment:
    source venv/bin/activate
    
    on windows you need to use:
    venv\\Scripts\\activate
    
  4. install python dependencies:
    pip install -r requirements.txt
    
  5. check if safe.h5 exists in the backend directory. if it is missing fetch it with:
    curl https://r2.e74000.net/diffusion_frontend_thing/safe.h5
    
  6. finally you can run the backend script with:
    python main.py
    

Top categories

Loading Svelte Themes