Diffusers Format

March 1, 2026 Β· View on GitHub

INFERENCE

Diffusers Format

We provide a diffusers-compatible format at πŸ€—deepgenteam/DeepGen-1.0-diffusers. This is a self-contained pipeline that does not require cloning the DeepGen repository.

Load Pipeline

import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    "deepgenteam/DeepGen-1.0-diffusers",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
)
pipe.to("cuda")

# Optional: enable CPU offload for GPUs with limited memory (< 24GB)
# pipe.enable_model_cpu_offload()

Text-to-Image

result = pipe(
    prompt="a photo of a blue pizza and a yellow baseball glove",
    height=512, width=512,
    num_inference_steps=50,
    guidance_scale=4.0,
    seed=42,
)
result.images[0].save("output.png")

Image Editing

from PIL import Image

source_image = Image.open("input.png").convert("RGB")
result = pipe(
    prompt="Place this guitar on a sandy beach with the sunset in the background.",
    image=source_image,
    negative_prompt="blurry, low quality, low resolution, distorted, deformed, broken content, missing parts, damaged details, artifacts, glitch, noise, pixelated, grainy, compression artifacts, bad composition, wrong proportion, incomplete editing, unfinished, unedited areas.",
    height=512, width=512,
    num_inference_steps=50,
    guidance_scale=4.0,
    seed=42,
)
result.images[0].save("edited.png")

Native Pipeline

Please download our released model weights first from πŸ€—deepgenteam/DeepGen-1.0. It is recommended to use the following command to download the checkpoints

# pip install -U "huggingface_hub[cli]"
huggingface-cli download deepgenteam/DeepGen-1.0  --local-dir checkpoints --repo-type model

# Merge zip
cat DeepGen_CKPT.zip.part-* > DeepGen_CKPT.zip
# Unzip DeepGen checkpoints
unzip DeepGen_CKPT.zip
checkpoints/
β”œβ”€β”€ DeepGen_CKPT
    β”œβ”€β”€Pretrainβ”œβ”€β”€iter_200000.pth
    β”œβ”€β”€ SFTβ”œβ”€β”€iter_400000.pth
    β”œβ”€β”€RLβ”œβ”€β”€MR-GDPO_final.pt

the /path/to/your/ckpt can be both .pth folder or .pt file, if you want only final model state please download model.pt directly in πŸ€—deepgenteam/DeepGen-1.0 , it is same as MR-GDPO_final.pt

Text-to-Image

export PYTHONPATH=.
python scripts/text2image.py
             --checkpoint /path/to/your/ckpt \
             --prompt "a photo of a blue pizza and a yellow baseball glove" \
             --output /path_to_save_result \
             --height 512 --width 512 \
             --seed 42

Image-to-Image (Editing)

export PYTHONPATH=.
python scripts/image2image.py
             --checkpoint /path/to/your/ckpt \
             --prompt "Using the red color, draw one continuous path from the green start to the red end along walkable white cells only. Do not cross walls." \
             --src_img UniREditBench/original_image/maze/1.png \
             --output /path_to_save_result \
             --height 512 --width 512 \
             --seed 42