Buckets:
| import"../chunks/DsnmJJEf.js";import{i as E,h as b,C as I,H as e,a as D,D as U,E as w,s as j}from"../chunks/BtE7mKSK.js";import{p as Y,o as x,s as l,f as C,a as m,b as v,c as O,d as h,n,r as R}from"../chunks/jDjavuwI.js";const _='{"title":"LongCat-Image","local":"longcat-image","sections":[{"title":"Key Features","local":"key-features","sections":[],"depth":3},{"title":"Usage Example","local":"usage-example","sections":[],"depth":2},{"title":"LongCatImagePipeline","local":"diffusers.LongCatImagePipeline","sections":[],"depth":2},{"title":"LongCatImagePipelineOutput","local":"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput","sections":[],"depth":2}],"depth":1}';var L=h('<meta name="hf:doc:metadata"/>'),J=h('<p></p> <!> <!> <div class="flex flex-wrap space-x-1"><img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/></div> <p>We introduce LongCat-Image, a pioneering open-source and bilingual (Chinese-English) foundation model for image generation, designed to address core challenges in multilingual text rendering, photorealism, deployment efficiency, and developer accessibility prevalent in current leading models.</p> <!> <ul><li>🌟 <strong>Exceptional Efficiency and Performance</strong>: With only <strong>6B parameters</strong>, LongCat-Image surpasses numerous open-source models that are several times larger across multiple benchmarks, demonstrating the immense potential of efficient model design.</li> <li>🌟 <strong>Superior Editing Performance</strong>: LongCat-Image-Edit model achieves state-of-the-art performance among open-source models, delivering leading instruction-following and image quality with superior visual consistency.</li> <li>🌟 <strong>Powerful Chinese Text Rendering</strong>: LongCat-Image demonstrates superior accuracy and stability in rendering common Chinese characters compared to existing SOTA open-source models and achieves industry-leading coverage of the Chinese dictionary.</li> <li>🌟 <strong>Remarkable Photorealism</strong>: Through an innovative data strategy and training framework, LongCat-Image achieves remarkable photorealism in generated images.</li> <li>🌟 <strong>Comprehensive Open-Source Ecosystem</strong>: We provide a complete toolchain, from intermediate checkpoints to full training code, significantly lowering the barrier for further research and development.</li></ul> <p>For more details, please refer to the comprehensive <a href="https://arxiv.org/abs/2412.11963" rel="nofollow"><strong><em>LongCat-Image Technical Report</em></strong></a></p> <!> <!> <p>This pipeline was contributed by LongCat-Image Team. The original codebase can be found <a href="https://github.com/meituan-longcat/LongCat-Image" rel="nofollow">here</a>.</p> <p>Available models:</p> <div style="overflow-x: auto; margin-bottom: 16px;"><table style="border-collapse: collapse; width: 100%;"><thead><tr><th style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de; background-color: #f6f8fa;">Models</th><th style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de; background-color: #f6f8fa;">Type</th><th style="padding: 8px; border: 1px solid #d0d7de; background-color: #f6f8fa;">Description</th><th style="padding: 8px; border: 1px solid #d0d7de; background-color: #f6f8fa;">Download Link</th></tr></thead><tbody><tr><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">LongCat‑Image</td><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">Text‑to‑Image</td><td style="padding: 8px; border: 1px solid #d0d7de;">Final Release. The standard model for out‑of‑the‑box inference.</td><td style="padding: 8px; border: 1px solid #d0d7de;"><span style="white-space: nowrap;">🤗 <a href="https://huggingface.co/meituan-longcat/LongCat-Image">Huggingface</a></span></td></tr><tr><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">LongCat‑Image‑Dev</td><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">Text‑to‑Image</td><td style="padding: 8px; border: 1px solid #d0d7de;">Development. Mid-training checkpoint, suitable for fine-tuning.</td><td style="padding: 8px; border: 1px solid #d0d7de;"><span style="white-space: nowrap;">🤗 <a href="https://huggingface.co/meituan-longcat/LongCat-Image-Dev">Huggingface</a></span></td></tr><tr><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">LongCat‑Image‑Edit</td><td style="white-space: nowrap; padding: 8px; border: 1px solid #d0d7de;">Image Editing</td><td style="padding: 8px; border: 1px solid #d0d7de;">Specialized model for image editing.</td><td style="padding: 8px; border: 1px solid #d0d7de;"><span style="white-space: nowrap;">🤗 <a href="https://huggingface.co/meituan-longcat/LongCat-Image-Edit">Huggingface</a></span></td></tr></tbody></table></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>The pipeline for text-to-image generation.</p></div> <ul><li>all</li> <li><strong>call</strong></li></ul> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Output class for Stable Diffusion pipelines.</p></div> <!> <p></p>',1);function S(u,f){Y(f,!1),x(()=>{new URLSearchParams(window.location.search).get("fw")}),E();var s=J();b("1301cws",c=>{var Q=L();j(Q,"content",_),m(c,Q)});var i=l(C(s),2);I(i,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var o=l(i,2);e(o,{title:"LongCat-Image",local:"longcat-image",headingTag:"h1"});var r=l(o,6);e(r,{title:"Key Features",local:"key-features",headingTag:"h3"});var d=l(r,6);e(d,{title:"Usage Example",local:"usage-example",headingTag:"h2"});var g=l(d,2);D(g,{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBkaWZmdXNlcnMlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTG9uZ0NhdEltYWdlUGlwZWxpbmUlMEElMEF3ZWlnaHRfZHR5cGUlMjAlM0QlMjB0b3JjaC5iZmxvYXQxNiUwQXBpcGUlMjAlM0QlMjBMb25nQ2F0SW1hZ2VQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIybWVpdHVhbi1sb25nY2F0JTJGTG9uZ0NhdC1JbWFnZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMjApJTBBcGlwZS50bygnY3VkYScpJTBBJTIzJTIwcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCclRTQlQjglODAlRTQlQjglQUElRTUlQjklQjQlRTglQkQlQkIlRTclOUElODQlRTQlQkElOUElRTglQTMlOTQlRTUlQTUlQjMlRTYlODAlQTclRUYlQkMlOEMlRTglQkElQUIlRTclQTklQkYlRTklQkIlODQlRTglODklQjIlRTklOTIlODglRTclQkIlODclRTglQTElQUIlRUYlQkMlOEMlRTYlOTAlQUQlRTklODUlOEQlRTclOTklQkQlRTglODklQjIlRTklQTElQjklRTklOTMlQkUlRTMlODAlODIlRTUlQTUlQjklRTclOUElODQlRTUlOEYlOEMlRTYlODklOEIlRTYlOTQlQkUlRTUlOUMlQTglRTglODYlOUQlRTclOUIlOTYlRTQlQjglOEElRUYlQkMlOEMlRTglQTElQTglRTYlODMlODUlRTYlODElQUMlRTklOUQlOTklRTMlODAlODIlRTglODMlOEMlRTYlOTklQUYlRTYlOTglQUYlRTQlQjglODAlRTUlQTAlQjUlRTclQjIlOTclRTclQjMlOTklRTclOUElODQlRTclQTAlOTYlRTUlQTIlOTklRUYlQkMlOEMlRTUlOEQlODglRTUlOTAlOEUlRTclOUElODQlRTklOTglQjMlRTUlODUlODklRTYlQjglQTklRTYlOUElOTYlRTUlOUMlQjAlRTYlQjQlOTIlRTUlOUMlQTglRTUlQTUlQjklRTglQkElQUIlRTQlQjglOEElRUYlQkMlOEMlRTglOTAlQTUlRTklODAlQTAlRTUlODclQkElRTQlQjglODAlRTclQTclOEQlRTUlQUUlODElRTklOUQlOTklRTglODAlOEMlRTYlQjglQTklRTklQTYlQTglRTclOUElODQlRTYlQjAlOUIlRTUlOUIlQjQlRTMlODAlODIlRTklOTUlOUMlRTUlQTQlQjQlRTklODclODclRTclOTQlQTglRTQlQjglQUQlRTglQjclOUQlRTclQTYlQkIlRTglQTclODYlRTglQTclOTIlRUYlQkMlOEMlRTclQUElODElRTUlODclQkElRTUlQTUlQjklRTclOUElODQlRTclQTUlOUUlRTYlODAlODElRTUlOTIlOEMlRTYlOUMlOEQlRTklQTUlQjAlRTclOUElODQlRTclQkIlODYlRTglOEElODIlRTMlODAlODIlRTUlODUlODklRTclQkElQkYlRTYlOUYlOTQlRTUlOTIlOEMlRTUlOUMlQjAlRTYlODklOTMlRTUlOUMlQTglRTUlQTUlQjklRTclOUElODQlRTglODQlQjglRTQlQjglOEElRUYlQkMlOEMlRTUlQkMlQkElRTglQjAlODMlRTUlQTUlQjklRTclOUElODQlRTQlQkElOTQlRTUlQUUlOTglRTUlOTIlOEMlRTklQTUlQjAlRTUlOTMlODElRTclOUElODQlRTglQjQlQTglRTYlODQlOUYlRUYlQkMlOEMlRTUlQTIlOUUlRTUlOEElQTAlRTclOTQlQkIlRTklOUQlQTIlRTclOUElODQlRTUlQjElODIlRTYlQUMlQTElRTYlODQlOUYlRTQlQjglOEUlRTQlQkElQjIlRTUlOTIlOEMlRTUlOEElOUIlRTMlODAlODIlRTYlOTUlQjQlRTQlQjglQUElRTclOTQlQkIlRTklOUQlQTIlRTYlOUUlODQlRTUlOUIlQkUlRTclQUUlODAlRTYlQjQlODElRUYlQkMlOEMlRTclQTAlOTYlRTUlQTIlOTklRTclOUElODQlRTclQkElQjklRTclOTAlODYlRTQlQjglOEUlRTklOTglQjMlRTUlODUlODklRTclOUElODQlRTUlODUlODklRTUlQkQlQjElRTYlOTUlODglRTYlOUUlOUMlRTclOUIlQjglRTUlQkUlOTclRTclOUIlOEElRTUlQkQlQjAlRUYlQkMlOEMlRTclQUElODElRTYlOTglQkUlRTUlODclQkElRTQlQkElQkElRTclODklQTklRTclOUElODQlRTQlQkMlOTglRTklOUIlODUlRTQlQjglOEUlRTQlQkIlOEUlRTUlQUUlQjklRTMlODAlODInJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTM0NCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENC4wJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ltYWdlc19wZXJfcHJvbXB0JTNEMSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvciglMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDQzKSUyQyUwQSUyMCUyMCUyMCUyMGVuYWJsZV9jZmdfcmVub3JtJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGVuYWJsZV9wcm9tcHRfcmV3cml0ZSUzRFRydWUlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKGYnLiUyRmxvbmdjYXRfaW1hZ2VfdDJpX2V4YW1wbGUucG5nJyk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">import</span> diffusers | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LongCatImagePipeline | |
| weight_dtype = torch.bfloat16 | |
| pipe = LongCatImagePipeline.from_pretrained(<span class="hljs-string">"meituan-longcat/LongCat-Image"</span>, torch_dtype=torch.bfloat16 ) | |
| pipe.to(<span class="hljs-string">'cuda'</span>) | |
| <span class="hljs-comment"># pipe.enable_model_cpu_offload()</span> | |
| prompt = <span class="hljs-string">'一个年轻的亚裔女性,身穿黄色针织衫,搭配白色项链。她的双手放在膝盖上,表情恬静。背景是一堵粗糙的砖墙,午后的阳光温暖地洒在她身上,营造出一种宁静而温馨的氛围。镜头采用中距离视角,突出她的神态和服饰的细节。光线柔和地打在她的脸上,强调她的五官和饰品的质感,增加画面的层次感与亲和力。整个画面构图简洁,砖墙的纹理与阳光的光影效果相得益彰,突显出人物的优雅与从容。'</span> | |
| image = pipe( | |
| prompt, | |
| height=<span class="hljs-number">768</span>, | |
| width=<span class="hljs-number">1344</span>, | |
| guidance_scale=<span class="hljs-number">4.0</span>, | |
| num_inference_steps=<span class="hljs-number">50</span>, | |
| num_images_per_prompt=<span class="hljs-number">1</span>, | |
| generator=torch.Generator(<span class="hljs-string">"cpu"</span>).manual_seed(<span class="hljs-number">43</span>), | |
| enable_cfg_renorm=<span class="hljs-literal">True</span>, | |
| enable_prompt_rewrite=<span class="hljs-literal">True</span>, | |
| ).images[<span class="hljs-number">0</span>] | |
| image.save(<span class="hljs-string">f'./longcat_image_t2i_example.png'</span>)`,lang:"py",wrap:!1});var p=l(g,8);e(p,{title:"LongCatImagePipeline",local:"diffusers.LongCatImagePipeline",headingTag:"h2"});var a=l(p,2),y=O(a);U(y,{name:"class diffusers.LongCatImagePipeline",anchor:"diffusers.LongCatImagePipeline",source:"https://github.com/huggingface/diffusers/blob/vr_14218/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py#L205",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": Qwen2_5_VLForConditionalGeneration"},{name:"tokenizer",val:": Qwen2Tokenizer"},{name:"text_processor",val:": Qwen2VLProcessor"},{name:"transformer",val:": LongCatImageTransformer2DModel"}]}),n(2),R(a);var T=l(a,4);e(T,{title:"LongCatImagePipelineOutput",local:"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",headingTag:"h2"});var t=l(T,2),M=O(t);U(M,{name:"class diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",anchor:"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14218/src/diffusers/pipelines/longcat_image/pipeline_output.py#L10",parameters:[{name:"images",val:": list"}],parametersDescription:[{anchor:"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput.images",description:`<strong>images</strong> (<code>list[PIL.Image.Image]</code> or <code>np.ndarray</code>) — | |
| List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"}]}),n(2),R(t);var k=l(t,2);w(k,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/longcat_image.md"}),n(2),m(u,s),v()}export{S as component}; | |
Xet Storage Details
- Size:
- 12.7 kB
- Xet hash:
- 246a98dd913c31b50629f2e692a164d33ec697630f0f7b6db87e93acd79cf769
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.