Spaces:
Running
on
Zero
Running
on
Zero
Rishi Desai
commited on
Commit
·
8eb9ce4
1
Parent(s):
3e1c3ec
Read me
Browse files
README.md
CHANGED
@@ -5,39 +5,39 @@ Enhancing faces in AI generated images.
|
|
5 |
|
6 |
### Prerequisites
|
7 |
- Python 3.8 or higher
|
|
|
8 |
- At least 50GB of free disk space
|
9 |
|
10 |
### Setup
|
11 |
|
12 |
1. Set up your Hugging Face token:
|
13 |
-
- Create a token at [Hugging Face](https://huggingface.co/settings/tokens)
|
14 |
-
- Set the token as an environment variable:
|
15 |
```
|
16 |
export HUGGINGFACE_TOKEN=your_token_here
|
17 |
```
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
2.
|
20 |
-
```
|
21 |
-
export HF_HOME=/path/to/your/huggingface_cache
|
22 |
-
```
|
23 |
-
This is where models will be downloaded and then symlinked to ComfyUI.
|
24 |
-
|
25 |
-
3. Create and activate a virtual environment with dependencies:
|
26 |
```
|
27 |
python -m venv venv
|
28 |
source venv/bin/activate
|
29 |
python -m pip install -r requirements.txt
|
30 |
```
|
31 |
|
32 |
-
|
33 |
```
|
34 |
python install.py
|
35 |
```
|
36 |
|
37 |
This script will:
|
38 |
- Install all required dependencies to your venv
|
39 |
-
- Install ComfyUI and
|
40 |
-
- Download and install all required models (
|
41 |
|
42 |
## Configuration
|
43 |
|
@@ -50,21 +50,19 @@ echo "FAL_API_KEY=your_fal_api_key_here" >> .env
|
|
50 |
|
51 |
These API keys are required for certain features of the application to work properly.
|
52 |
|
53 |
-
#
|
54 |
-
|
55 |
-
A web interface for the face enhancement workflow using Gradio. Between 45-60 seconds processing time per image.
|
56 |
|
57 |
-
|
58 |
|
59 |
-
1.
|
60 |
|
61 |
```bash
|
62 |
python gradio_demo.py
|
63 |
```
|
64 |
|
65 |
-
2.
|
66 |
```bash
|
67 |
-
ssh -L 7860:localhost:7860 root@[IP_ADDRESS] -p [
|
68 |
```
|
69 |
|
70 |
3. Go to http://localhost:7860
|
@@ -72,13 +70,13 @@ ssh -L 7860:localhost:7860 root@[IP_ADDRESS] -p [RUNPOD_PORT] -i ~/.ssh/[PRIVATE
|
|
72 |
## Usage
|
73 |
|
74 |
1. Upload an input image you want to enhance
|
75 |
-
2. Upload a reference face image
|
76 |
3. Click "Enhance Face" to start the process
|
77 |
4. Wait approximately 60 seconds for processing
|
78 |
5. View the enhanced result in the output panel
|
79 |
|
80 |
## Notes
|
81 |
|
82 |
-
- The
|
83 |
-
-
|
84 |
- Temporary files are created during processing and cleaned up afterward
|
|
|
5 |
|
6 |
### Prerequisites
|
7 |
- Python 3.8 or higher
|
8 |
+
- 1 GPU with 48GB VRAM
|
9 |
- At least 50GB of free disk space
|
10 |
|
11 |
### Setup
|
12 |
|
13 |
1. Set up your Hugging Face token:
|
14 |
+
- Create a token at [Hugging Face](https://huggingface.co/settings/tokens) set it as an environment variable.
|
15 |
+
- Set the token as an environment variable. HuggingFace requires login for downloading Flux:
|
16 |
```
|
17 |
export HUGGINGFACE_TOKEN=your_token_here
|
18 |
```
|
19 |
+
- Set the Hugging Face cache directory:
|
20 |
+
```
|
21 |
+
export HF_HOME=/path/to/your/huggingface_cache
|
22 |
+
```
|
23 |
+
Models will be downloaded here and then symlinked to ./ComfyUI/models/.
|
24 |
|
25 |
+
2. Create virtual environment:
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
```
|
27 |
python -m venv venv
|
28 |
source venv/bin/activate
|
29 |
python -m pip install -r requirements.txt
|
30 |
```
|
31 |
|
32 |
+
3. Run installation script:
|
33 |
```
|
34 |
python install.py
|
35 |
```
|
36 |
|
37 |
This script will:
|
38 |
- Install all required dependencies to your venv
|
39 |
+
- Install ComfyUI and required custom nodes
|
40 |
+
- Download and install all required models (Flux.1-dev, ControlNet, text encoders, PuLID, and more)
|
41 |
|
42 |
## Configuration
|
43 |
|
|
|
50 |
|
51 |
These API keys are required for certain features of the application to work properly.
|
52 |
|
53 |
+
# Gradio Demo
|
|
|
|
|
54 |
|
55 |
+
A web interface for the face enhancement workflow.
|
56 |
|
57 |
+
1. Run
|
58 |
|
59 |
```bash
|
60 |
python gradio_demo.py
|
61 |
```
|
62 |
|
63 |
+
2. Run this on a separate terminal for port-forwarding
|
64 |
```bash
|
65 |
+
ssh -L 7860:localhost:7860 root@[IP_ADDRESS] -p [SERVER_PORT] -i [PRIVATE_KEY]
|
66 |
```
|
67 |
|
68 |
3. Go to http://localhost:7860
|
|
|
70 |
## Usage
|
71 |
|
72 |
1. Upload an input image you want to enhance
|
73 |
+
2. Upload a high-quality reference face image
|
74 |
3. Click "Enhance Face" to start the process
|
75 |
4. Wait approximately 60 seconds for processing
|
76 |
5. View the enhanced result in the output panel
|
77 |
|
78 |
## Notes
|
79 |
|
80 |
+
- The script runs a ComfyUI server ephemerally
|
81 |
+
- All images are saved in ./ComfyUI/input/scratch/
|
82 |
- Temporary files are created during processing and cleaned up afterward
|