别再用SMB传大文件了!Windows 11 22H2下,试试Robocopy这个隐藏提速开关
2026/4/22 12:03:33
【免费下载链接】pixel-art-xl项目地址: https://ai.gitcode.com/hf_mirrors/nerijs/pixel-art-xl
本文是为想要快速体验Pixel Art XL模型的新手准备的完整教程,无需深厚技术背景即可轻松上手AI像素艺术生成。
安装必要的依赖包,确保模型能够正常运行:
pip install diffusers transformers accelerate torch获取pixel-art-xl模型及相关组件,建议使用官方推荐的模型版本。
运行简单的生成脚本,体验AI像素艺术的魅力!
以下是官方提供的快速上手代码,可以直接复制使用:
from diffusers import DiffusionPipeline, LCMScheduler import torch model_id = "stabilityai/stable-diffusion-xl-base-1.0" lcm_lora_id = "latent-consistency/lcm-lora-sdxl" pipe = DiffusionPipeline.from_pretrained(model_id, variant="fp16") pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config) pipe.load_lora_weights(lcm_lora_id, adapter_name="lora") pipe.load_lora_weights("./pixel-art-xl.safetensors", adapter_name="pixel") pipe.set_adapters(["lora", "pixel"], adapter_weights=[1.0, 1.2]) pipe.to(device="cuda", dtype=torch.float16) prompt = "pixel, a cute corgi" negative_prompt = "3d render, realistic" num_images = 9 for i in range(num_images): img = pipe( prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=8, guidance_scale=1.5, ).images[0] img.save(f"lcm_lora_{i}.png")DiffusionPipeline.from_pretrained():加载基础模型LCMScheduler:使用LCM调度器加速推理variant="fp16":使用半精度浮点数以节省显存num_inference_steps=8:仅需8步即可完成生成guidance_scale=1.5:引导比例设置为1.5pixel_art_xl.pypython pixel_art_xl.py想要获得更优质的生成效果,可以尝试:
立即开始你的AI像素艺术创作之旅!按照本文的步骤操作,你很快就能生成属于自己的像素艺术作品。
【免费下载链接】pixel-art-xl项目地址: https://ai.gitcode.com/hf_mirrors/nerijs/pixel-art-xl
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考