Diffusers documentation

LongCat-Image

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

LongCat-Image

LoRA

LongCat-Image を紹介します。これは、現在の主要モデルに広く見られる多言語テキストレンダリング、フォトリアリズム、デプロイ効率、開発者へのアクセシビリティといった核心的な課題に対処するために設計された、画期的なオープンソースかつバイリンガル(中国語・英語)対応の画像生成基盤モデルです。

主要機能

  • 🌟 卓越した効率性とパフォーマンス: 6Bのパラメータのみで、LongCat-Image は複数のベンチマークにおいて、数倍の規模を持つ多数のオープンソースモデルを上回り、効率的なモデル設計の大きな可能性を示しています。
  • 🌟 優れた編集性能: LongCat-Image-Edit モデルは、オープンソースモデルの中で最先端の性能を実現し、優れた視覚的一貫性を保ちながら、指令追従性と画像品質の両面で業界トップクラスの成果を達成しています。
  • 🌟 強力な中国語テキストレンダリング: LongCat-Image は、既存の SOTA オープンソースモデルと比較して、一般的な中国語文字のレンダリングにおいて優れた精度と安定性を示し、中国語辞書の業界最高レベルのカバレッジを実現しています。
  • 🌟 驚異的なフォトリアリズム: 革新的なデータ戦略と学習フレームワークにより、LongCat-Image は生成画像において驚異的なフォトリアリズムを実現しています。
  • 🌟 包括的なオープンソースエコシステム: 中間チェックポイントから完全な学習コードまで、完全なツールチェーンを提供し、さらなる研究開発の障壁を大幅に低減します。

詳細については、包括的なLongCat-Image Technical Reportを参照してください。

使用例

import torch
import diffusers
from diffusers import LongCatImagePipeline

weight_dtype = torch.bfloat16
pipe = LongCatImagePipeline.from_pretrained("meituan-longcat/LongCat-Image", dtype=torch.bfloat16 )
pipe.to('cuda')  # or "mps", "xpu", "cpu"
# pipe.enable_model_cpu_offload()

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(f'./longcat_image_t2i_example.png')

このパイプラインは LongCat-Image Team によって提供されました。元のコードベースはこちらで確認できます。

利用可能なモデル:

モデル型説明ダウンロードリンク
LongCat‑Imageテキストから画像へ最終リリース。そのまま使える推論のための標準モデルです。🤗 Huggingface
LongCat‑Image‑Devテキストから画像へ開発用。ファインチューニングに適したミッドトレーニングのチェックポイントです。🤗 Huggingface
LongCat‑Image‑Edit画像編集画像編集に特化したモデル。🤗 Huggingface

LongCatImagePipeline

class diffusers.LongCatImagePipeline

< >

( scheduler: FlowMatchEulerDiscreteSchedulervae: AutoencoderKLtext_encoder: Qwen2_5_VLForConditionalGenerationtokenizer: Qwen2Tokenizertext_processor: Qwen2VLProcessortransformer: LongCatImageTransformer2DModel )

テキストから画像を生成するためのパイプライン。

  • すべて
  • call

LongCatImagePipelineOutput

class diffusers.pipelines.longcat_image.LongCatImagePipelineOutput

< >

( images: list )

パラメータ

  • images (list[PIL.Image.Image] または np.ndarray) — batch_size 個のノイズ除去済み PIL 画像のリスト、または形状が (batch_size, height, width, num_channels) の numpy 配列。PIL 画像または numpy 配列は、拡散パイプラインによってノイズ除去された画像を表します。

Stable Diffusion パイプライン用の出力クラスです。

Update on GitHub