{"id":21015078,"url":"https://github.com/frefrik/comfyui-flux","last_synced_at":"2025-08-02T19:09:16.918Z","repository":{"id":252567609,"uuid":"838080153","full_name":"frefrik/comfyui-flux","owner":"frefrik","description":"Docker-based setup for running ComfyUI with FLUX.1 models","archived":false,"fork":false,"pushed_at":"2025-05-05T21:07:58.000Z","size":4919,"stargazers_count":40,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T21:41:14.518Z","etag":null,"topics":["comfyui","docker","docker-compose","flux","workflow"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/frefrik/comfyui-flux","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frefrik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-04T22:01:21.000Z","updated_at":"2025-05-05T21:08:01.000Z","dependencies_parsed_at":"2024-08-10T20:44:56.780Z","dependency_job_id":"1be73c6d-36e8-40b6-98a1-ea4ce8126d89","html_url":"https://github.com/frefrik/comfyui-flux","commit_stats":null,"previous_names":["frefrik/comfyui-flux"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frefrik/comfyui-flux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frefrik%2Fcomfyui-flux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frefrik%2Fcomfyui-flux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frefrik%2Fcomfyui-flux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frefrik%2Fcomfyui-flux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frefrik","download_url":"https://codeload.github.com/frefrik/comfyui-flux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frefrik%2Fcomfyui-flux/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268439621,"owners_count":24250671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comfyui","docker","docker-compose","flux","workflow"],"created_at":"2024-11-19T10:08:36.730Z","updated_at":"2025-08-02T19:09:16.903Z","avatar_url":"https://github.com/frefrik.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ComfyUI Flux\n\nComfyUI Flux is a Docker-based setup for running [ComfyUI](https://github.com/comfyanonymous/ComfyUI) with [FLUX.1](https://www.basedlabs.ai/tools/flux1) models and additional features.\n\n## Features\n\n- Dockerized ComfyUI environment\n- Automatic installation of ComfyUI and ComfyUI-Manager\n- **Low VRAM Mode**: Download and use FP8 models for reduced VRAM usage\n- Pre-configured with FLUX models and VAEs\n- Easy model management and updates\n- GPU support with CUDA 12.1 or 12.4\n\n## Prerequisites\n\n- Docker and Docker Compose\n- NVIDIA GPU with CUDA support (for GPU acceleration)\n- (Optional) Huggingface account and token (for downloading official FLUX.1[dev] and FLUX.1[schnell] models)\n\n## Quick Start\n\n1. (Optional) Create a `.env` file in the project root and add your Huggingface token:\n\n   ```bash\n   # For downloading FLUX.1[dev] and FLUX.1[schnell] model files.\n   # Get your token from https://huggingface.co/settings/tokens\n   HF_TOKEN=your_huggingface_token\n   ```\n\n2. Download the `docker-compose.yml` file:\n\n   ```bash\n   wget https://raw.githubusercontent.com/frefrik/comfyui-flux/main/docker-compose.yml\n   ```\n\n   Alternatively, you can create a `docker-compose.yml` file and copy/paste the following contents:\n\n   ```yaml\n   services:\n     comfyui:\n       container_name: comfyui\n       image: frefrik/comfyui-flux:latest\n       restart: unless-stopped\n       ports:\n         - \"8188:8188\"\n       volumes:\n         - \"./data:/app\"\n       environment:\n         - CLI_ARGS=\n         - HF_TOKEN=${HF_TOKEN}\n         - LOW_VRAM=${LOW_VRAM:-false}\n       deploy:\n         resources:\n           reservations:\n             devices:\n               - driver: nvidia\n                 device_ids: ['0']\n                 capabilities: [gpu]\n   ```\n\n   **Note:** The default Docker image uses CUDA 12.1 (`cu121`). If you require CUDA 12.4, you can specify the `cu124` tag in the image name. For example:\n\n   ```yaml\n   image: frefrik/comfyui-flux:cu124\n   ```\n\n3. Run the container using Docker Compose:\n\n   ```bash\n   docker-compose up -d\n   ```\n\n   **Note:** The first time you run the container, it will download all the included models before starting up. This process may take some time depending on your internet connection.\n\n4. Access ComfyUI in your browser at `http://localhost:8188`\n\n## Environment Variables\n\n- `HF_TOKEN` - Your Hugging Face access token. **Required** to download the official `flux1-dev`, `flux1-schnell` models.\n- `LOW_VRAM` - Set to `true` to download and configure ComfyUI for FP8 models, reducing VRAM usage. See [Low VRAM Mode](#low-vram-mode) section.\n- `MODELS_DOWNLOAD` - Comma-separated list specifying which FLUX base models to download (`schnell`, `dev`). If not set, both models will be downloaded.\n- `CLI_ARGS` - Additional command-line arguments to pass directly to the ComfyUI.\n\n## Low VRAM Mode\n\nBy setting the `LOW_VRAM` environment variable to `true`, the container will download and use the FP8 models, which are optimized for lower VRAM usage. The FP8 versions have CLIP and VAE merged, so only the checkpoint files are needed.\n\nEnable Low VRAM Mode:\n\n```bash\nLOW_VRAM=true\n```\n\n## Model Files\n\nOverview of the model files that will be downloaded when using this container.  \nBoth official FLUX.1[dev] and FLUX.1[schnell] model files now require a `HF_TOKEN` for download.\n\n### When `LOW_VRAM=false` (default)\n\nThe following model files will be downloaded by default, unless specified otherwise in `MODELS_DOWNLOAD`:\n\n| Type | Model File Name | Size | Notes |\n|-------------|-------------------------------|---------|-------------------------------------------------|\n| UNet | flux1-schnell.safetensors | 23 GiB | requires `HF_TOKEN` for download |\n| UNet | flux1-dev.safetensors | 23 GiB | requires `HF_TOKEN` for download |\n| CLIP | clip_l.safetensors | 235 MiB | |\n| CLIP | t5xxl_fp16.safetensors | 9.2 GiB | |\n| CLIP | t5xxl_fp8_e4m3fn.safetensors | 4.6 GiB | |\n| LoRA | flux_realism_lora.safetensors | 22 MiB | |\n| VAE | ae.safetensors | 320 MiB | requires `HF_TOKEN` for download |\n\n### When `LOW_VRAM=true`\n\n| Type | Model File Name | Size | Notes |\n|-------------|-------------------------------|---------|-------------------------------------------------|\n| Checkpoint | flux1-dev-fp8.safetensors | 17 GiB | |\n| Checkpoint | flux1-schnell-fp8.safetensors | 17 GiB | |\n\n## Workflows\n\nDownload the images below and drag them into ComfyUI to load the corresponding workflows.\n\n### Official versions\n\n| FLUX.1[schnell] | FLUX.1[dev] |\n|-----------------|-------------|\n| \u003cdiv align=\"center\"\u003e![Flux Schnell](./images/flux-schnell.png)\u003cbr\u003e[Download](https://raw.githubusercontent.com/frefrik/comfyui-flux/refs/heads/main/images/flux-schnell.png)\u003c/div\u003e | \u003cdiv align=\"center\"\u003e![Flux Dev](./images/flux-dev.png)\u003cbr\u003e[Download](https://raw.githubusercontent.com/frefrik/comfyui-flux/refs/heads/main/images/flux-dev.png)\u003c/div\u003e |\n\n### FP8 versions (LOW_VRAM)\n\n| FLUX.1[schnell] FP8 | FLUX.1[dev] FP8 |\n|---------------------|-----------------|\n| \u003cdiv align=\"center\"\u003e![Flux Schnell FP8](./images/flux-schnell-fp8.png)\u003cbr\u003e[Download](https://raw.githubusercontent.com/frefrik/comfyui-flux/main/images/flux-schnell-fp8.png)\u003c/div\u003e | \u003cdiv align=\"center\"\u003e![Flux Dev FP8](./images/flux-dev-fp8.png)\u003cbr\u003e[Download](https://raw.githubusercontent.com/frefrik/comfyui-flux/main/images/flux-dev-fp8.png)\u003c/div\u003e |\n\n## Updating\n\nThe ComfyUI and ComfyUI-Manager are automatically updated when the container starts. To update the base image and other dependencies, pull the latest version of the Docker image using:\n\n```bash\ndocker-compose pull\n```\n\n## Additional Notes\n\n- **Switching Between Modes**: If you change the `LOW_VRAM` setting after the initial run, the container will automatically download the required models for the new setting upon restart.\n- **Model Selection**: Use the optional `MODELS_DOWNLOAD` environment variable to specify which FLUX models to download:\n  - `MODELS_DOWNLOAD=\"schnell\"`: Download only FLUX.1[schnell] model\n  - `MODELS_DOWNLOAD=\"dev\"`: Download only FLUX.1[dev] model\n  - `MODELS_DOWNLOAD=\"schnell,dev\"` or not set: Download both models (default)\n  - When `LOW_VRAM=false`, necessary dependencies (VAE, text encoders, LoRA) are always included\n- **Model Downloading**: The scripts are designed to skip downloading models that already exist, so you won't waste bandwidth re-downloading models you already have.\n- **Huggingface Token**: The `HF_TOKEN` is necessary for downloading the `flux1-dev.safetensors`, `flux1-schnell.safetensors`, and `ae.safetensors` models when `LOW_VRAM=false`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrefrik%2Fcomfyui-flux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrefrik%2Fcomfyui-flux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrefrik%2Fcomfyui-flux/lists"}