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를 소개합니다. 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텍스트-이미지Development. 중간 학습 체크포인트로, 파인튜닝에 적합합니다.🤗 Huggingface
LongCat‑Image‑Edit이미지 편집이미지 편집을 위한 전문 모델.🤗 Huggingface

LongCatImagePipeline

클래스 diffusers.LongCatImagePipeline

< >

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

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

  • 전체
  • 호출

LongCatImagePipelineOutput

클래스 diffusers.pipelines.longcat_image.LongCatImagePipelineOutput

< >

( images: list )

매개변수

  • images (list[PIL.Image.Image] 또는 np.ndarray) — batch_size 길이의 denoised PIL 이미지 목록 또는 (batch_size, height, width, num_channels) 형태의 numpy 배열. PIL 이미지 또는 numpy 배열은 diffusion 파이프라인의 denoised 이미지를 나타냅니다.

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

Update on GitHub