unispace-gen-edit / README.md
multimodalart's picture
multimodalart HF Staff
Pin gradio 5.50.0 for transformers 4.57 compatibility
2fc754d verified
|
Raw
History Blame Contribute Delete
2.7 kB

A newer version of the Gradio SDK is available: 6.26.0

Upgrade
metadata
title: UniSpace
emoji: 🛰️
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 5.50.0
app_file: app.py
short_description: Unified text-to-image generation and instruction editing
python_version: '3.12'
startup_duration_timeout: 1h
pinned: false
license: mit

UniSpace

Interactive demo of UniSpace: Unified Visual Representation and Scalable Multimodal Modeling — an 8B Qwen3 Mixture-of-Transformers built on a single patch-reparameterized ("PR") visual tokenizer that handles both image generation and instruction-based image editing.

What runs here

The Space loads the released unispace-sft-0012000 checkpoint together with the pr-qwen-vit tokenizer/decoder and exposes the authors' two reference inference paths:

Tab Reference script Settings
Text to image eval/gen/gen_images_qwen3_unified_mot.py 1024², 50 steps, CFG 10, timestep_shift=0.112, cfg_renorm_min=0.9
Instruction editing eval/gen/gen_images_imgedit_qwen3_unified_mot.py --match-ref-size --ref-use-mar (mar_1024 buckets), 50 steps, CFG 10, timestep_shift=0.112, cfg_renorm_min=0.0

Both share one model instance built with the release configuration (max_latent_size=96, share_unified2llm=False, use_spatial_merge_und=True, use_spatial_merge_gen=False, latent_patch_size=1).

The sampling code in unispace_infer.py is copied verbatim from those two scripts; only the argparse/torchrun driver was removed. Model construction differs from the scripts in two ways that are required by the hosting environment, not by the model:

  1. The base Qwen3-8B weights are never downloaded — every language_model.* tensor is present in the UniSpace checkpoint, so only its config and tokenizer are fetched.
  2. The 17-shard fp32 checkpoint is streamed one shard at a time, cast to bf16 and released, and the PatchReparam encoder loads only the Qwen3-VL vision tower (instead of the full 17.5 GB VLM with device_map="cuda:N", which is incompatible with ZeroGPU).

Credits & licensing

UniSpace code and weights are MIT-licensed (© 2026 UniSpace Authors); the vendored unispace/ and patch-reparameterization/ sources carry the upstream Apache-2.0 / MIT notices (LICENSE-UNISPACE, unispace/NOTICE, THIRD_PARTY.md).

The four editing examples in examples/ are the input images from the UniSpace project page gallery, which come from GEdit-Bench (MIT, see THIRD_PARTY.md). Text-to-image example prompts are taken from the UniSpace repository's own test prompt set.