Skip to content

Commit bcf3efe

Browse files
committed
docs(readme): update setup instructions for Docker
Add detailed Docker setup guide as the recommended method Update local Python setup as an alternative option Improve overall README structure and clarity
2 parents 4839d14 + a4882d3 commit bcf3efe

File tree

2 files changed

+47
-29
lines changed

2 files changed

+47
-29
lines changed

README.md

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,49 @@ A simple web interface for running Flux models using the Replicate API. Use it t
88
- Saves your settings
99
- Shows generated images in a gallery
1010

11-
## Setup
11+
## Recommended Setup: Docker
12+
Docker is the recommended way to run this application. It ensures consistent environment across different systems.
13+
14+
### Prerequisites
15+
- Docker and Docker Compose installed on your system
16+
- Replicate API key
17+
18+
### Docker Compose Setup
19+
1. Create a `docker-compose.yml` file with the following content:
20+
```yaml
21+
services:
22+
replicate-flux-lora:
23+
image: ghcr.io/rtuszik/replicate-flux-lora:latest
24+
container_name: replicate-flux-lora
25+
environment:
26+
- REPLICATE_API_TOKEN=${REPLICATE_API_TOKEN}
27+
ports:
28+
- "8080:8080"
29+
volumes:
30+
- ${HOST_OUTPUT_DIR}:/app/output
31+
restart: unless-stopped
32+
```
33+
34+
2. Create a `.env` file in the same directory with the following content:
35+
```
36+
REPLICATE_API_TOKEN=your_api_key_here
37+
HOST_OUTPUT_DIR=/path/to/your/output/directory
38+
```
39+
Replace `your_api_key_here` with your actual Replicate API key and `/path/to/your/output/directory` with the directory on your host machine where you want to save generated images.
40+
41+
### Running with Docker
42+
1. Start the application:
43+
```
44+
docker-compose up -d
45+
```
46+
47+
2. Open `http://localhost:8080` in your browser
48+
49+
3. Choose a model, set your options, enter a prompt, and generate images
50+
51+
## Alternative Setup: Local Python Environment
52+
If you prefer to run the application without Docker, you can use a local Python environment.
53+
1254
1. Clone the repo:
1355
```
1456
git clone https://github.com/rtuszik/replicate-flux-lora.git
@@ -36,37 +78,12 @@ A simple web interface for running Flux models using the Replicate API. Use it t
3678
REPLICATE_API_TOKEN=your_api_key_here
3779
```
3880
39-
## Run it
40-
1. Make sure your virtual environment is activated
41-
42-
2. Start the app:
81+
5. Run the application:
4382
```
4483
python main.py
4584
```
4685
47-
3. Open `http://localhost:8080` in your browser
48-
49-
4. Choose a model, set your options, enter a prompt, and generate images
50-
51-
## Docker
52-
**Docker is currently experimental.**
53-
54-
### Docker Compose
55-
```yaml
56-
services:
57-
replicate-flux-lora:
58-
image: ghcr.io/rtuszik/replicate-flux-lora:latest
59-
container_name: replicate-flux-lora
60-
environment:
61-
- REPLICATE_API_TOKEN=${REPLICATE_API_TOKEN}
62-
ports:
63-
- "8080:8080"
64-
volumes:
65-
- ${HOST_OUTPUT_DIR}:/app/output
66-
restart: unless-stopped
67-
```
68-
Replace `${REPLICATE_API_TOKEN}` with your actual Replicate API key.
69-
Replace `${HOST_OUTPUT_DIR}` with the directory on your host machine where you want to save generated images.
86+
6. Open `http://localhost:8080` in your browser
7087
7188
## Need help?
7289
Check out Replicate's guide on fine-tuning Flux:

src/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ async def main_page():
3030

3131
# Run the NiceGUI server
3232
logger.info("Starting NiceGUI server")
33-
ui.run(port=8080)
33+
# ui.run(port=8080)
34+
ui.run(title="Replicate Flux LoRA", port=8080)

0 commit comments

Comments
 (0)