LongCat-Image:基于多语言技术的图像生成基础模型项目

https://github.com/meituan-longcat/LongCat-Image.git

分支1Tags0
文件最后提交记录最后更新时间
1 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
1 个月前
6 个月前
6 个月前
6 个月前

LongCat-Image

LongCat-Image

模型介绍

我们推出了LongCat-Image,这是一款开创性的开源双语(中英文)图像生成基础模型。该模型旨在解决当前主流模型在多语言文本渲染、照片真实感、部署效率以及开发者可访问性等方面存在的核心挑战。

LongCat-Image Model Architecture

核心特性

  • 🌟 卓越的效率与性能:LongCat-Image 仅需 60 亿参数,就在多项基准测试中超越了众多规模数倍于它的开源模型,充分展现了高效模型设计的巨大潜力。
  • 🌟 出色的编辑性能:LongCat-Image-Edit 模型在开源模型中实现了领先性能,不仅指令遵循能力和图像质量出众,还具备更优的视觉一致性。
  • 🌟 强大的中文文本渲染:与现有的 SOTA 开源模型相比,LongCat-Image 在常见中文字符的渲染准确性和稳定性方面表现更优,并且实现了行业领先的中文字典覆盖率。
  • 🌟 卓越的照片真实感:通过创新的数据策略和训练框架,LongCat-Image 生成的图像达到了令人瞩目的照片级真实感。
  • 🌟 完善的开源生态系统:我们提供了从中间检查点到完整训练代码的全套工具链,大幅降低了进一步研究和开发的门槛。

最新动态

  • 🔥 [2026-03-22] LongCat-Image 和 LongCat-Image-Edit(-Turbo) 现已支持 ComfyUI
  • 🔥 [2026-02-03] 我们发布了 LongCat-Image-Edit-Turbo!它是 LongCat-Image-Edit 的蒸馏版本,实现了 10 倍的速度提升。
  • 🔥 [2025-12-16] LongCat-Image 现已完全支持 Diffusers
  • 🔥 [2025-12-09] T2I-CoreBench 结果公布!LongCat-Image 在综合性能上位列所有开源模型的 第 2 名,仅次于拥有 320 亿参数的 Flux2.dev。
  • 🔥 [2025-12-08] 我们在 arXiv 上发布了 技术报告
  • 🔥 [2025-12-05] 我们在 Hugging FaceModelScope 上发布了 LongCat-Image、LongCat-Image-Dev 和 LongCat-Image-Image 的权重。

展示案例

文本生成图像

LongCat-Image Generation Examples

图像编辑

LongCat-Image-Edit Generation Examples

快速开始

安装

# create conda environment
conda create -n longcat-image python=3.10
conda activate longcat-image

# install requirements for model inference
pip install -r infer_requirements.txt
pip install -U diffusers

模型下载

模型 类型 说明 下载链接
LongCat-Image Text-to-Image 正式发布版本。可直接用于推理的标准模型。 🤗 Huggingface
LongCat-Image-Dev Text-to-Image 开发版本。训练中期检查点,适用于微调。 🤗 Huggingface
LongCat-Image-Edit Image Editing 专用于图像编辑的模型。 🤗 Huggingface
LongCat-Image-Edit-Turbo Image Editing LongCat-Image-Edit 的蒸馏版本,速度提升 10 倍。 🤗 Huggingface

运行文本到图像生成

Tip

利用更强的LLM进行提示词优化,可以进一步提升图像生成质量。详细使用说明请参考inference_t2i.py

Caution

📝 文本渲染的特殊处理

对于涉及文本生成的文本到图像和图像编辑任务,必须将目标文本用单引号或双引号括起来(支持英文'...' / "..."和中文‘...’ / “...”格式)。

原因:模型对引号内的内容采用专门的字符级编码策略。若未使用显式引号,将无法触发该机制,从而严重影响文本渲染效果。

import torch
from diffusers import LongCatImagePipeline

if __name__ == '__main__':
    device = torch.device('cuda')

    pipe = LongCatImagePipeline.from_pretrained("meituan-longcat/LongCat-Image", torch_dtype= torch.bfloat16 )
    # pipe.to(device, torch.bfloat16)  # Uncomment for high VRAM devices (Faster inference)
    pipe.enable_model_cpu_offload()  # Offload to CPU to save VRAM (Required ~17 GB); slower but prevents OOM

    prompt = '一个年轻的亚裔女性,身穿黄色针织衫,搭配白色项链。她的双手放在膝盖上,表情恬静。背景是一堵粗糙的砖墙,午后的阳光温暖地洒在她身上,营造出一种宁静而温馨的氛围。镜头采用中距离视角,突出她的神态和服饰的细节。光线柔和地打在她的脸上,强调她的五官和饰品的质感,增加画面的层次感与亲和力。整个画面构图简洁,砖墙的纹理与阳光的光影效果相得益彰,突显出人物的优雅与从容。'

    image = pipe(
        prompt,
        height=768,
        width=1344,
        guidance_scale=4.0,
        num_inference_steps=50,
        num_images_per_prompt=1,
        generator=torch.Generator("cpu").manual_seed(43),
        enable_cfg_renorm=True,
        enable_prompt_rewrite=True
    ).images[0]
    image.save('./t2i_example.png')

运行图像编辑(标准模式)

import torch
from PIL import Image
from diffusers import LongCatImageEditPipeline

if __name__ == '__main__':
    device = torch.device('cuda')

    pipe = LongCatImageEditPipeline.from_pretrained("meituan-longcat/LongCat-Image-Edit", torch_dtype= torch.bfloat16 )
    # pipe.to(device, torch.bfloat16)  # Uncomment for high VRAM devices (Faster inference)
    pipe.enable_model_cpu_offload()  # Offload to CPU to save VRAM (Required ~18 GB); slower but prevents OOM

    img = Image.open('assets/test.png').convert('RGB')
    prompt = '将猫变成狗'
    image = pipe(
        img,
        prompt,
        negative_prompt='',
        guidance_scale=4.5,
        num_inference_steps=50,
        num_images_per_prompt=1,
        generator=torch.Generator("cpu").manual_seed(43)
    ).images[0]

    image.save('./edit_example.png')

运行图像编辑(Turbo模式)

import torch
from PIL import Image
from diffusers import LongCatImageEditPipeline

if __name__ == '__main__':
    device = torch.device('cuda')

    pipe = LongCatImageEditPipeline.from_pretrained("meituan-longcat/LongCat-Image-Edit-Turbo", torch_dtype= torch.bfloat16 )
    # pipe.to(device, torch.bfloat16)  # Uncomment for high VRAM devices (Faster inference)
    pipe.enable_model_cpu_offload()  # Offload to CPU to save VRAM (Required ~18 GB); slower but prevents OOM

    img = Image.open('assets/test.png').convert('RGB')
    prompt = '将猫变成狗'
    image = pipe(
        img,
        prompt,
        negative_prompt='',
        guidance_scale=1,
        num_inference_steps=8,
        num_images_per_prompt=1,
        generator=torch.Generator("cpu").manual_seed(43)
    ).images[0]

    image.save('./edit_example.png')

评估结果

文本到图像生成

在公开基准测试上的定量评估结果表明,LongCat-Image 具备竞争力:

模型 可访问性 参数规模 GenEval↑ DPG↑ WISE↑
FLUX.1‑dev 开源 12B 0.66 83.84 0.50
GPT Image 1 [High] 专有 - 0.84 85.15 -
HunyuanImage‑3.0 开源 80B 0.72 86.10 0.57
Qwen‑Image 开源 20B 0.87 88.32 0.62
Seedream 4.0 专有 - 0.84 88.25 0.78
LongCat‑Image 开源 6B 0.87 86.80 0.65

文本渲染

模型
GlyphDraw2↑
CVTG‑2K↑
ChineseWord↑
Acc
NED
CLIPScore
HunyuanImage‑3.0
0.78
0.7650
0.8765
0.8121
58.5
Qwen‑Image
0.93
0.8288
0.9297
0.8059
56.6
Seedream 4.0
0.97
0.8917
0.9507
0.7853
49.3
LongCat‑Image
0.95
0.8658
0.9361
0.7859
90.7

