V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
EatMi
V2EX  ›  分享创造

写了一个脚本,帮助你在 Mac 上一键安装 Stable Diffusion,体验 AI 绘画

  •  1
     
  •   EatMi ·
    wy-luke · 240 天前 · 3781 次点击
    这是一个创建于 240 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前帮公司设计装 SD ,后面想干脆写个脚本,一键安装。虽然咱们这里程序员居多,但还是和大家分享一下,欢迎讨论,共同进步。

    使用方法

    打开终端后执行以下命令即可自动安装

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/wy-luke/StableDiffusion-Installer-For-Mac/main/sd-installer.sh)"
    

    当然,网络原因可以使用以下命令,但是后续安装可能也会由于网络原因失败,建议先保证网络通畅

    /bin/bash -c "$(curl -fsSL https://raw.fastgit.org/wy-luke/StableDiffusion-Installer-For-Mac/main/sd-installer.sh)"
    

    更详细的使用说明可以看这里

    特性

    1. 使用 Homebrew 安装一些系统依赖

    2. 使用 Micromamba 作为 Python 包和环境管理工具。和 Conda 比起来,没有 Base 环境(为空),所以丝毫不会影响你的系统环境,而且更快。

    3. HomebrewMicromamba 均不会被添加到你的系统环境中,保证你的系统清爽如初。

    4. 项目开源,欢迎提出问题,讨论分享,欢迎 Star ⭐️ ~~~

    第 1 条附言  ·  240 天前
    https://github.com/wy-luke/StableDiffusion-Installer-For-Mac

    这个是开源仓库的地址哈,有问题可以直接在里面提 Issues ,有别的什么问题也可以一起交流

    星星数还没收藏数多呢,哈哈。欢迎大家在使用后,如果好用的话,给个 Star ⭐️ ~~~~~
    30 条回复    2023-09-05 00:00:24 +08:00
    ygtq
        1
    ygtq  
       240 天前   ❤️ 1
    大佬,写个 windows 的呗,受众更广
    EatMi
        2
    EatMi  
    OP
       240 天前   ❤️ 1
    @ygtq Win 上有秋叶大佬做的整合包,使用起来更方便,所以就想着没这个需求了,可以看看
    https://space.bilibili.com/12566101/
    TabGre
        3
    TabGre  
       240 天前 via iPhone
    本地跑主要是机器,我都是 colab 上泡的
    jian0jian
        4
    jian0jian  
       240 天前   ❤️ 1
    直接用这个 https://github.com/LykosAI/StabilityMatrix , 一键安装 Automatic 1111, Comfy UI, SD.Next (Vladmandic), VoltaML, InvokeAI, and Fooocus , 模型共用
    lin7946
        5
    lin7946  
       240 天前   ❤️ 1
    点赞大佬,晚上回去用自己电脑试试
    hanyu2pomelo
        6
    hanyu2pomelo  
       240 天前   ❤️ 1
    最近天天被这个折磨,公司要求根据这个魔改成一个新的
    WenjieYe
        7
    WenjieYe  
       240 天前   ❤️ 1
    小白问个弱智问题,这个脚本包含了、ml-stable-diffusion 吗?我看到没有使用 ANE 加速,如何加上呢?
    Luzaiv7
        8
    Luzaiv7  
       240 天前
    装 abseil 的时候一直失败
    cs3230524
        9
    cs3230524  
       240 天前
    cpu 跑太慢啦
    murmur
        10
    murmur  
       240 天前   ❤️ 1
    @ygtq windows b 站有 all in one 解压缩就可以啥都不需要自己装
    dragon710
        11
    dragon710  
       240 天前   ❤️ 1
    因特尔处理器的 mac 上可以不
    bjzhou1990
        12
    bjzhou1990  
       240 天前
    EatMi
        13
    EatMi  
    OP
       240 天前
    @dragon710 #11 可以的,intel 和 M 系列芯片都可以
    EatMi
        14
    EatMi  
    OP
       240 天前
    @cs3230524 #9 就随便玩玩,出图也挺快的,本地跑就是图个方便
    EatMi
        15
    EatMi  
    OP
       240 天前
    @TabGre #3 本地跑图个方便嘛
    EatMi
        16
    EatMi  
    OP
       240 天前
    @jian0jian #4 🐂牛!
    EatMi
        17
    EatMi  
    OP
       240 天前
    @hanyu2pomelo #6 哈哈哈,先换个皮,看看老板满意不
    EatMi
        18
    EatMi  
    OP
       240 天前
    @WenjieYe #7 没有加,这个我还没了解太多,我理解应该可以手动下载放到 SD 文件里面
    EatMi
        19
    EatMi  
    OP
       240 天前
    @Luzaiv7 #8 是使用我的这个脚本吗?可以提供更多信息吗
    EatMi
        20
    EatMi  
    OP
       240 天前
    @bjzhou1990 #12 这个好像还不支持 mac 🤔
    netty
        21
    netty  
       239 天前 via iPhone   ❤️ 1
    早前写过一篇 SD UI 介绍,可以参考一下

    https://mp.weixin.qq.com/s/WHDu7zIvybcDLbJUysTz2g
    Luzaiv7
        22
    Luzaiv7  
       239 天前
    @EatMi ==>
    Installing dependencies for protobuf: abseil
    ==> Installing protobuf dependency: abseil
    Error: Failure while executing; `/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.24\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.0\)\ curl/7.84.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://mirrors.ustc.edu.cn/homebrew-bottles/abseil-20230125.3.arm64_ventura.bottle.1.tar.gz` exited with 22. Here's the output:
    HTTP/2 404
    server: openresty
    date: Fri, 01 Sep 2023 02:22:01 GMT
    content-type: text/html; charset=UTF-8
    content-length: 150

    curl: (22) The requested URL returned error: 404

    安装失败,是否重试? [y/n]
    Installation failed, do you want to retry? [y/n]
    EatMi
        23
    EatMi  
    OP
       239 天前
    @Luzaiv7 #22 ops, 看起来像是网络问题
    Luzaiv7
        24
    Luzaiv7  
       239 天前
    @EatMi 没有啊,是 404 了
    niji
        25
    niji  
       239 天前
    hugging face 解决
    EatMi
        26
    EatMi  
    OP
       239 天前
    @niji #25 HF 确实很强,还有 Google Colab ,但是本地部署还是图个方便嘛
    EatMi
        27
    EatMi  
    OP
       239 天前
    @Luzaiv7 #24 看样子是你改了 homebrew 的源,https://mirrors.ustc.edu.cn ,换个源试试吧
    Luzaiv7
        28
    Luzaiv7  
       236 天前   ❤️ 1
    @EatMi 的确好了,感谢
    Luzaiv7
        29
    Luzaiv7  
       236 天前
    @EatMi 装到一半提示 python 版本问题,还有找不到相应的库
    stderr: ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10
    ERROR: Could not find a version that satisfies the requirement tb-nightly (from versions: none)
    ERROR: No matching distribution found for tb-nightly

    [notice] A new release of pip is available: 23.0.1 -> 23.2.1
    [notice] To update, run: pip install --upgrade pip
    EatMi
        30
    EatMi  
    OP
       236 天前
    @Luzaiv7 #29 你是换了清华源吗?应该是因为清华源里面没有 nigtly 的包
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1120 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:12 · PVG 02:12 · LAX 11:12 · JFK 14:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.