qwen-image-anime-irl-lora:将动漫风格提示转换为逼真图像的LoRA模型

为Qwen-Image设计的LoRA模型,可将动漫风格提示转化为逼真图像,触发词“Real life Anime”,支持ComfyUI工作流,轻松生成高质量照片级效果。【此简介由AI生成】

分支2Tags0
文件最后提交记录最后更新时间
Upload Anime in real life LoRA9 个月前
Upload Anime in real life LoRA9 个月前
fix code example + add library tag (#1) - add library tag (69185b6267d8d44dfb32c3c2d4d9258dbab52cce) - fix lora loading code (be980394c2ceea2a7deac5de51b28682b061b40f) Co-authored-by: Linoy Tsaban <linoyts@users.noreply.huggingface.co> 8 个月前
Upload Anime in real life LoRA9 个月前

license: apache-2.0 language:

  • en base_model:
  • Qwen/Qwen-Image pipeline_tag: text-to-image tags:
  • lora
  • qwen
  • qwen-image
  • anime
  • anime-to-real
  • style-transfer library_name: diffusers

Qwen-Image 动漫转现实 LoRA

适用于 Qwen-Image 的 LoRA 模型,可将动漫风格提示词转换为写实图像

触发词:"Real life Anime"

📝 更新日志

🧪 使用方法

🔧 初始化

from diffusers import DiffusionPipeline
import torch

model_name = "Qwen/Qwen-Image"

# Load the pipeline
if torch.cuda.is_available():
    torch_dtype = torch.bfloat16
    device = "cuda"
else:
    torch_dtype = torch.float32
    device = "cpu"

pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)

🔌 加载 LoRA 权重

# Load LoRA weights
pipe.load_lora_weights("flymy-ai/qwen-image-anime-irl-lora", weight_name='flymy_anime_irl.safetensors', adapter_name="lora")

🎨 生成动漫风格现实生活图像

prompt = '''Real life Anime in a cozy kitchen, eating noodles with chopsticks, while a curious cat looks out the window.'''
negative_prompt = " "
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=1024,
    height=1024,
    num_inference_steps=50,
    true_cfg_scale=4,
    generator=torch.Generator(device="cuda").manual_seed(4633346 + 2) 
).images[0]

# Display the image (in Jupyter or save to file)
image.show()
# or
image.save("output.png")

🖼️ 示例输出

将动漫角色转换为逼真照片图像的示例:

🎛️ 与 ComfyUI 配合使用

我们提供了一个即用型 ComfyUI 工作流,可与我们训练的 LoRA 模型配合使用。按照以下步骤设置和使用该工作流:

设置说明

  1. 下载最新版 ComfyUI

  2. 安装 ComfyUI

    • 按照 ComfyUI 仓库 中的安装说明进行操作
    • 确保所有依赖项均已正确安装
  3. 下载 Qwen-Image 模型权重

  4. 将 Qwen-Image 权重放置到 ComfyUI 中

    • 将下载的 Qwen-Image 模型文件复制到 ComfyUI/models/ 中的相应文件夹
    • 按照模型仓库中指定的文件夹结构进行操作
  5. 下载我们预训练的 LoRA 权重

  6. 将 LoRA 权重放置到 ComfyUI 中

    • 将 LoRA 文件 flymy-ai/qwen-image-lora/pytorch_lora_weights.safetensors 复制到 ComfyUI/models/loras/
  7. 加载工作流

    • 在浏览器中打开 ComfyUI
    • 加载此仓库中的工作流文件 qwen_image_lora_example.json
    • 该工作流已预先配置为可与我们的 LoRA 模型配合使用

工作流特点

  • ✅ 预先配置用于 Qwen-Image + LoRA 推理
  • ✅ 优化设置以获得最佳质量输出
  • ✅ 轻松调整提示词和参数
  • ✅ 兼容我们所有训练的 LoRA 模型

ComfyUI 工作流提供了一个用户友好的界面,无需编写 Python 代码即可使用我们训练的 LoRA 模型生成图像。

🖼️ 工作流截图

ComfyUI Workflow

📊 动漫转真人示例

以下示例展示了我们的 LoRA 模型如何将动漫风格描述转换为逼真图像:

示例 1

Anime to Real Life Example 1

示例 2

Anime to Real Life Example 2

示例 3

Anime to Real Life Example 3

🤝 支持

如有任何问题或建议,欢迎加入我们的社区:

⭐ 如果喜欢,请别忘了给仓库点个星标!


license: apache-2.0

项目介绍

为Qwen-Image设计的LoRA模型,可将动漫风格提示转化为逼真图像,触发词“Real life Anime”,支持ComfyUI工作流,轻松生成高质量照片级效果。【此简介由AI生成】

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新