# LongCat-Image

  

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;이미지 개발용. 중간 학습 체크포인트로, 파인튜닝에 적합합니다.
        
          🤗&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/main/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py#L205)

텍스트-이미지 생성을 위한 파이프라인입니다.

- 전체
- __호출__

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

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

```python
diffusers.pipelines.longcat_image.LongCatImagePipelineOutput(images: list)
```

[소스](https://github.com/huggingface/diffusers/blob/main/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 배열은 diffusion 파이프라인의 노이즈 제거된 이미지를 나타냅니다.

Stable Diffusion 파이프라인의 출력 클래스입니다.

