0

GitHub - fvsionai/fvsion

 1 year ago
source link: https://github.com/fvsionAI/fvsion
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

About

  1. Fvsion, pronounced Fusion is a quick bundle of FastAPI + Vite and Vue + Stable Diffusion with async first design.
  2. Built on top of electron-vite-vue-fastapi boilerplate.

Features & Motivation

  1. Independent frontend and backend, choose what you need and as you need.
  2. Image generation is sent asynchronously to the fastAPI engine, allowing for automatic queue.
  3. Flexible api modules to allow ease of use to add your own or publically shared modules, without interference with UI.
  4. Integration with Node for faster prototyping.
  5. Versatile UI in Vue & Electron.
  6. Cross platform features incoming via Electron and packaged pyInstaller (coming soon).

Beginner Friendly Installation

  1. Windows Installer/Executable (Coming Soon)
  2. Linux and MacOS not yet supported

Development Installation

  1. Make sure you have git, python 3.10.7 & virtualenv installed.
  2. Clone git via git clone https://github.com/fvsionai/fvsion.git <folder-name>. Replaced <folder-name> with your desired folder name.
  3. Navigate to the newly created folder cd <folder-name>
  4. Download diffusers model as per instruction below: [Link](# Diffusers Model Download)
  5. Make sure you are in the root folder and create virtualenv local folders python -m virtualenv .venv
  6. Activate your virtualenv by using .venv/scripts/activate
  7. Install python requirement using pip install -r py/requirements.txt
  8. Run python py/main.py & go to http://localhost:4242/docs to confirm server is running.
  9. You can start generating image by directly interacting with the built in SwaggerAPI. Click "CTRL + C" while in terminal to close the server when you are done.
  10. For a proper front end, need to install npm requirement using npm i
  11. Development run via npm run dev
  12. (Optional) You can run npm run build to generate standalone exe files. Do note however it might take a while (~30 minutes on AMD Ryzen 5 1600), especially for the first run.
  13. (Recommended) Please send PR for any improvement suggestions. Very much welcomed.

Diffusers Model Download

  1. There are two options as of today, either download manually by going to huggingface website, or using git lfs to handle large files. Note that the whole files total up to >5 GB
  2. git lfs install and cd models Or navigate to the fvsion/models folder.
  3. git clone https://huggingface.co/CompVis/stable-diffusion-v1-4. There will be prompt asking for your huggingface id and password for the first time.
  4. (Optional) Login to huggingface.co and navigate to https://huggingface.co/CompVis/stable-diffusion-v1-4/tree/main.
  5. (Optional) Downloads stable-diffusion-v1-4 whole folder from https://huggingface.co/CompVis/stable-diffusion-v1-4/tree/main and copy to models/stable-diffusion-v1-4.
  6. Once completed please ensure that you are in the root directory.

Known Issues

  1. There might be undeleted temporary files in C:\Users\test\AppData\Local\Temp. Please check if you storage is heavily used. Do note that diffusers libary tend to cache files to speed up operation which also use some amount of data. More details here.
  2. UX: Minimal loading indicator when loading generation.

Contributors

Hafiidz


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK