{"id":17305255,"url":"https://github.com/splittydev/flux1-cli","last_synced_at":"2025-04-14T13:22:54.693Z","repository":{"id":253908851,"uuid":"844863169","full_name":"SplittyDev/flux1-cli","owner":"SplittyDev","description":"Easy local FLUX.1 Inference","archived":false,"fork":false,"pushed_at":"2024-08-29T18:27:42.000Z","size":422,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T03:53:38.416Z","etag":null,"topics":["bfl","cli","flux1","flux1ai","generative-ai","inference","lora"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SplittyDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-08-20T05:45:35.000Z","updated_at":"2025-02-19T06:45:13.000Z","dependencies_parsed_at":"2024-08-26T16:34:19.470Z","dependency_job_id":null,"html_url":"https://github.com/SplittyDev/flux1-cli","commit_stats":null,"previous_names":["splittydev/flux1-cli"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SplittyDev%2Fflux1-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SplittyDev%2Fflux1-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SplittyDev%2Fflux1-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SplittyDev%2Fflux1-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SplittyDev","download_url":"https://codeload.github.com/SplittyDev/flux1-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886726,"owners_count":21177734,"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","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":["bfl","cli","flux1","flux1ai","generative-ai","inference","lora"],"created_at":"2024-10-15T11:55:10.672Z","updated_at":"2025-04-14T13:22:54.667Z","avatar_url":"https://github.com/SplittyDev.png","language":"Python","readme":"# FLUX.1 Inference CLI\n\u003e Supports MPS (Apple Silicon), CUDA and CPU\n\n![](./banner.png)\n\n## Features\n\n- **Multiple Models**: Supports FLUX.1-schnell and FLUX.1-dev\n- **LoRA Support**: Interactive LoRA picker for easy selection\n- **Cross-Platform**: Supports MPS, CUDA and CPU\n- **Tested on macOS**: Works well on Apple Silicon[^1]\n\n## Installation\n\n**Cloning the repository**:\n```bash\ngit clone https://github.com/SplittyDev/flux1-cli.git\ncd flux1-cli\n```\n\n**Using uv (recommended)**:\n```bash\nuv venv\nsource .venv/bin/activate\nuv pip install -r requirements.txt\npython3 src/main.py\n```\n\n**Using pip**:\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npython3 -m pip install -r requirements.txt\npython3 src/main.py\n```\n\n### Installing LoRAs\n\nSimply put your `.safetensors` files in the `lora` directory.  \nThey will be available immediately when typing `/lora`.\n\n## Prompting\n\n### Inference Modifiers\n\nThe CLI supports various modifiers, which can be added to the end of the prompt, like this:\n- `Photograph of a meadow in a forest /fast`\n- `Photograph of a meadow in a forest /1024x768 /slow`\n- `Photograph of a meadow in a forest /seed=1234 /8`\n\n**List of Modifiers**:\n\n| Modifier           | Description                                                |\n|--------------------|------------------------------------------------------------|\n| `/f`, `/fast`      | Use a small number of inference steps for fast results     |\n| `/s`, `/slow`      | Use a large number of inference steps for accurate results |\n| `/a`, `/again`     | Reuse the previous seed for the next inference             |\n| `/r`, `/random`    | Use a random seed for the next inference                   |\n| `/\u003cn\u003e` if n \u003c 128  | Use this number of inference steps for the next inference  |\n| `/\u003cn\u003e` if n \u003e= 128 | Set the resolution to `nxn`                                |\n| `/\u003cw\u003ex\u003ch\u003e`         | Set the resolution to `wxh`                                |\n\n### Standalone Modifiers\n\nThe CLI also supports standalone modifiers, which only work on their own line.\n\n**List of Standalone Modifiers**:\n\n| Modifier              | Description                   |\n|-----------------------|-------------------------------|\n| `/quit`               | Quit the CLI                  |\n| `/lora`               | Show LoRA picker              |\n| `/lora_scale=\u003cscale\u003e` | Set the LoRA scale to `scale` |\n| `/seed=\u003cseed\u003e`        | Set the seed to `seed`        |\n\n### Tips and Tricks\n\n- Leaving the prompt completely empty will repeat the last prompt\n- You can combine modifiers, like this: `Photograph of a meadow in a forest /fast /seed=1234`\n- You can apply new modifiers without repeating the prompt, like this: `/slow /1024x768`\n- Images are saved in this format: `output/\u003cdate\u003e/\u003ctimestamp\u003e_\u003cseed\u003e.png`\n\n### Example workflows with modifiers\n\n**Annotated example, explaning the thought process**\n\n```ini\n# Initial prompt. Generate images fast, to get a feeling for the prompt.\nλ Prompt: Photograph of a meadow in a forest /fast\n# Refine prompt. Fast mode is still active, no need to repeat it.\nλ Prompt: High resolution photograph of a meadow in a forest\n# This looks nice! Let's generate the same image again, but in slow mode.\nλ Prompt: /again /slow\n# Let's keep the same prompt, but randomize the seed again.\nλ Prompt: /random\n# Let's try it in landscape mode, but fast, to see if it looks better.\nλ Prompt: /1920x1080 /fast\n# Alright, let's call it a day\nλ Prompt: /quit\n```\n\n**Real-world example, using shortcuts and no comments**\n\n```ini\nλ Prompt: Photograph of a moonlit meadow in a mythical forest/f\nλ Prompt: \nλ Prompt: /a/s\nλ Prompt: Stunning photograph of a moonlit meadow in a mythical forest, godrays/r/f\nλ Prompt: /a/s\nλ Prompt: /quit\n```\n\n## Troubleshooting\n\n**I don't have enough VRAM**:\n\u003e You can pass the `--offload-cpu` flag to offload parts of the model to the CPU for lower VRAM usage with a small performance hit. Sadly this doesn't seem to work with MPS. If anyone knows why, please let me know!\n\n**I wanna use the CPU (for whatever reason)**:\n\u003e You can pass the `--force-cpu` flag to force CPU inference. This is not recommended, as it's _much_ slower than MPS or CUDA.\n\n**High resolution images are broken**\n\u003e FLUX.1 has a maximum resolution of 2MP. These are _roughly_ the largest possible sizes[^2]:\n\u003e - 1:1 exact 1448 x 1448, rounded 1408 x 1408\n\u003e - 3:2 exact 1773 x 1182, rounded 1728 x 1152\n\u003e - 4:3 exact 1672 x 1254, rounded 1664 x 1216\n\u003e - 16:9 exact 1936 x 1089, rounded 1920 x 1088\n\u003e - 21:9 exact 2212 x 948, rounded 2176 x 960\n\u003e\n\u003e You can use an upscaler (not included) to increase the resolution.\n\n\u003c!-- Footnotes --\u003e\n\n[^1]: Tested on 2023 Mac Studio, 128GB Unified RAM, 24-Core Apple M2 Ultra\n[^2]: See [this post on Reddit](https://www.reddit.com/r/StableDiffusion/comments/1enxdga/flux_recommended_resolutions_from_01_to_20/). Thanks `u/Aplakka`!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplittydev%2Fflux1-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplittydev%2Fflux1-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplittydev%2Fflux1-cli/lists"}