The Dataset Viewer has been disabled on this dataset.

DesignAsCode Image Library

This dataset provides the image retrieval assets used by the DesignAsCode graphic design generation pipeline. It contains a large collection of design element images along with a pre-built FAISS index for semantic retrieval.

The images are sourced from the Crello dataset. We extracted the semantic representation of every element image using sentence-transformers/all-mpnet-base-v2 and built a FAISS index to enable fast text-to-image retrieval.

Files

File Size Description
crello_pngs.tar.gz ~18 GB Archive of ~228K PNG design element images (backgrounds, shapes, icons, photos, etc.)
elements_local.index ~370 MB Pre-built FAISS index for semantic similarity search over all element images
id_mapping_local.json ~4.6 MB JSON mapping from FAISS index positions to image file IDs

How It Works

The DesignAsCode pipeline uses these files during the Retrieve stage:

  1. The planner model generates image prompts for each design layer (e.g., "Abstract geometric background in teal")
  2. Each prompt is encoded into an embedding via sentence-transformers/all-mpnet-base-v2
  3. The FAISS index (elements_local.index) finds the most similar image by vector similarity
  4. The ID mapping (id_mapping_local.json) translates the FAISS result index to an image filename
  5. The corresponding PNG is copied from the image library (crello_pngs/) into the design output

Quick Setup

pip install huggingface_hub

# Download all files
huggingface-cli download Tony1109/crello-image-library --repo-type dataset --local-dir .

# Extract the image archive
tar -xzf crello_pngs.tar.gz

Then place the files in the data/ directory of your DesignAsCode project:

design-as-code/
└── data/
    β”œβ”€β”€ image_library/            # extracted from crello_pngs.tar.gz (renamed)
    β”œβ”€β”€ elements_local.index      # FAISS index
    └── id_mapping_local.json     # index β†’ image ID mapping

See the Quick Start Guide for full instructions.

Citation

@article{liu2025designascode,
  title={DesignAsCode: Bridging Structural Editability and Visual Fidelity in Graphic Design Generation},
  author={Liu, Ziyuan and Sun, Shizhao and Huang, Danqing and Shi, Yingdong and Zhang, Meisheng and Li, Ji and Yu, Jingsong and Bian, Jiang},
  journal={arXiv preprint},
  year={2025},
  url={https://github.com/liuziyuan1109/design-as-code}
}
Downloads last month
120