viz2viz: Prompt-driven stylized visualization generation using a diffusion model

Jiaqi Wu, John Joon Young Chung, Eytan AdararXiv 2023

TL;DR

viz2viz is a novel system that leverages diffusion models to transform standard, abstract charts into creative, "stylized" visualizations—like a bar chart made of stacked coffee cups or a pie chart rendered as a bird's-eye view of a city. By employing a specialized three-step "recipe" (Sketch-Synthesize-Refine), the system ensures these artistic outputs remain data-accurate while achieving high visual coherence.

What Problem Does This Paper Address?

Data visualization software typically produces abstract geometric marks: rectangles for bars, arcs for pie slices, and circles for scatter plots. While functional, these are often insufficient for designers who want to create engaging infographics or "photovisualizations."

Manually creating stylized charts—for instance, photographing a physical model of a bar chart made of candles—is incredibly tedious. Conversely, while modern generative AI tools like Stable Diffusion or DALL-E can create beautiful images from text prompts, they are notoriously difficult to "contain." If you ask a standard AI to draw a "bar chart made of candles," the heights of those candles will be aesthetically pleasing but mathematically meaningless. Existing techniques like img2img or ControlNet often struggle with the "flexibility vs. fidelity" trade-off: they either follow the original chart too strictly (failing to transform the shape into a realistic object) or ignore the data entirely.

Methods

The authors propose a central "recipe" to bridge the gap between creative freedom and data integrity. The workflow consists of three main stages:

  1. Sketch: The system "deconstructs" the input chart. It generates individual stylized marks (e.g., a single realistic bottle or a stack of cans) in isolation, often using an $N \times N$ grid to ensure each data point is rendered clearly. These are then reassembled into the original chart's layout.
  2. Synthesize: This is the core of the process. To prevent the "Frankenstein" look of the reassembled sketch, the system uses a diffusion pipeline to make the scene cohesive (adding consistent lighting, shadows, and textures).
  3. Innovation: Diffusion with Multiple Prompts (DMP): To allow different marks to have different styles (e.g., Bar A is a skyscraper, Bar B is a pagoda), the authors developed DMP. It performs diffusion on the whole image latent separately for each prompt and then uses masks to combine them, preventing "prompt bleeding" where styles accidentally blend.
  4. Refine: A final low-strength pass to clean up artifacts, improve resolution, and sharpen details.
The viz2viz workflow: Sketching individual marks, synthesizing them into a cohesive scene, and refining for detail.

Datasets

The researchers did not train a new model from scratch; instead, they built upon pre-trained Stable Diffusion (v1.5 and v2.1) models. To ground their work, they:

  • Collected a taxonomy of 250 human-created stylized visualizations from the web to identify common design patterns (e.g., "One-to-One" vs. "One-to-Many" marks).
  • Evaluated their system using a benchmark of 192 generated images across four chart types (bar, pie, area, and network) using prompts sourced from real-world design communities.

Key Insights and Ideas

  • Deconstruction is Key: You cannot stylize a complex chart in one go without losing data. By breaking the chart into its constituent marks (the "Sketch" step), the system anchors the generative process to the data before the "AI" takes over the aesthetics.
  • The Latent Masking "Aha": The DMP pipeline solves a major headache in generative AI. By masking at the latent level during the iterative denoising process, the system can maintain a coherent global scene while giving each data mark its own unique identity.
  • Heuristic Elongation: Since AI models often generate objects in standard aspect ratios, the authors implemented a "head-body-tail" heuristic. To make a pencil represent a tall bar, the system elongates only the "body" (the middle third) of the generated pencil, keeping the tip and eraser proportional.

Key Results

The authors conducted a user study with three evaluators who compared viz2viz against three baselines (img2img, depth2img, and ControlNet).

  • Information Preservation: viz2viz significantly outperformed baselines, ensuring that the heights of bars and areas of pie slices remained accurate to the source data.
  • Prompt Alignment: Users found that viz2viz followed complex text prompts (like "realistic stacks of red coca-cola cans") much more effectively than standard methods.
  • Aesthetics and Cohesiveness: The "Synthesize" and "Refine" steps resulted in images that were rated as more visually pleasing and "belonging to the same scene" compared to simple image-to-image translations.
Fig. 1: viz2viz generated samples (original data inset). From left to right: bird eye view of green forests with many trees, blue ocean with ships, grey city with many buildings, orange deserts; realistic stacks of red coca-cola coke cans, brown tea cups, glass wine bottles, starbucks paper coffee cups; realistic pink tulips; Ukiyo-e style side view of red wooden roller coaster, Ukiyo-e style blue sea waves and surfers. Note that in some examples in this paper, we select prompts to demonstrate the capabilities of viz2viz rather than for their aesthetic or design qualities.

Limitations and Future Work

  • Prompt Sensitivity: Like all diffusion-based tools, results are highly dependent on "prompt engineering." Some objects (like medical syringes) are harder for the underlying model to render accurately than others (like coffee cups).
  • Semantic Understanding: The system doesn't truly "know" what it's drawing. It can't yet handle requests like "make the bar height represent the amount of liquid inside a glass" rather than the height of the glass itself.
  • Scalability: As the number of marks increases (e.g., a scatter plot with 100 points), the diffusion process may cause marks to blend improperly. Future work aims to optimize the reconstruction of high-density visualizations.

Summary updated

BibTeX
@misc{wu2023viz,
  author = {Jiaqi Wu and John Joon Young Chung and Eytan Adar},
  title = {{viz2viz: Prompt-driven stylized visualization generation using a diffusion model}},
  year = {2023},
  eprint = {2304.01919},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.01919},
}
Figure