人工评估(MOS)

模型 一致性↑ 合理性↑ 真实感↑ 美观度↑
HunyuanImage‑3.0 3.40 3.33 3.50 3.04
Qwen‑Image 3.95 3.48 3.45 3.09
Seedream 4.0 4.25 3.76 3.54 3.10
LongCat‑Image 3.99 3.48 3.60 3.06

图像编辑

在 CEdit-Bench 和 GEdit-Bench 上的性能对比:

模型 CEdit‑Bench‑EN↑ CEdit‑Bench‑CN↑ GEdit‑Bench‑EN↑ GEdit‑Bench‑CN↑
G_SC G_PQ G_O G_SC G_PQ G_O G_SC G_PQ G_O G_SC G_PQ G_O
FLUX.1 Kontext [Pro]6.797.806.531.158.071.437.027.606.561.117.361.23
GPT Image 1 [High]8.648.268.178.678.268.217.857.627.537.677.567.30
Nano Banana7.518.177.207.678.217.367.868.337.547.518.317.25
Seedream 4.08.127.957.588.147.957.578.248.087.688.198.147.71
FLUX.1 Kontext [Dev]6.317.565.931.257.661.516.527.386.00---
Step1X‑Edit6.687.366.256.887.286.357.667.356.977.206.876.86
Qwen‑Image‑Edit8.077.847.528.037.787.468.007.867.567.827.797.52
Qwen‑Image‑Edit [2509]8.047.797.487.937.717.378.157.867.548.057.887.49
LongCat‑Image‑Edit8.277.887.678.257.857.658.188.007.648.087.997.60

人工评估(胜率)

模型对比 综合质量 一致性
Nano Banana vs LongCat-Image-Edit 60.8% vs 39.2% 53.9% vs 46.1%
Seedream 4.0 vs LongCat-Image-Edit 56.9% vs 43.1% 56.3% vs 43.7%
Qwen-Image-Edit [2509] vs LongCat-Image-Edit 41.3% vs 58.7% 45.8% vs 54.2%
FLUX.1 Kontext [Pro] vs LongCat-Image-Edit 39.5% vs 60.5% 37% vs 63%

训练流程

cd LongCat-Image
# for training, install other requirements
pip install -r train_requirements.txt
python setup.py develop

我们提供训练代码,支持对 LongCat‑Image‑Dev 及模型进行高级开发,包括 SFT、LoRA、DPO 和图像编辑训练。

详细说明请参见 TRAINING.md

许可协议

LongCat-Image 采用 Apache 2.0 许可协议。 完整许可文本请参见 LICENSE 文件。

使用注意事项

本模型并非针对所有可能的下游应用进行专门设计或全面评估。

开发人员应考虑到大型语言模型的已知局限性,包括在不同语言间的性能差异,并在将模型部署到敏感或高风险场景前,仔细评估其准确性、安全性和公平性。 开发人员和下游用户有责任了解并遵守与其使用场景相关的所有适用法律法规,包括但不限于数据保护、隐私和内容安全要求。

本模型卡片中的任何内容均不应被解释为更改或限制模型发布所依据的 Apache License 2.0 条款。

引用

如果您发现我们的工作有用,我们恳请您引用我们的成果。

@article{LongCat-Image,
      title={LongCat-Image Technical Report},
      author={Meituan LongCat Team and  Hanghang Ma and Haoxian Tan and Jiale Huang and Junqiang Wu and Jun-Yan He and Lishuai Gao and Songlin Xiao and Xiaoming Wei and Xiaoqi Ma and Xunliang Cai and Yayong Guan and Jie Hu},
	    journal={arXiv preprint arXiv:2512.07584},
      year={2025}
}

致谢

感谢 FLUX.1Qwen2.5-VLDiffusersHuggingFace 仓库的贡献者们所开展的开放研究工作。

联系方式

如有任何问题,请通过 longcat-team@meituan.com 与我们联系,或加入我们的微信群。

微信群


由美团 LongCat 团队用心打造

项目介绍

https://github.com/meituan-longcat/LongCat-Image.git

定制我的领域