JoyAI-Image
Awakening Spatial Intelligence in Unified Multimodal Understanding and Generation
🔥🔥🔥 News!!
- 2026.08.05: 🎉 We are excited to release the JoyAI-Video-Edit, a real-time open-ended video editing model!
- 2026.07.17: 🎉 JoyAI-Image-Edit and JoyAI-Image-Edit-Plus now natively support ComfyUI! You can now directly use our workflow in the latest version of ComfyUI without any additional dependencies!
- 2026.06.23: 🎉 We are excited to release the JoyAI-Image-Edit-Plus! Please Check at Hugging Face.
- 2026.05.08: 🎉 Diffusers has merged our PR! Using JoyAI-Image-Edit will be much easier now. See Running with Diffusers for details.
- 2026.05.07: 🎉 Our technical report for Joy-Image is now available on arXiv.
- 2026.04.15: 🎉 We are excited to release the OpenSpatial data engine and the OpenSpatial-3M dataset! You can find the code on GitHub and the data on Hugging Face. If you find this project useful, please consider giving us a ⭐ to show your support!
- 2026.04.11: 🎉 JoyAI-Image-Edit now supports Diffusers! Check out the integration and usage in JoyAI-Image-Edit-Diffusers.
- 2026.04.10: 🎉 We release the Spatial-Edit training dataset and benchmark: JoyAI-Image-SpatialEdit and JoyAI-Image-SpatialEdit-Bench.If you find our work helpful, please consider giving our repository a star—your support is greatly appreciated.
- 2026.04.06: 🎉 The demo for spatial editing is available at Demo, and the demo for general editing can be accessed at Hugging Face Demo.
- 2026.04.02: 🎉 We release the JoyAI-Image-Edit weights. Please Check at Hugging Face and ModelScope.
🐶 JoyAI-Image
JoyAI-Image is a unified multimodal foundation model for image understanding, text-to-image generation, and instruction-guided image editing. It combines an 8B Multimodal Large Language Model (MLLM) with a 16B Multimodal Diffusion Transformer (MMDiT). A central principle of JoyAI-Image is the closed-loop collaboration between understanding, generation, and editing. Stronger spatial understanding improves grounded generation and contrallable editing through better scene parsing, relational grounding, and instruction decomposition, while generative transformations such as viewpoint changes provide complementary evidence for spatial reasoning.
JoyAI-Image Architecture
💎 Highlights
- Unified multimodal foundation: one model family for understanding, generation, and editing through a shared MLLM-MMDiT interface.
- Practical data and training recipe: a scalable pipeline with spatial understanding data (Code, Data), long-text rendering data, editing data (SpatialEdit), and multi-stage optimization strategies.
- Awakened spatial intelligence: stronger spatial understanding, controllable spatial editing, and novel-view-assisted reasoning through a bidirectional loop between understanding and generation.
- Advanced visual generation: strong long-text typography, layout fidelity, multi-view generation, and controllable editing with better preservation of scene structure.
📦 Model Zoo
| Models |
Task |
Description |
Download Link |
| JoyAI-Image-Und |
Multimodal Understanding |
A text–image understanding backbone that enables high-fidelity spatial reasoning and editing-aware perception. |
🤗Hugging Face |
| JoyAI-Image-Edit |
Image Editing |
An instruction-guided image editing model with precise and controllable spatial manipulation. |
🤗Hugging Face🤖ModelScope |
| JoyAI-Image-Edit-Distilled |
Image-Editing |
Distilled version of JoyAI-Image-Edit for faster inference |
To be released |
| JoyAI-Image-Edit-Plus |
Multi-Image Editing |
An instruction-guided model that supports multi-image editing, enabling cross-image composition, consistency, and joint manipulation. |
🤗Hugging Face |
🔍 Visual Overview
Capability Profile
JoyAI-Image demonstrates broad multimodal performance across understanding, synthesis, and editing, with particular strengths in spatial reasoning, long-text rendering, multi-view generation, and controllable editing.
JoyAI-Image Capability Radar
Advanced Text Rendering Showcase
JoyAI-Image is optimized for challenging text-heavy scenarios, including multi-panel comics, dense multi-line text, multilingual typography, long-form layouts, real-world scene text, and handwritten styles.
JoyAI-Image Text Rendering Showcase
Multi-view Generation and Spatial Editing Showcase
JoyAI-Image showcases a spatially grounded generation and editing pipeline that supports multi-view generation, geometry-aware transformations, camera control, object rotation, and precise location-specific object editing. Across these settings, it preserves scene content, structure, and visual consistency while following viewpoint-sensitive instructions more accurately.
JoyAI-Image Multi-view Generation and Spatial Editing Showcase Showcase
Spatial Editing for Spatial Reasoning Showcase
JoyAI-Image poses high-fidelity spatial editing, serving as a powerful catalyst for enhancing spatial reasoning. Compared with Qwen-Image-Edit and Nano Banana Pro, JoyAI-Image-Edit synthesizes the most diagnostic viewpoints by faithfully executing camera motions. These high-fidelity novel views effectively disambiguate complex spatial relations, providing clearer visual evidence for downstream reasoning.
JoyAI-Image Spatial Editing for Spatial Reasoning Showcase
🚀 Quick Start
1. Environment Setup
Requirements: Python >= 3.10, CUDA-capable GPU
Create a virtual environment and install:
conda create -n joyai python=3.10 -y
conda activate joyai
pip install -e .
Note on Flash Attention: Flash Attention 3 is loaded through the kernels library (installed by the command above), which fetches the pre-built kernels-community/flash-attn3 binaries on first use — no local compilation required. Once resolved, the kernel is used exactly like the upstream flash_attn_interface, so behavior is identical.
If your machine is not covered by the pre-built binaries, the code automatically falls back to a local Flash Attention 3 build. Build it from source (the hopper directory of Dao-AILab/flash-attention):
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention/hopper
python setup.py install
If your FA3 build lives outside the import path, point to it with the FLASH_ATTN3_PATH environment variable:
export FLASH_ATTN3_PATH=/path/to/flash-attention/hopper
Core Dependencies
| Package |
Version |
Purpose |
torch |
>= 2.8 |
PyTorch |
transformers |
>= 4.57.0, < 4.58.0 |
Text encoder |
diffusers |
>= 0.34.0 |
Pipeline utilities |
kernels |
latest |
Loads pre-built Flash Attention 3 |
flash-attn |
3 (Hopper build) |
Fallback fast attention kernel |
2. Inference
2.1 Image Understanding
python inference_und.py \
--ckpt-root /path/to/ckpts_infer \
--image "test_images/test_1.jpg,test_images/test3.png" \
--prompt "Compare these two images." \
--max-new-tokens 1024
CLI Reference (inference_und.py)
| Argument |
Type |
Default |
Description |
--ckpt-root |
str |
required |
Checkpoint root containing text_encoder/ |
--image |
str |
required |
Input image path, or comma-separated paths for multiple images |
--prompt |
str |
"Describe this image in detail." |
User question or instruction. When omitted, defaults to image captioning |
--max-new-tokens |
int |
2048 |
Maximum number of tokens to generate |
--temperature |
float |
0.7 |
Sampling temperature. Use 0 for greedy decoding |
--top-p |
float |
0.8 |
Top-p (nucleus) sampling threshold |
--top-k |
int |
50 |
Top-k sampling threshold |
--output |
str |
None |
Optional output file to save the response text |
2.2 Image Editing
python inference.py \
--ckpt-root /path/to/ckpts \
--prompt "Turn the plate blue" \
--image test_images/test_1.jpg \
--output outputs/result.png \
--seed 123 \
--steps 30 \
--guidance-scale 4.0 \
--basesize 1024
CLI Reference (inference.py)
| Argument |
Type |
Default |
Description |
--ckpt-root |
str |
required |
Checkpoint root |
--prompt |
str |
required |
Edit instruction or T2I prompt |
--image |
str |
None |
Input image path (required for editing, omit for T2I) |
--output |
str |
example.png |
Output image path |
--steps |
int |
30 |
Denoising steps |
--guidance-scale |
float |
4.0 |
Classifier-free guidance scale |
--seed |
int |
42 |
Random seed for reproducibility |
--neg-prompt |
str |
"" |
Negative prompt |
--basesize |
int |
1024 |
Bucket base size for input image resizing (256/512/768/1024) |
--config |
str |
auto |
Config path; defaults to <ckpt-root>/infer_config.py |
--rewrite-prompt |
flag |
off |
Enable LLM-based prompt rewriting |
--rewrite-model |
str |
gpt-5 |
Model name for prompt rewriting |
--hsdp-shard-dim |
int |
1 |
FSDP shard dimension for multi-GPU (set to GPU count) |
Diffusers
Install
pip install torch transformers torchvision
pip install git+https://github.com/huggingface/diffusers.git
Note: JoyImageEditPipeline will be included in the next official diffusers release (>0.38.0). Until then, install from source as shown above.
Running with Diffusers
import torch
from diffusers import JoyImageEditPipeline
from diffusers.utils import load_image
pipeline = JoyImageEditPipeline.from_pretrained(
"jdopensource/JoyAI-Image-Edit-Diffusers", torch_dtype=torch.bfloat16
)
pipeline.to("cuda")
img_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"
image = load_image(img_path)
prompt = "Add wings to the astronaut."
output = pipeline(
image=image,
prompt=prompt,
num_inference_steps=40,
guidance_scale=4.0,
generator=torch.Generator("cuda").manual_seed(0),
).images[0]
output.save("joyai_image_edit_output.png")
3. Spatial Editing Reference