{"id":15235417,"url":"https://github.com/replicate/cog-flux","last_synced_at":"2025-05-16T04:07:19.869Z","repository":{"id":257804468,"uuid":"835378168","full_name":"replicate/cog-flux","owner":"replicate","description":"Cog inference for flux models","archived":false,"fork":false,"pushed_at":"2025-05-13T21:15:47.000Z","size":2777,"stargazers_count":347,"open_issues_count":20,"forks_count":53,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-16T01:34:24.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://replicate.com/black-forest-labs/flux-dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replicate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-29T17:56:38.000Z","updated_at":"2025-05-13T21:15:51.000Z","dependencies_parsed_at":"2024-11-04T20:25:02.185Z","dependency_job_id":"edd1cff0-a37e-4cb9-8697-0eaba928a760","html_url":"https://github.com/replicate/cog-flux","commit_stats":{"total_commits":65,"total_committers":10,"mean_commits":6.5,"dds":0.7384615384615385,"last_synced_commit":"83b1af749cb25831a38399e7fff9b761b604152d"},"previous_names":["replicate/cog-flux"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-flux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-flux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-flux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fcog-flux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/cog-flux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464897,"owners_count":22075571,"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":[],"created_at":"2024-09-29T08:01:41.884Z","updated_at":"2025-05-16T04:07:19.248Z","avatar_url":"https://github.com/replicate.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# cog-flux\n\nThis is a [Cog](https://cog.run) inference model for FLUX.1 [schnell] and FLUX.1 [dev] by [Black Forest Labs](https://blackforestlabs.ai/). It powers the following Replicate models:\n\n* https://replicate.com/black-forest-labs/flux-schnell\n* https://replicate.com/black-forest-labs/flux-dev\n\n## Features\n\n* Compilation with `torch.compile`\n* Optional fp8 quantization based on [aredden/flux-fp8-api](https://github.com/aredden/flux-fp8-api), using fast CuDNN attention from Pytorch nightlies\n* NSFW checking with [CompVis](https://huggingface.co/CompVis/stable-diffusion-safety-checker) and [Falcons.ai](https://huggingface.co/Falconsai/nsfw_image_detection) safety checkers\n* img2img support\n\n## Getting started\n\nIf you just want to use the models, you can run [FLUX.1 [schnell]](https://replicate.com/black-forest-labs/flux-schnell) and [FLUX.1 [dev]](https://replicate.com/black-forest-labs/flux-dev) on Replicate with an API or in the browser.\n\nThe code in this repo can be used as a template for customizations on FLUX.1, or to run the models on your own hardware.\n\nFirst you need to select which model to run:\n\n```shell\nscript/select.sh {dev,schnell}\n```\n\nThen you can run a single prediction on the model using:\n\n```shell\ncog predict -i prompt=\"a cat in a hat\"\n```\n\nThe [Cog getting started guide](https://cog.run/getting-started/) explains what Cog is and how it works.\n\nTo deploy it to Replicate, run:\n\n```shell\ncog login\ncog push r8.im/\u003cyour-username\u003e/\u003cyour-model-name\u003e\n```\n\nLearn more on [the deploy a custom model guide in the Replicate documentation](https://replicate.com/docs/guides/deploy-a-custom-model).\n\n## Contributing\n\nPull requests and issues are welcome! If you see a novel technique or feature you think will make FLUX.1 inference better or faster, let us know and we'll do our best to integrate it.\n\n## Rough, partial roadmap\n\n* Serialize quantized model instead of quantizing on the fly\n* Use row-wise quantization\n* Port quantization and compilation code over to https://github.com/replicate/flux-fine-tuner\n\n## License\n\nThe code in this repository is licensed under the [Apache-2.0 License](LICENSE).\n\nFLUX.1 [dev] falls under the [`FLUX.1 [dev]` Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md).\n\nFLUX.1 [schnell] falls under the [Apache-2.0 License](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fcog-flux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Fcog-flux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fcog-flux/lists"}