Stable Diffusion【模型】:画出那些让你惊艳的图片

环境要求:

gpu:12G+

python:3.10

cuda:11.8

注意:如果你的电脑配置达不到要求,可以考虑云GPU,买那种小时计算的比较便宜的。

一、安装stable-diffusion-webui

链接: https://pan.baidu.com/s/1N0czN9ND_TeXpucKWYIrFg 提取码: t4de 

选择文件:stable-diffusion-webui.zip和模型文件(kanpiromix_v20.safetensors)

 这里面的东西是我用官方最新代码集成的,并且下载了基础的模型,保证启动成功,从网盘中下载stable-webui并且解压到gpu上,开始进行python依赖包安装

pip install -r requirements.txt

这里看网络,时间比较长

开启web服务启动stable-webui

python launch.py --listen --xformers --enable-insecure-extension-access --theme dark --gradio-queue  --port=8080

 进入查看结果:

会出现一些错误:

问题1:libGL.so.1: cannot open shared object file: No such file or directory

sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx

问题2: 

   decoderF is not supported because:
        xFormers wasn't build with CUDA support
        attn_bias type is <class 'NoneType'>
        operator wasn't built - see python -m xformers.info for more info
    flshattF@0.0.0 is not supported because:
        xFormers wasn't build with CUDA support
        operator wasn't built - see python -m xformers.info for more info
    tritonflashattF is not supported because:
        xFormers wasn't build with CUDA support
        operator wasn't built - see python -m xformers.info for more info
        triton is not available
        Only work on pre-MLIR triton for now
    cutlassF is not supported because:
        xFormers wasn't build with CUDA support
        operator wasn't built - see python -m xformers.info for 

解决方式:

pip uninstall xformers
pip install xformers

推荐项目python conda环境安装方式:

//创建conda环境
conda create -n stable python=3.10
//激活conda环境
conda activate stable

这里可以选择指定python环境,而且还能打包python环境,由于我用的云gpu,有的时候关机节省费用,再次开机可能需要换环境

二、使用三方模型

(1)对比tensor模型

KanPiroMix v2 - v2.0 | Stable Diffusion Model - Checkpoint | Tensor.Art

 tensorart网站模型

(2)我提供的网盘模型文件kanpiromix_v20.safetensors 

將模型文件放置在 stable-diffusion-webui/models/Stable-diffusion 目錄下

参照上面测试:将上面一张图片的prompt和negative prompt作为提示词和反提示词

提示词:masutepiece, Best Quality, {Best Quality}, {{masutepiece}}, {hight resolution}, Illustration, 1girl in, Inoue Takina, Long hair, Bangs, Black hair, (Purple eyes:1.2), blush, Shirt, Long sleeves, Dress, bow ribbon, School uniform, White shirt, Collared shirt, Belt bag, Neck ribbon, Blue Dress, Green Ribbon, pleated dress, grey dress, two-tone dress, Blue belt, Lycoris Uniform, Looking at Viewer

反提示词:verybadimagenegative_v1.3, ng_deepnegative_v1_75t, (ugly face:0.8),cross-eyed,sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, bad anatomy, DeepNegative, facing away, tilted head, {Multiple people}, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worstquality, low quality, normal quality, jpegartifacts, signature, watermark, username, blurry, bad feet, cropped, poorly drawn hands, poorly drawn face, mutation, deformed, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, extra fingers, fewer digits, extra limbs, extra arms,extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed,mutated hands, polar lowres, bad body, bad proportions, gross proportions, text, error, missing fingers, missing arms, missing legs, extra digit, extra arms, extra leg, extra foot, ((repeating hair))

采样算法:DPM++ SDE  计划类型:Karras

迭代步数:23 

提示词相关性(CFG Scale):7

随机种子(Seed):1050641675

尺寸:512x768

 参考文章:

Stable Diffusion【真人模型】:全网最真实的亚洲女性大模型(附下载资源)_absolutereality 模型下载-CSDN博客

  • 23
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
要使用stable diffusion训练出自己专属的人像模型,需要按照以下步骤进行操作: 1. 数据收集:首先,需要收集足够数量和多样性的人像图片,这些图片应该包括各种不同的表情、角度和光照条件。这些图片将作为训练数据来训练模型。 2. 数据预处理:对收集到的数据进行预处理,包括裁剪、调整大小和格式转换等。确保所有的图片在输入到模型之前具有相同的尺寸和格式。 3. 网络架构设计:根据需要训练的人像模型来设计网络架构。可以选择使用现有的深度学习网络架构,如ResNet或VGG等,也可以自定义网络架构。这个网络将用于提取人像图片的特征。 4. 模型训练:使用稳定扩散(stable diffusion)方法训练模型。稳定扩散是一种用于生成对抗网络(GAN)的训练方法,通过在生成器(生成人像)和判别器(判断生成的图片是否为真实人像)之间进行迭代训练来提高生成的效果。 5. 优化与调参:在训练过程中,需要进行优化和调参,以提高模型的准确性和生成人像的质量。可以尝试不同的学习率、批量大小和训练迭代次数等参数,以找到最佳的配置。 6. 模型评估:在完成模型训练后,需要对生成的人像进行评估。可以使用一些评估指标,如峰值信噪比(PSNR)和结构相似度指标(SSIM),来评估生成的人像与真实人像之间的相似度。 7. 继续优化:如果评估结果不理想,可以根据需要进行进一步的优化。这可能包括增加训练数据的数量、改进网络架构或调整参数等。 通过以上步骤,就可以使用stable diffusion方法训练出自己专属的人像模型。这个人像模型可以用于生成逼真的人像,应用于各种创作和设计领域。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

流光影下

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值