$git clone https://github.com/poloclub/diffusiondbDiffusionDB is the first large-scale text-to-image prompt dataset. It contains 14 million images generated by Stable Diffusion using prompts and hyperparameters specified by real users. The unprecedented scale and diversity of this human-actuated dataset provide exciting rese
| 1 | # DiffusionDB <a href="https://huggingface.co/datasets/poloclub/diffusiondb"><picture><source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/yGxUUlX.png"><img src="favicon.ico" align="right" src="favicon.ico" height="40px"></picture> |
| 2 | |
| 3 | [](https://huggingface.co/datasets/poloclub/diffusiondb) |
| 4 | [](#licensing) |
| 5 | [](https://arxiv.org/abs/2210.14896) |
| 6 | [](https://poloclub.github.io/diffusiondb/datasheet.html) |
| 7 | <!-- [](https://doi.org/10.1145/3491101.3519653) --> |
| 8 | |
| 9 | <img width="100%" src="https://user-images.githubusercontent.com/15007159/201762588-f24db2b8-dbb2-4a94-947b-7de393fc3d33.gif"> |
| 10 | |
| 11 | DiffusionDB is the first large-scale text-to-image prompt dataset. It contains **14 million images** generated by Stable Diffusion using prompts and hyperparameters specified by real users. The unprecedented scale and diversity of this human-actuated dataset provide exciting research opportunities in understanding the interplay between prompts and generative models, detecting deepfakes, and designing human-AI interaction tools to help users more easily use these models. |
| 12 | |
| 13 | ## Get Started |
| 14 | |
| 15 | DiffusionDB is available at [🤗 Hugging Face Datasets](https://huggingface.co/datasets/poloclub/diffusiondb). |
| 16 | |
| 17 | ## Two Subsets |
| 18 | |
| 19 | DiffusionDB provides two subsets (DiffusionDB 2M and DiffusionDB Large) to support different needs. |
| 20 | |
| 21 | |Subset|Num of Images|Num of Unique Prompts|Size|Image Directory|Metadata Table| |
| 22 | |:--|--:|--:|--:|--:|--:| |
| 23 | |DiffusionDB 2M|2M|1.5M|1.6TB|`images/`|`metadata.parquet`| |
| 24 | |DiffusionDB Large|14M|1.8M|6.5TB|`diffusiondb-large-part-1/` `diffusiondb-large-part-2/`|`metadata-large.parquet`| |
| 25 | |
| 26 | ##### Key Differences |
| 27 | |
| 28 | 1. Two subsets have a similar number of unique prompts, but DiffusionDB Large has much more images. DiffusionDB Large is a superset of DiffusionDB 2M. |
| 29 | 2. Images in DiffusionDB 2M are stored in `png` format; images in DiffusionDB Large use a lossless `webp` format. |
| 30 | |
| 31 | ## Dataset Structure |
| 32 | |
| 33 | We use a modularized file structure to distribute DiffusionDB. The 2 million images in DiffusionDB 2M are split into 2,000 folders, where each folder contains 1,000 images and a JSON file that links these 1,000 images to their prompts and hyperparameters. Similarly, the 14 million images in DiffusionDB Large are split into 14,000 folders. |
| 34 | |
| 35 | ```bash |
| 36 | # DiffusionDB 2M |
| 37 | ./ |
| 38 | ├── images |
| 39 | │ ├── part-000001 |
| 40 | │ │ ├── 3bfcd9cf-26ea-4303-bbe1-b095853f5360.png |
| 41 | │ │ ├── 5f47c66c-51d4-4f2c-a872-a68518f44adb.png |
| 42 | │ │ ├── 66b428b9-55dc-4907-b116-55aaa887de30.png |
| 43 | │ │ ├── [...] |
| 44 | │ │ └── part-000001.json |
| 45 | │ ├── part-000002 |
| 46 | │ ├── part-000003 |
| 47 | │ ├── [...] |
| 48 | │ └── part-002000 |
| 49 | └── metadata.parquet |
| 50 | ``` |
| 51 | |
| 52 | ```bash |
| 53 | # DiffusionDB Large |
| 54 | ./ |
| 55 | ├── diffusiondb-large-part-1 |
| 56 | │ ├── part-000001 |
| 57 | │ │ ├── 0a8dc864-1616-4961-ac18-3fcdf76d3b08.webp |
| 58 | │ │ ├── 0a25cacb-5d91-4f27-b18a-bd423762f811.webp |
| 59 | │ │ ├── 0a52d584-4211-43a0-99ef-f5640ee2fc8c.webp |
| 60 | │ │ ├── [...] |
| 61 | │ │ └── part-000001.json |
| 62 | │ ├── part-000002 |
| 63 | │ ├── part-000003 |
| 64 | │ ├── [...] |
| 65 | │ └── part-010000 |
| 66 | ├── diffusiondb-large-part-2 |
| 67 | │ ├── part-010001 |
| 68 | │ │ ├── 0a68f671-3776-424c-91b6-c09a0dd6fc2d.webp |
| 69 | │ │ ├── 0a0756e9-1249-4fe2-a21a-12c43656c7a3.webp |
| 70 | │ │ ├── 0aa48f3d-f2d9-40a8-a800-c2c651ebba06.webp |
| 71 | │ │ ├── [...] |
| 72 | │ │ └── part-010001.json |
| 73 | │ ├── part-010002 |
| 74 | │ ├── part-010003 |
| 75 | │ ├── [...] |
| 76 | │ └── part-014000 |
| 77 | └── metadata-large.parquet |
| 78 | ``` |
| 79 | |
| 80 | These sub-folders have names `part-0xxxxx`, and each image has a unique name generated by [UUID Version 4](https://en.wikipedia.org/wiki/Universally_unique_identifier). The JSON file in a sub-folder has the same name as the sub-folder. Each image is a `PNG` file (DiffusionDB 2M) |