# LongCat-Image

  

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

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

詳細については、包括的な[***LongCat-Image Technical Report***](https://arxiv.org/abs/2412.11963)を参照してください。

## 使用例

```py
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 によって提供されました。元のコードベースは[こちら](https://github.com/meituan-longcat/LongCat-Image)で確認できます。

利用可能なモデル:

  
    
      
        モデル タイプ 説明 ダウンロードリンク
      
    
    
      
        LongCat‑Image Text‑to‑Image の最終リリース。そのまま推論に使える標準モデルです。
        
          🤗&nbsp;Huggingface
        
      
      
        LongCat&#8209;Image&#8209;Dev テキスト&#8209;to&#8209;Image 開発用。Mid-training チェックポイントであり、ファインチューニングに適しています。
        
          🤗&nbsp;Huggingface
        
      
      
        LongCat&#8209;Image&#8209;Edit 画像編集 画像編集に特化したモデル。
        
          🤗&nbsp;Huggingface
        
      
    
  

## LongCatImagePipeline[[diffusers.LongCatImagePipeline]]

#### diffusers.LongCatImagePipeline[[diffusers.LongCatImagePipeline]]

```python
diffusers.LongCatImagePipeline(scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKL, text_encoder: Qwen2_5_VLForConditionalGeneration, tokenizer: Qwen2Tokenizer, text_processor: Qwen2VLProcessor, transformer: LongCatImageTransformer2DModel)
```

[ソース](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py#L205)

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

- すべて
- __call__

## LongCatImagePipelineOutput[[diffusers.pipelines.longcat_image.LongCatImagePipelineOutput]]

#### diffusers.pipelines.longcat_image.LongCatImagePipelineOutput[[diffusers.pipelines.longcat_image.LongCatImagePipelineOutput]]

```python
diffusers.pipelines.longcat_image.LongCatImagePipelineOutput(images: list[PIL.Image.Image, numpy.ndarray])
```

[ソース](https://github.com/huggingface/diffusers/blob/v0.43.0/src/diffusers/pipelines/longcat_image/pipeline_output.py#L10)

**パラメータ:**

images (`list[PIL.Image.Image]` または `np.ndarray`) : 長さ `batch_size` のデノイズ済み PIL イメージのリスト、または形状 `(batch_size, height, width, num_channels)` の numpy 配列。PIL イメージまたは numpy 配列は、拡散パイプラインのデノイズ済みイメージを表します。

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

