YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Neta-Lumina v1.0

基于Lumina2的动漫风格图像生成模型 | Anime-style Image Generation Model based on Lumina2

模型信息 | Model Information

  • 模型类型 | Model Type: Lumina2Pipeline
  • 基础模型 | Base Model: Lumina-Image-2.0
  • 调度器 | Scheduler: FlowMatchEulerDiscreteScheduler
  • 数据类型 | Data Type: bfloat16
  • 分辨率 | Resolution: 1024x1024

快速开始 | Quick Start

安装依赖 | Install Dependencies

pip install diffusers transformers torch accelerate

基本使用 | Basic Usage

import torch
from diffusers import Lumina2Pipeline

# 加载模型 | Load the model
pipe = Lumina2Pipeline.from_pretrained("neta-art/Neta-Lumina-diffusers", torch_dtype=torch.bfloat16)

# 启用模型CPU卸载以节省显存 | Enable model CPU offloading to save VRAM
pipe.enable_model_cpu_offload() # Remove this if you have sufficient GPU memory

# 定义提示词 | Define prompts
prompt = "You are an assistant designed to generate anime images based on textual prompts. <Prompt Start> 1girl, beautiful, detailed, high quality"
negative_prompt = "You are an assistant designed to generate images based on textual prompts. <Prompt Start> A low quality, low resolution, ugly, and disgusting image with severe digital artifacts, blur, and noise. The subject is deformed, disfigured, and malformed, with bad anatomy, mutated limbs, and bad proportions. Features distorted, twisted, and unnatural hands and face, with extra or missing fingers. The style is amateurish, poorly drawn, childish, like a flat, unfinished sketch or a cheap, bad CGI render. The composition is bad, cropped, out of frame, and cluttered with text, watermarks, or signatures,"

# 生成图像 | Generate image
image = pipe(
    prompt,
    height=1024,
    width=1024,
    guidance_scale=5,  # 增加引导比例以获得更好的提示词遵循 | Increase guidance scale for better prompt adherence
    num_inference_steps=50,  # 增加推理步数以获得更好的质量 | Increase inference steps for better quality
    negative_prompt=negative_prompt,
    generator=torch.Generator("cpu").manual_seed(114514)
).images[0]

# 保存图像 | Save the image
image.save("neta-lumina-output.png")

重要说明 | Important Notes

⚠️ 性能提示 | Performance Note: 目前diffusers对默认Lumina2采样器的支持效果不如ComfyUI。如需体验最佳生成效果,建议使用ComfyUI。

⚠️ Performance Note: Currently, diffusers' support for the default Lumina2 sampler doesn't match the generation quality of ComfyUI. For the best generation experience, we recommend using ComfyUI.

许可证 | License

Apache 2.0

Downloads last month
22
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including neta-art/Neta-Lumina-diffusers