# diffuzers
A web ui and deployable API for [🤗 diffusers](https://github.com/huggingface/diffusers).
< under development, request features using issues, prs not accepted atm >
<a target="_blank" href="https://colab.research.google.com/github/abhishekkrthakur/diffuzers/blob/main/diffuzers.ipynb">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>
<a href='https://diffuzers.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/diffuzers/badge/?version=latest' alt='Documentation Status' />
</a>
![image](https://github.com/abhishekkrthakur/diffuzers/raw/main/static/screenshot.jpeg)
If something doesnt work as expected, or if you need some features which are not available, then create request using [github issues](https://github.com/abhishekkrthakur/diffuzers/issues)
## Features available in the app:
- text to image
- image to image
- instruct pix2pix
- textual inversion
- inpainting
- outpainting (coming soon)
- image info
- stable diffusion upscaler
- gfpgan
- clip interrogator
- more coming soon!
## Features available in the api:
- text to image
- image to image
- instruct pix2pix
- textual inversion
- inpainting
- outpainting (via inpainting)
- more coming soon!
## Installation
To install bleeding edge version of diffuzers, clone the repo and install it using pip.
```bash
git clone https://github.com/abhishekkrthakur/diffuzers
cd diffuzers
pip install -e .
```
Installation using pip:
```bash
pip install diffuzers
```
## Usage
### Web App
To run the web app, run the following command:
```bash
diffuzers app
```
### API
To run the api, run the following command:
```bash
diffuzers api
```
Starting the API requires the following environment variables:
```
export X2IMG_MODEL=stabilityai/stable-diffusion-2-1
export DEVICE=cuda
```
If you want to use inpainting:
```
export INPAINTING_MODEL=stabilityai/stable-diffusion-2-inpainting
```
To use long prompt weighting, use:
```
export PIPELINE=lpw_stable_diffusion
```
If you have `OUTPUT_PATH` in environment variables, all generations will be saved in `OUTPUT_PATH`. You can also use other (or private) huggingface models. To use private models, you must login using `huggingface-cli login`.
API docs are available at `host:port/docs`. For example, with default settings, you can access docs at: `127.0.0.1:10000/docs`.
## All CLI Options for running the app:
```bash
❯ diffuzers app --help
usage: diffuzers <command> [<args>] app [-h] [--output OUTPUT] [--share] [--port PORT] [--host HOST]
[--device DEVICE] [--ngrok_key NGROK_KEY]
✨ Run diffuzers app
optional arguments:
-h, --help show this help message and exit
--output OUTPUT Output path is optional, but if provided, all generations will automatically be saved to this
path.
--share Share the app
--port PORT Port to run the app on
--host HOST Host to run the app on
--device DEVICE Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.
--ngrok_key NGROK_KEY
Ngrok key to use for sharing the app. Only required if you want to share the app
```
## All CLI Options for running the api:
```bash
❯ diffuzers api --help
usage: diffuzers <command> [<args>] api [-h] [--output OUTPUT] [--port PORT] [--host HOST] [--device DEVICE]
[--workers WORKERS]
✨ Run diffuzers api
optional arguments:
-h, --help show this help message and exit
--output OUTPUT Output path is optional, but if provided, all generations will automatically be saved to this
path.
--port PORT Port to run the app on
--host HOST Host to run the app on
--device DEVICE Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.
--workers WORKERS Number of workers to use
```
## Using private models from huggingface hub
If you want to use private models from huggingface hub, then you need to login using `huggingface-cli login` command.
Note: You can also save your generations directly to huggingface hub if your output path points to a huggingface hub dataset repo and you have access to push to that repository. Thus, you will end up saving a lot of disk space.
Raw data
{
"_id": null,
"home_page": "https://github.com/abhishekkrthakur/diffuzers",
"name": "diffuzers",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "diffuzers diffusers",
"author": "Abhishek Thakur",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b0/be/82e648e8d96a2a0f0485f8a16f8cff1e682af6ab0acf4dc3af4fc2d49b67/diffuzers-0.3.5.tar.gz",
"platform": null,
"description": "# diffuzers\n\nA web ui and deployable API for [\ud83e\udd17 diffusers](https://github.com/huggingface/diffusers).\n\n< under development, request features using issues, prs not accepted atm >\n\n<a target=\"_blank\" href=\"https://colab.research.google.com/github/abhishekkrthakur/diffuzers/blob/main/diffuzers.ipynb\">\n <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n</a>\n\n<a href='https://diffuzers.readthedocs.io/en/latest/?badge=latest'>\n <img src='https://readthedocs.org/projects/diffuzers/badge/?version=latest' alt='Documentation Status' />\n</a>\n\n![image](https://github.com/abhishekkrthakur/diffuzers/raw/main/static/screenshot.jpeg)\n\n\nIf something doesnt work as expected, or if you need some features which are not available, then create request using [github issues](https://github.com/abhishekkrthakur/diffuzers/issues)\n\n\n## Features available in the app:\n\n- text to image\n- image to image\n- instruct pix2pix\n- textual inversion\n- inpainting\n- outpainting (coming soon)\n- image info\n- stable diffusion upscaler\n- gfpgan\n- clip interrogator\n- more coming soon!\n\n## Features available in the api:\n\n- text to image\n- image to image\n- instruct pix2pix\n- textual inversion\n- inpainting\n- outpainting (via inpainting)\n- more coming soon!\n\n\n## Installation\n\nTo install bleeding edge version of diffuzers, clone the repo and install it using pip.\n\n```bash\ngit clone https://github.com/abhishekkrthakur/diffuzers\ncd diffuzers\npip install -e .\n```\n\nInstallation using pip:\n \n```bash \npip install diffuzers\n```\n\n## Usage\n\n### Web App\nTo run the web app, run the following command:\n\n```bash\ndiffuzers app\n```\n\n### API\n\nTo run the api, run the following command:\n\n\n```bash\ndiffuzers api\n```\n\nStarting the API requires the following environment variables:\n\n```\nexport X2IMG_MODEL=stabilityai/stable-diffusion-2-1\nexport DEVICE=cuda\n```\n\nIf you want to use inpainting:\n\n```\nexport INPAINTING_MODEL=stabilityai/stable-diffusion-2-inpainting\n```\n\nTo use long prompt weighting, use:\n\n```\nexport PIPELINE=lpw_stable_diffusion\n```\n\nIf you have `OUTPUT_PATH` in environment variables, all generations will be saved in `OUTPUT_PATH`. You can also use other (or private) huggingface models. To use private models, you must login using `huggingface-cli login`.\n\nAPI docs are available at `host:port/docs`. For example, with default settings, you can access docs at: `127.0.0.1:10000/docs`.\n\n\n## All CLI Options for running the app:\n\n```bash\n\u276f diffuzers app --help\nusage: diffuzers <command> [<args>] app [-h] [--output OUTPUT] [--share] [--port PORT] [--host HOST]\n [--device DEVICE] [--ngrok_key NGROK_KEY]\n\n\u2728 Run diffuzers app\n\noptional arguments:\n -h, --help show this help message and exit\n --output OUTPUT Output path is optional, but if provided, all generations will automatically be saved to this\n path.\n --share Share the app\n --port PORT Port to run the app on\n --host HOST Host to run the app on\n --device DEVICE Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.\n --ngrok_key NGROK_KEY\n Ngrok key to use for sharing the app. Only required if you want to share the app\n```\n\n## All CLI Options for running the api:\n\n```bash\n\u276f diffuzers api --help\nusage: diffuzers <command> [<args>] api [-h] [--output OUTPUT] [--port PORT] [--host HOST] [--device DEVICE]\n [--workers WORKERS]\n\n\u2728 Run diffuzers api\n\noptional arguments:\n -h, --help show this help message and exit\n --output OUTPUT Output path is optional, but if provided, all generations will automatically be saved to this\n path.\n --port PORT Port to run the app on\n --host HOST Host to run the app on\n --device DEVICE Device to use, e.g. cpu, cuda, cuda:0, mps (for m1 mac) etc.\n --workers WORKERS Number of workers to use\n```\n\n## Using private models from huggingface hub\n\nIf you want to use private models from huggingface hub, then you need to login using `huggingface-cli login` command.\n\nNote: You can also save your generations directly to huggingface hub if your output path points to a huggingface hub dataset repo and you have access to push to that repository. Thus, you will end up saving a lot of disk space. \n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "diffuzers",
"version": "0.3.5",
"split_keywords": [
"diffuzers",
"diffusers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c3c92050803bbefbeddc09b0fd5ec5eb3ee591e8fe1e5be87d82483ac954a54",
"md5": "ae158b5c3a9f8f4c9e55498160593ff7",
"sha256": "facfb1bc20ed5d66ee4303125f2937cc196139aeadc3435bd08e0c22e45b6b9d"
},
"downloads": -1,
"filename": "diffuzers-0.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ae158b5c3a9f8f4c9e55498160593ff7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 842536,
"upload_time": "2023-02-10T12:41:19",
"upload_time_iso_8601": "2023-02-10T12:41:19.525874Z",
"url": "https://files.pythonhosted.org/packages/5c/3c/92050803bbefbeddc09b0fd5ec5eb3ee591e8fe1e5be87d82483ac954a54/diffuzers-0.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0be82e648e8d96a2a0f0485f8a16f8cff1e682af6ab0acf4dc3af4fc2d49b67",
"md5": "93dba8876a2d28e6bbf001b1d34aca00",
"sha256": "ebca88133383d70f08a499885bf8797157757cf04dca39aeb60af7f6b9d9da61"
},
"downloads": -1,
"filename": "diffuzers-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "93dba8876a2d28e6bbf001b1d34aca00",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 825946,
"upload_time": "2023-02-10T12:41:21",
"upload_time_iso_8601": "2023-02-10T12:41:21.491998Z",
"url": "https://files.pythonhosted.org/packages/b0/be/82e648e8d96a2a0f0485f8a16f8cff1e682af6ab0acf4dc3af4fc2d49b67/diffuzers-0.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-10 12:41:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "abhishekkrthakur",
"github_project": "diffuzers",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "diffuzers"
}