# Darth-D
[](https://github.com/haesleinhuepf/darth-d/raw/main/LICENSE)
[](https://pypi.org/project/darth-d)
[](https://python.org)
[](https://github.com/haesleinhuepf/darth-d/actions)
[](https://codecov.io/gh/haesleinhuepf/darth-d)
[](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)
[](https://napari-hub.org/plugins/darth-d)
A simple to use image generator based on [OpenAIs DALL-E 2/3](https://openai.com/dall-e-2).
It comes as [napari](https://napari.org/) plugin and has a Python interface.
You need an [OpenAI API KEY](https://openai.com/blog/openai-api/) to use it.
Using some of the functions on scientific images could be seen as scientific misconduct. Handle these functions with care.

## Usage
### From Python
You can generate images from text prompts in Python like this ([see this notebool](https://github.com/haesleinhuepf/darth-d/blob/main/demo/demo_darth-d.ipynb)).
```
from darth_d import create
```
```
image = create("an image of a cat")
image
```

You can also vary images ([see this notebook](https://github.com/haesleinhuepf/darth-d/blob/main/demo/demo_vary.ipynb)):
```
from darth_d import vary
output_image = vary(input_image)
```

Replacing regions in images is also possible. Note: Using this function on scientific images could be seen as scientific misconduct. Handle this function with care.
### In Napari
To generate images in Napari, click the `Tools > Generate > Image` menu. You can for example enter the prompt
"a professional comic with white background showing a cat having an idea. the idea is visualized using a light bulb.

## Installation
```
pip install darth-d
```
If you want to use it from napari, please also install napari and the [tools menu](https://github.com/haesleinhuepf/napari-tools-menu):
```
mamba install napari pyqt napari-tools-menu -c conda-forge
```
## Similar tools and plugins
* https://github.com/kephale/napari-stable-diffusion
* https://github.com/seankmartin/napari-stable-diffusion
## Feedback welcome!
The `darth-d` is developed in the open because we believe in the open source community. Feel free to drop feedback as [github issue](https://github.com/haesleinhuepf/darth-d) or via [image.sc](https://image.sc)
## Contributing
Contributions are very welcome.
## License
Distributed under the terms of the [BSD-3] license,
"darth-d" is free and open source software
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
Raw data
{
"_id": null,
"home_page": "https://github.com/haesleinhuepf/darth-d/",
"name": "darth-d",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Robert Haase",
"author_email": "robert.haase@uni-leipzig.de",
"download_url": "https://files.pythonhosted.org/packages/b8/8b/43b94d21cff011cb59ae0f3dcc311531683edc822bfc6255de9e9cc490e7/darth-d-0.4.0.tar.gz",
"platform": null,
"description": "# Darth-D\r\n[](https://github.com/haesleinhuepf/darth-d/raw/main/LICENSE)\r\n[](https://pypi.org/project/darth-d)\r\n[](https://python.org)\r\n[](https://github.com/haesleinhuepf/darth-d/actions)\r\n[](https://codecov.io/gh/haesleinhuepf/darth-d)\r\n[](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)\r\n[](https://napari-hub.org/plugins/darth-d)\r\n\r\nA simple to use image generator based on [OpenAIs DALL-E 2/3](https://openai.com/dall-e-2).\r\nIt comes as [napari](https://napari.org/) plugin and has a Python interface. \r\nYou need an [OpenAI API KEY](https://openai.com/blog/openai-api/) to use it.\r\n\r\nUsing some of the functions on scientific images could be seen as scientific misconduct. Handle these functions with care.\r\n\r\n\r\n\r\n## Usage\r\n\r\n### From Python\r\n\r\nYou can generate images from text prompts in Python like this ([see this notebool](https://github.com/haesleinhuepf/darth-d/blob/main/demo/demo_darth-d.ipynb)).\r\n\r\n```\r\nfrom darth_d import create\r\n```\r\n\r\n```\r\nimage = create(\"an image of a cat\")\r\n\r\nimage\r\n```\r\n\r\n\r\n\r\nYou can also vary images ([see this notebook](https://github.com/haesleinhuepf/darth-d/blob/main/demo/demo_vary.ipynb)):\r\n```\r\nfrom darth_d import vary\r\n\r\noutput_image = vary(input_image)\r\n```\r\n\r\n\r\n\r\nReplacing regions in images is also possible. Note: Using this function on scientific images could be seen as scientific misconduct. Handle this function with care.\r\n\r\n### In Napari\r\n\r\nTo generate images in Napari, click the `Tools > Generate > Image` menu. You can for example enter the prompt\r\n\"a professional comic with white background showing a cat having an idea. the idea is visualized using a light bulb.\r\n\r\n\r\n\r\n\r\n## Installation\r\n\r\n```\r\npip install darth-d\r\n```\r\n\r\nIf you want to use it from napari, please also install napari and the [tools menu](https://github.com/haesleinhuepf/napari-tools-menu):\r\n\r\n```\r\nmamba install napari pyqt napari-tools-menu -c conda-forge\r\n```\r\n\r\n## Similar tools and plugins\r\n\r\n* https://github.com/kephale/napari-stable-diffusion\r\n* https://github.com/seankmartin/napari-stable-diffusion\r\n\r\n## Feedback welcome!\r\n\r\nThe `darth-d` is developed in the open because we believe in the open source community. Feel free to drop feedback as [github issue](https://github.com/haesleinhuepf/darth-d) or via [image.sc](https://image.sc)\r\n\r\n## Contributing\r\n\r\nContributions are very welcome. \r\n\r\n## License\r\n\r\nDistributed under the terms of the [BSD-3] license,\r\n\"darth-d\" is free and open source software\r\n\r\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\r\n\r\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A simple to use image generator based on OpenAIs DALL-E",
"version": "0.4.0",
"project_urls": {
"Bug Tracker": "https://github.com/haesleinhuepf/darth-d/issues",
"Documentation": "https://github.com/haesleinhuepf/darth-d/",
"Homepage": "https://github.com/haesleinhuepf/darth-d/",
"Source Code": "https://github.com/haesleinhuepf/darth-d",
"User Support": "https://forum.image.sc/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "992df852998375527457c6bd557b2601dd427a475bda688b372da320ecc9013b",
"md5": "f93a0c80d22a9486e4dba7f00db876d2",
"sha256": "f7e31f3cdb5f41c7763e5cea8ff31718b33dbf49c910c836276a897a7333df03"
},
"downloads": -1,
"filename": "darth_d-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f93a0c80d22a9486e4dba7f00db876d2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9073,
"upload_time": "2023-11-21T09:21:43",
"upload_time_iso_8601": "2023-11-21T09:21:43.652877Z",
"url": "https://files.pythonhosted.org/packages/99/2d/f852998375527457c6bd557b2601dd427a475bda688b372da320ecc9013b/darth_d-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b88b43b94d21cff011cb59ae0f3dcc311531683edc822bfc6255de9e9cc490e7",
"md5": "e6c196ca6eb3ee859c77fa8470beacd3",
"sha256": "4003422b4315c98406cd8b9b4e02dd2e6dd894eabec1e93325d797561f95e18f"
},
"downloads": -1,
"filename": "darth-d-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "e6c196ca6eb3ee859c77fa8470beacd3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8443,
"upload_time": "2023-11-21T09:21:45",
"upload_time_iso_8601": "2023-11-21T09:21:45.047387Z",
"url": "https://files.pythonhosted.org/packages/b8/8b/43b94d21cff011cb59ae0f3dcc311531683edc822bfc6255de9e9cc490e7/darth-d-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-21 09:21:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "haesleinhuepf",
"github_project": "darth-d",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "darth-d"
}