dreamshaper 7

提供商Lykon
分类text-to-image
许可证creativeml-openrail-m
下载量904.5K
星标0

简介

DreamShaper 7 是一款基于 Stable Diffusion 微调的通用型图像生成模型,旨在在写实感与艺术风格之间取得平衡。它不像某些垂直模型那样只擅长单一领域,而是能较好地处理人像、风景及概念艺术。对于习惯使用 WebUI 或 ComfyUI 的开发者来说,该模型上手门槛极低,无需复杂的 Prompt 技巧即可出好图,非常适合作为日常创作的基准模型,在保证画质的同时提供了极高的出图稳定性。

核心亮点

  • 兼顾写实与二次元,风格兼容性极强
  • 无需复杂提示词,出图质量稳定且自然
  • 完美适配 Stable Diffusion 生态工具链
  • 适用于快速原型设计与概念插画创作

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("Lykon/dreamshaper-7")
tokenizer = AutoTokenizer.from_pretrained("Lykon/dreamshaper-7")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download Lykon/dreamshaper-7

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download Lykon/dreamshaper-7 config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Lykon/dreamshaper-7')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/Lykon/dreamshaper-7

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Lykon/dreamshaper-7

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('Lykon/dreamshaper-7')
tokenizer = AutoTokenizer.from_pretrained('Lykon/dreamshaper-7')

完整文档

来源: HuggingFace

---
language:

  • en

license: creativeml-openrail-m
tags:
  • stable-diffusion

  • stable-diffusion-diffusers

  • text-to-image

  • art

  • artistic

  • diffusers

  • anime

  • dreamshaper

duplicated_from: lykon/dreamshaper-7
---

Dreamshaper 7

lykon/dreamshaper-7 is a Stable Diffusion model that has been fine-tuned on runwayml/stable-diffusion-v1-5.

Please consider supporting me:


Diffusers

For more general information on how to run text-to-image models with 🧨 Diffusers, see the docs.

1. Installation

code
pip install diffusers transformers accelerate

2. Run

py
from diffusers import AutoPipelineForText2Image, DEISMultistepScheduler
import torch

pipe = AutoPipelineForText2Image.from_pretrained('lykon/dreamshaper-7', torch_dtype=torch.float16, variant="fp16")
pipe.scheduler = DEISMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")

prompt = "portrait photo of muscular bearded guy in a worn mech suit, light bokeh, intricate, steel metal, elegant, sharp focus, soft lighting, vibrant colors"

generator = torch.manual_seed(33)
image = pipe(prompt, generator=generator, num_inference_steps=25).images[0]
image.save("./image.png")

![](./image.png)

Notes

  • Version 8 focuses on improving what V7 started. Might be harder to do photorealism compared to realism focused models, as it might be hard to do anime compared to anime focused models, but it can do both pretty well if you're skilled enough. Check the examples!
  • Version 7 improves lora support, NSFW and realism. If you're interested in "absolute" realism, try AbsoluteReality.
  • Version 6 adds more lora support and more style in general. It should also be better at generating directly at 1024 height (but be careful with it). 6.x are all improvements.
  • Version 5 is the best at photorealism and has noise offset.
  • Version 4 is much better with anime (can do them with no LoRA) and booru tags. It might be harder to control if you're used to caption style, so you might still want to use version 3.31. V4 is also better with eyes at lower resolutions. Overall is like a "fix" of V3 and shouldn't be too much different.