Buckets:
| import{s as Dl,n as wl,o as xl}from"../chunks/scheduler.53228c21.js";import{S as Cl,i as jl,e as s,s as n,c as o,h as $l,a as r,d as t,b as i,f as dl,g as p,j as g,k as P,w as bl,l as Z,m as a,n as T,t as d,o as m,p as c}from"../chunks/index.100fac89.js";import{C as vl}from"../chunks/CopyLLMTxtMenu.8a16ebe2.js";import{D as Il}from"../chunks/Docstring.07ca7ce7.js";import{C as Yl}from"../chunks/CodeBlock.d30a6509.js";import{H as W,E as Ll}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.83a5c0e1.js";function _l(Ql){let Q,S,J,V,u,H,h,B,f,Ul='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',G,M,Ol="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.",X,y,z,E,Rl="<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>",F,k,fl='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>',N,b,q,I,K,D,ul='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>.',ll,w,hl="Available models:",el,U,Ml='<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>',tl,x,al,O,C,ml,L,yl="The pipeline for text-to-image generation.",nl,j,El="<li>all</li> <li><strong>call</strong></li>",il,$,sl,R,v,cl,_,kl="Output class for Stable Diffusion pipelines.",rl,Y,ol,A,pl;return u=new vl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new W({props:{title:"LongCat-Image",local:"longcat-image",headingTag:"h1"}}),y=new W({props:{title:"Key Features",local:"key-features",headingTag:"h3"}}),b=new W({props:{title:"Usage Example",local:"usage-example",headingTag:"h2"}}),I=new Yl({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBkaWZmdXNlcnMlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTG9uZ0NhdEltYWdlUGlwZWxpbmUlMEElMEF3ZWlnaHRfZHR5cGUlMjAlM0QlMjB0b3JjaC5iZmxvYXQxNiUwQXBpcGUlMjAlM0QlMjBMb25nQ2F0SW1hZ2VQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIybWVpdHVhbi1sb25nY2F0JTJGTG9uZ0NhdC1JbWFnZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMjApJTBBcGlwZS50bygnY3VkYScpJTBBJTIzJTIwcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCclRTQlQjglODAlRTQlQjglQUElRTUlQjklQjQlRTglQkQlQkIlRTclOUElODQlRTQlQkElOUElRTglQTMlOTQlRTUlQTUlQjMlRTYlODAlQTclRUYlQkMlOEMlRTglQkElQUIlRTclQTklQkYlRTklQkIlODQlRTglODklQjIlRTklOTIlODglRTclQkIlODclRTglQTElQUIlRUYlQkMlOEMlRTYlOTAlQUQlRTklODUlOEQlRTclOTklQkQlRTglODklQjIlRTklQTElQjklRTklOTMlQkUlRTMlODAlODIlRTUlQTUlQjklRTclOUElODQlRTUlOEYlOEMlRTYlODklOEIlRTYlOTQlQkUlRTUlOUMlQTglRTglODYlOUQlRTclOUIlOTYlRTQlQjglOEElRUYlQkMlOEMlRTglQTElQTglRTYlODMlODUlRTYlODElQUMlRTklOUQlOTklRTMlODAlODIlRTglODMlOEMlRTYlOTklQUYlRTYlOTglQUYlRTQlQjglODAlRTUlQTAlQjUlRTclQjIlOTclRTclQjMlOTklRTclOUElODQlRTclQTAlOTYlRTUlQTIlOTklRUYlQkMlOEMlRTUlOEQlODglRTUlOTAlOEUlRTclOUElODQlRTklOTglQjMlRTUlODUlODklRTYlQjglQTklRTYlOUElOTYlRTUlOUMlQjAlRTYlQjQlOTIlRTUlOUMlQTglRTUlQTUlQjklRTglQkElQUIlRTQlQjglOEElRUYlQkMlOEMlRTglOTAlQTUlRTklODAlQTAlRTUlODclQkElRTQlQjglODAlRTclQTclOEQlRTUlQUUlODElRTklOUQlOTklRTglODAlOEMlRTYlQjglQTklRTklQTYlQTglRTclOUElODQlRTYlQjAlOUIlRTUlOUIlQjQlRTMlODAlODIlRTklOTUlOUMlRTUlQTQlQjQlRTklODclODclRTclOTQlQTglRTQlQjglQUQlRTglQjclOUQlRTclQTYlQkIlRTglQTclODYlRTglQTclOTIlRUYlQkMlOEMlRTclQUElODElRTUlODclQkElRTUlQTUlQjklRTclOUElODQlRTclQTUlOUUlRTYlODAlODElRTUlOTIlOEMlRTYlOUMlOEQlRTklQTUlQjAlRTclOUElODQlRTclQkIlODYlRTglOEElODIlRTMlODAlODIlRTUlODUlODklRTclQkElQkYlRTYlOUYlOTQlRTUlOTIlOEMlRTUlOUMlQjAlRTYlODklOTMlRTUlOUMlQTglRTUlQTUlQjklRTclOUElODQlRTglODQlQjglRTQlQjglOEElRUYlQkMlOEMlRTUlQkMlQkElRTglQjAlODMlRTUlQTUlQjklRTclOUElODQlRTQlQkElOTQlRTUlQUUlOTglRTUlOTIlOEMlRTklQTUlQjAlRTUlOTMlODElRTclOUElODQlRTglQjQlQTglRTYlODQlOUYlRUYlQkMlOEMlRTUlQTIlO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fcmV3cml0ZSUzRFRydWUlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKGYnLiUyRmxvbmdjYXRfaW1hZ2VfdDJpX2V4YW1wbGUucG5nJyk=",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>)`,wrap:!1}}),x=new W({props:{title:"LongCatImagePipeline",local:"diffusers.LongCatImagePipeline",headingTag:"h2"}}),C=new Il({props:{name:"class diffusers.LongCatImagePipeline",anchor:"diffusers.LongCatImagePipeline",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_11636/src/diffusers/pipelines/longcat_image/pipeline_longcat_image.py#L205"}}),$=new W({props:{title:"LongCatImagePipelineOutput",local:"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",headingTag:"h2"}}),v=new Il({props:{name:"class diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",anchor:"diffusers.pipelines.longcat_image.LongCatImagePipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"}],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"}],source:"https://github.com/huggingface/diffusers/blob/vr_11636/src/diffusers/pipelines/longcat_image/pipeline_output.py#L11"}}),Y=new Ll({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/longcat_image.md"}}),{c(){Q=s("meta"),S=n(),J=s("p"),V=n(),o(u.$$.fragment),H=n(),o(h.$$.fragment),B=n(),f=s("div"),f.innerHTML=Ul,G=n(),M=s("p"),M.textContent=Ol,X=n(),o(y.$$.fragment),z=n(),E=s("ul"),E.innerHTML=Rl,F=n(),k=s("p"),k.innerHTML=fl,N=n(),o(b.$$.fragment),q=n(),o(I.$$.fragment),K=n(),D=s("p"),D.innerHTML=ul,ll=n(),w=s("p"),w.textContent=hl,el=n(),U=s("div"),U.innerHTML=Ml,tl=n(),o(x.$$.fragment),al=n(),O=s("div"),o(C.$$.fragment),ml=n(),L=s("p"),L.textContent=yl,nl=n(),j=s("ul"),j.innerHTML=El,il=n(),o($.$$.fragment),sl=n(),R=s("div"),o(v.$$.fragment),cl=n(),_=s("p"),_.textContent=kl,rl=n(),o(Y.$$.fragment),ol=n(),A=s("p"),this.h()},l(l){const e=$l("svelte-u9bgzb",document.head);Q=r(e,"META",{name:!0,content:!0}),e.forEach(t),S=i(l),J=r(l,"P",{}),dl(J).forEach(t),V=i(l),p(u.$$.fragment,l),H=i(l),p(h.$$.fragment,l),B=i(l),f=r(l,"DIV",{class:!0,"data-svelte-h":!0}),g(f)!=="svelte-si9ct8"&&(f.innerHTML=Ul),G=i(l),M=r(l,"P",{"data-svelte-h":!0}),g(M)!=="svelte-1j3b5cc"&&(M.textContent=Ol),X=i(l),p(y.$$.fragment,l),z=i(l),E=r(l,"UL",{"data-svelte-h":!0}),g(E)!=="svelte-1663eao"&&(E.innerHTML=Rl),F=i(l),k=r(l,"P",{"data-svelte-h":!0}),g(k)!=="svelte-1w45r60"&&(k.innerHTML=fl),N=i(l),p(b.$$.fragment,l),q=i(l),p(I.$$.fragment,l),K=i(l),D=r(l,"P",{"data-svelte-h":!0}),g(D)!=="svelte-oanamx"&&(D.innerHTML=ul),ll=i(l),w=r(l,"P",{"data-svelte-h":!0}),g(w)!=="svelte-1bob28v"&&(w.textContent=hl),el=i(l),U=r(l,"DIV",{style:!0,"data-svelte-h":!0}),g(U)!=="svelte-tfnkyg"&&(U.innerHTML=Ml),tl=i(l),p(x.$$.fragment,l),al=i(l),O=r(l,"DIV",{class:!0});var gl=dl(O);p(C.$$.fragment,gl),ml=i(gl),L=r(gl,"P",{"data-svelte-h":!0}),g(L)!=="svelte-og3qel"&&(L.textContent=yl),gl.forEach(t),nl=i(l),j=r(l,"UL",{"data-svelte-h":!0}),g(j)!=="svelte-1p6h59i"&&(j.innerHTML=El),il=i(l),p($.$$.fragment,l),sl=i(l),R=r(l,"DIV",{class:!0});var Tl=dl(R);p(v.$$.fragment,Tl),cl=i(Tl),_=r(Tl,"P",{"data-svelte-h":!0}),g(_)!=="svelte-1qpjiuf"&&(_.textContent=kl),Tl.forEach(t),rl=i(l),p(Y.$$.fragment,l),ol=i(l),A=r(l,"P",{}),dl(A).forEach(t),this.h()},h(){P(Q,"name","hf:doc:metadata"),P(Q,"content",Jl),P(f,"class","flex flex-wrap space-x-1"),bl(U,"overflow-x","auto"),bl(U,"margin-bottom","16px"),P(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(l,e){Z(document.head,Q),a(l,S,e),a(l,J,e),a(l,V,e),T(u,l,e),a(l,H,e),T(h,l,e),a(l,B,e),a(l,f,e),a(l,G,e),a(l,M,e),a(l,X,e),T(y,l,e),a(l,z,e),a(l,E,e),a(l,F,e),a(l,k,e),a(l,N,e),T(b,l,e),a(l,q,e),T(I,l,e),a(l,K,e),a(l,D,e),a(l,ll,e),a(l,w,e),a(l,el,e),a(l,U,e),a(l,tl,e),T(x,l,e),a(l,al,e),a(l,O,e),T(C,O,null),Z(O,ml),Z(O,L),a(l,nl,e),a(l,j,e),a(l,il,e),T($,l,e),a(l,sl,e),a(l,R,e),T(v,R,null),Z(R,cl),Z(R,_),a(l,rl,e),T(Y,l,e),a(l,ol,e),a(l,A,e),pl=!0},p:wl,i(l){pl||(d(u.$$.fragment,l),d(h.$$.fragment,l),d(y.$$.fragment,l),d(b.$$.fragment,l),d(I.$$.fragment,l),d(x.$$.fragment,l),d(C.$$.fragment,l),d($.$$.fragment,l),d(v.$$.fragment,l),d(Y.$$.fragment,l),pl=!0)},o(l){m(u.$$.fragment,l),m(h.$$.fragment,l),m(y.$$.fragment,l),m(b.$$.fragment,l),m(I.$$.fragment,l),m(x.$$.fragment,l),m(C.$$.fragment,l),m($.$$.fragment,l),m(v.$$.fragment,l),m(Y.$$.fragment,l),pl=!1},d(l){l&&(t(S),t(J),t(V),t(H),t(B),t(f),t(G),t(M),t(X),t(z),t(E),t(F),t(k),t(N),t(q),t(K),t(D),t(ll),t(w),t(el),t(U),t(tl),t(al),t(O),t(nl),t(j),t(il),t(sl),t(R),t(rl),t(ol),t(A)),t(Q),c(u,l),c(h,l),c(y,l),c(b,l),c(I,l),c(x,l),c(C),c($,l),c(v),c(Y,l)}}}const Jl='{"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}';function Al(Ql){return xl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bl extends Cl{constructor(Q){super(),jl(this,Q,Al,_l,Dl,{})}}export{Bl as component}; | |
Xet Storage Details
- Size:
- 16.1 kB
- Xet hash:
- f6ef8f18cce0b9775eca2ac37841b0110dd2ea7fd777c247fabe94b6582d1b09
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.