Vast Ai / ComfyUI Walkthrough

JayHill
6 min readNov 12, 2024

I chose Vast.ai as the platform to host my new app. The app will allow users to upload a photo of themselves and describe the hairstyle they want in text. Using ComfyUI, the app automatically selects the best match for the desired style and applies it to the user’s photo, giving them a realistic preview of their new look before any scissors or styling tools come into play. Initially, the app was developed using U2-Net, but I shifted to ComfyUI for its enhanced capabilities in accurately selecting and applying hairstyles based on user input.

As the app develops further, I envision adding features that suggest alternative hairstyles that might suit the user’s face and preferences, along with tutorials that provide stylists with step-by-step instructions for achieving each look. Ultimately, the app aims to save time for both clients and stylists, offering people a seamless way to experiment with new looks while ensuring they leave the salon with the perfect style.

  1. Initial Preparation:
  • GPU Instance Setup: Selected and rented the instance on Vast.ai.
  • SSH Access: Gained access and verified GPU availability.
  • Package Installation: Installed torch, diffusers, transformers, fastapi, uvicorn, and pillow.

2. Download and Set Up Stable Diffusion Inpainting:

  • Model Loading: Loaded Stable Diffusion’s inpainting model.
  • Basic Testing: Confirmed that the model starts loading correctly on the GPU.

--

--

JayHill
JayHill

Written by JayHill

Information Security Research 🧿💻

No responses yet