UniEM-Gen / README.md
NNNan's picture
Update README.md
a35795b verified
|
raw
history blame
2.25 kB
metadata
library_name: diffusers
datasets:
  - NNNan/UniEM-3M
base_model:
  - stabilityai/stable-diffusion-xl-base-1.0
pipeline_tag: text-to-image
tags:
  - materials
  - microstructure
  - electron_micrograph
  - characterization

UniEM-Gen

πŸ“˜ Model Summary

This is the text-to-image diffusion model trained on the complete UniEM-3M dataset.
It is designed for electron microscopy (EM)-style image generation, enabling:

  • Scientific data augmentation
  • Proxy generation for microstructural distributions
  • Multimodal research in materials science

πŸš€ Usage Example

Using diffusers

from diffusers import StableDiffusionPipeline
import torch

# Load model from Hugging Face
model_id = "NNNan/UniEM-Gen"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

# Example prompt, sampled from UniEM-3M.
prompt = "SEM of Ceramic Powder: A mix of plate-like and rod-shaped particles. nanostructured. high density. densely packed and agglomerated. Multilayer. Wide range of particle sizes. Grayscale particles on a dark background."

# Generate image
image = pipe(prompt).images[0]

# Save or display
image.save("generated_em.png")
image.show()

πŸ”„ Flexible Prompt Composition

The prompts used in UniEM-Gen are highly modular β€” keywords describing morphology, structure, color, and texture can be freely combined to generate diverse electron micrographs. This compositional flexibility allows users to craft custom prompts by mixing and matching descriptive terms.

You can randomly sample one term from each of the nine attribute categories defined in the UniEM-3M, then assemble them into a coherent prompt using the following structured template:

<microscopy_type> of <subject>: <morphology>. <surface_texture>. <particle_density>. <distribution>. <layering>. <pixel_size_profile>. <color_profile>.
πŸ’¬ Replace each <...> placeholder with a real value from the corresponding category.

πŸ–ΌοΈ Example Outputs

Generated Example