Compare commits
5 Commits
1f4af70b8c
...
38feb3e2f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38feb3e2f7 | ||
|
|
c8257eeadd | ||
|
|
2e366af581 | ||
|
|
46bea347f5 | ||
|
|
3e6ffd4160 |
@ -1,4 +1,4 @@
|
||||
import React, { useContext, useState, useEffect } from 'react';
|
||||
import React, { useContext, useState } from 'react';
|
||||
import { IRouteComponentProps } from '@umijs/types';
|
||||
import { context, Link } from 'dumi/theme';
|
||||
import Navbar from 'dumi-theme-default/src/components/Navbar';
|
||||
@ -6,7 +6,9 @@ import SideMenu from 'dumi-theme-default/src/components/SideMenu';
|
||||
import SlugList from 'dumi-theme-default/src/components/SlugList';
|
||||
import SearchBar from 'dumi-theme-default/src/components/SearchBar';
|
||||
import { Popover } from 'antd';
|
||||
import { Helmet } from 'dumi'
|
||||
import Notice from './Notice';
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import './style/layout.less';
|
||||
|
||||
const Hero = hero => (
|
||||
@ -71,10 +73,18 @@ const Features = features => (
|
||||
|
||||
const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
|
||||
const {
|
||||
config: { mode, repository },
|
||||
config,
|
||||
meta,
|
||||
locale,
|
||||
} = useContext(context);
|
||||
|
||||
const { mode, repository, logo, title } = config
|
||||
|
||||
const { pathname } = useLocation();
|
||||
|
||||
// todo 临时方案
|
||||
const hostname = 'https://brew.idayer.com'
|
||||
|
||||
const { url: repoUrl, branch, platform } = repository;
|
||||
const [menuCollapsed, setMenuCollapsed] = useState<boolean>(true);
|
||||
const isSiteMode = mode === 'site';
|
||||
@ -94,9 +104,17 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
|
||||
});
|
||||
const repoPlatform =
|
||||
{ github: 'GitHub', gitlab: 'GitLab' }[
|
||||
(repoUrl || '').match(/(github|gitlab)/)?.[1] || 'nothing'
|
||||
(repoUrl || '').match(/(github|gitlab)/)?.[1] || 'nothing'
|
||||
] || platform;
|
||||
|
||||
if(!meta.img && logo) {
|
||||
meta.img = logo
|
||||
}
|
||||
|
||||
if(meta.img.indexOf('https://') === -1) {
|
||||
meta.img = hostname + meta.img
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="__dumi-default-layout"
|
||||
@ -110,6 +128,26 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
|
||||
setMenuCollapsed(true);
|
||||
}}
|
||||
>
|
||||
<Helmet>
|
||||
{meta.title && <title>{meta.title + ' - ' + title}</title>}
|
||||
{meta.title && <meta property="og:title" content={meta.title + ' - ' + title} />}
|
||||
{meta.description && <meta name="description" content={meta.description} />}
|
||||
{meta.description && (
|
||||
<meta property="og:description" content={meta.description} />
|
||||
)}
|
||||
{meta.keywords && (
|
||||
<meta name="keywords" content={meta.keywords.join(',')} />
|
||||
)}
|
||||
{meta.keywords &&
|
||||
meta.keywords.map((keyword) => (
|
||||
<meta key={keyword} property="article:tag" content={keyword}></meta>
|
||||
))}
|
||||
{/* <meta property="og:image" content="https://brew.idayer.com/images/homebrew-256x256.png"/> */}
|
||||
{hostname && <link rel="canonical" href={hostname + pathname} />}
|
||||
{meta.img && (
|
||||
<meta property="og:image" content={meta.img} ></meta>
|
||||
)}
|
||||
</Helmet>
|
||||
<Navbar
|
||||
location={location}
|
||||
navPrefix={
|
||||
|
||||
20
.github/workflows/deploy.yml
vendored
@ -9,15 +9,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '10.x'
|
||||
node-version: 16
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm install
|
||||
run: pnpm install
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
run: pnpm run build
|
||||
|
||||
- name: Deploy to Server
|
||||
uses: burnett01/rsync-deployments@5.2.1
|
||||
with:
|
||||
|
||||
41
.umirc.ts
@ -1,43 +1,12 @@
|
||||
import { defineConfig } from 'dumi';
|
||||
|
||||
export default defineConfig({
|
||||
title: 'Homebrew',
|
||||
title: 'Homebrew 中文网',
|
||||
mode: 'site',
|
||||
logo: '/images/homebrew-256x256.png',
|
||||
favicon: '/favicon.ico',
|
||||
locales: [['zh-CN', '中文']],
|
||||
metas: [
|
||||
{
|
||||
name: 'keywords',
|
||||
content: 'Mac,Homebrew,macOS',
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
content:
|
||||
'Homebrew是一款包管理工具,目前支持macOS和linux系统。主要有四个部分组成: brew、homebrew-core 、homebrew-cask、homebrew-bottles。本文主要介绍 Homebrew安装方式以及如何加速访问,顺便普及一些必要的知识。…',
|
||||
},
|
||||
{
|
||||
property: 'og:title',
|
||||
content: '镜像快速安装Homebrew教程',
|
||||
},
|
||||
{
|
||||
property: 'og:url',
|
||||
content: 'https://brew.idayer.com/',
|
||||
},
|
||||
{
|
||||
property: 'og:description',
|
||||
content:
|
||||
'Homebrew是一款包管理工具,目前支持macOS和linux系统。主要有四个部分组成: brew、homebrew-core 、homebrew-cask、homebrew-bottles。本文主要介绍 Homebrew安装方式以及如何加速访问,顺便普及一些必要的知识。…',
|
||||
},
|
||||
{
|
||||
property: 'og:image',
|
||||
content: 'https://brew.idayer.com/images/homebrew-256x256.png',
|
||||
},
|
||||
{
|
||||
property: 'og:site_name',
|
||||
content: 'Homebrew安装教程 - 镜像',
|
||||
},
|
||||
],
|
||||
metas: [],
|
||||
navs: [
|
||||
null,
|
||||
{ title: 'GitHub', path: 'https://github.com/ineo6/homebrew-install' },
|
||||
@ -66,6 +35,12 @@ export default defineConfig({
|
||||
path: '/guide/faq/',
|
||||
},
|
||||
],
|
||||
'/install': [
|
||||
{
|
||||
title: '快系列-你快了吗',
|
||||
children: ['/install/stable-diffusion-webui', '/install/nvm-for-nodejs'],
|
||||
}
|
||||
]
|
||||
},
|
||||
extraBabelPlugins: [
|
||||
[
|
||||
|
||||
@ -7,6 +7,10 @@ hero:
|
||||
- text: 快速开始
|
||||
link: /guide/start/
|
||||
footer: Open-source MIT Licensed | Copyright © 2023<br />Powered by [Neo](https://github.com/ineo6)
|
||||
|
||||
keywords: [Mac,Homebrew,macOS]
|
||||
title: 快速安装Homebrew教程
|
||||
description: Homebrew是macOS上最强大的包管理工具,可以帮你安装众多软件,本站提供的一键安装脚本可以帮你快速安装Homebrew。
|
||||
---
|
||||
|
||||
<h1 style="display: none">镜像快速安装Homebrew教程</h1>
|
||||
|
||||
266
docs/install/nvm-for-nodejs.md
Normal file
@ -0,0 +1,266 @@
|
||||
---
|
||||
nav:
|
||||
title: 快系列
|
||||
|
||||
keywords: [nvm,node,前端,mac]
|
||||
---
|
||||
|
||||
# nvm 快速安装教程
|
||||
|
||||
`nvm`作为一款`node`的版本管理工具,在前端开发中是必不可少的,但是因为`GitHub`的特殊性,导致很多人是无法用官方教程安装成功,本文旨在整理出如德芙般丝滑的安装教程。
|
||||
|
||||
本文介绍的安装方法,你可以理解为通过仓库镜像的方式安装。
|
||||
|
||||
如果你能正常稳定访问`GitHub`,则无需通过本文的加速方式安装,但是仍然可以借鉴安装流程。
|
||||
|
||||
## 安装
|
||||
|
||||
### 国内加速脚本
|
||||
|
||||
```sh
|
||||
export NVM_SOURCE=https://gitee.com/mirrors/nvm.git
|
||||
curl -o- https://gitee.com/mirrors/nvm/raw/master/install.sh | bash
|
||||
```
|
||||
|
||||
### 检验安装是否成功
|
||||
|
||||
```sh
|
||||
command -v nvm
|
||||
```
|
||||
|
||||
执行后如果显示`nvm`则表示已经安装成功。
|
||||
|
||||
如果遇到`nvm`命令找不到的问题,请查阅文末的“FAQ”。
|
||||
|
||||
### 配置
|
||||
|
||||
#### 1. 设置为系统默认node
|
||||
|
||||
因为`nvm`安装的结果都是下面这样的格式:
|
||||
|
||||
```sh
|
||||
/Users/neo/.nvm/versions/node/v14.17.4/bin/node
|
||||
```
|
||||
|
||||
为了确保在所有的`shell`以及`ide`中都可以正常工作,我们需要设置把`nvm`安装的`node`设置为系统默认。
|
||||
|
||||
```sh
|
||||
nvm alias default node
|
||||
```
|
||||
|
||||
#### 2. 设置node镜像
|
||||
|
||||
这里是给安装`node`设置镜像。
|
||||
|
||||
```sh
|
||||
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node
|
||||
nvm install node
|
||||
|
||||
// 或者
|
||||
NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node nvm install 4.2
|
||||
```
|
||||
|
||||
长期替换可以使用下面的设置:
|
||||
|
||||
```sh
|
||||
echo 'export NVM_NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"' >> ~/.zshrc
|
||||
```
|
||||
|
||||
*注意!* 上面脚本是把配置写入文件`.zshrc`,你如果对此不了解,请参考`FAQ`,确定是否更换为`.bash_profile`。
|
||||
|
||||
### 更新
|
||||
|
||||
重新执行安装脚本即可。
|
||||
|
||||
## 安装node
|
||||
|
||||
安装最新版本:
|
||||
|
||||
```shell
|
||||
nvm install node # "node"代表最新版本
|
||||
```
|
||||
|
||||
安装指定版本:
|
||||
|
||||
```shell
|
||||
nvm install 14.16.1 # or 10.10.0, 8.9.1, etc
|
||||
```
|
||||
|
||||
通过`ls-remote`可以查看所有可安装的版本列表:
|
||||
|
||||
```shell
|
||||
nvm ls-remote
|
||||
```
|
||||
|
||||
然后使用`use`启用安装的版本:
|
||||
|
||||
```shell
|
||||
// 最新版本
|
||||
nvm use node
|
||||
|
||||
// 指定版本
|
||||
nvm use 6.14.4
|
||||
```
|
||||
|
||||
你也可以通过`which`命令查看已安装`node`所在目录:
|
||||
|
||||
```shell
|
||||
nvm which 5.0
|
||||
```
|
||||
|
||||
通过以下命令可以安装最新版`npm`:
|
||||
|
||||
```shell
|
||||
nvm install-latest-npm
|
||||
```
|
||||
|
||||
### 设置终端默认node
|
||||
|
||||
`nvm`包含以下几个别名(alias):
|
||||
|
||||
- node: 已安装的`node`最新版
|
||||
- iojs: 已安装的`io.js`最新版
|
||||
- stable: 已废弃,现在是`node`的别名
|
||||
- unstable: 已废弃
|
||||
|
||||
当我们安装了新版的`node`之后,`nvm`默认还会指向旧版本,通过执行以下命令将`node`别名指向到最新版。
|
||||
|
||||
这样可以解决`node`找不到的问题。
|
||||
|
||||
```shell
|
||||
nvm alias default node
|
||||
```
|
||||
|
||||
如果你不想指向已安装的最新版`node`,可以直接指向版本号,比如:
|
||||
|
||||
```sh
|
||||
nvm alias default 16.20.1
|
||||
```
|
||||
|
||||
## 多node环境下使用
|
||||
|
||||
### 在项目中使用不同版本node
|
||||
|
||||
你可以在项目根目录中创建`.nvmrc`来指定`node`版本,文件写入想要的版本号。
|
||||
|
||||
```
|
||||
14.16.1
|
||||
```
|
||||
|
||||
然后在根目录使用`nvm use`即可,缺点就是每次都要手动执行,如果想实现自动化可以按照下面的设置。
|
||||
|
||||
#### bash
|
||||
|
||||
把下面内容追加到`~/.bashrc`:
|
||||
|
||||
```shell
|
||||
cdnvm() {
|
||||
cd "$@";
|
||||
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
|
||||
|
||||
# If there are no .nvmrc file, use the default nvm version
|
||||
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
|
||||
|
||||
declare default_version;
|
||||
default_version=$(nvm version default);
|
||||
|
||||
# If there is no default version, set it to `node`
|
||||
# This will use the latest version on your machine
|
||||
if [[ $default_version == "N/A" ]]; then
|
||||
nvm alias default node;
|
||||
default_version=$(nvm version default);
|
||||
fi
|
||||
|
||||
# If the current version is not the default version, set it to use the default version
|
||||
if [[ $(nvm current) != "$default_version" ]]; then
|
||||
nvm use default;
|
||||
fi
|
||||
|
||||
elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
|
||||
declare nvm_version
|
||||
nvm_version=$(<"$nvm_path"/.nvmrc)
|
||||
|
||||
declare locally_resolved_nvm_version
|
||||
# `nvm ls` will check all locally-available versions
|
||||
# If there are multiple matching versions, take the latest one
|
||||
# Remove the `->` and `*` characters and spaces
|
||||
# `locally_resolved_nvm_version` will be `N/A` if no local versions are found
|
||||
locally_resolved_nvm_version=$(nvm ls --no-colors "$nvm_version" | tail -1 | tr -d '\->*' | tr -d '[:space:]')
|
||||
|
||||
# If it is not already installed, install it
|
||||
# `nvm install` will implicitly use the newly-installed version
|
||||
if [[ "$locally_resolved_nvm_version" == "N/A" ]]; then
|
||||
nvm install "$nvm_version";
|
||||
elif [[ $(nvm current) != "$locally_resolved_nvm_version" ]]; then
|
||||
nvm use "$nvm_version";
|
||||
fi
|
||||
fi
|
||||
}
|
||||
alias cd='cdnvm'
|
||||
cd $PWD
|
||||
```
|
||||
|
||||
#### zsh
|
||||
|
||||
把下面内容追加到`~/.zshrc`:
|
||||
|
||||
```shell
|
||||
# place this after nvm initialization!
|
||||
autoload -U add-zsh-hook
|
||||
load-nvmrc() {
|
||||
local node_version="$(nvm version)"
|
||||
local nvmrc_path="$(nvm_find_nvmrc)"
|
||||
|
||||
if [ -n "$nvmrc_path" ]; then
|
||||
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
||||
|
||||
if [ "$nvmrc_node_version" = "N/A" ]; then
|
||||
nvm install
|
||||
elif [ "$nvmrc_node_version" != "$node_version" ]; then
|
||||
nvm use
|
||||
fi
|
||||
elif [ "$node_version" != "$(nvm version default)" ]; then
|
||||
echo "Reverting to nvm default version"
|
||||
nvm use default
|
||||
fi
|
||||
}
|
||||
add-zsh-hook chpwd load-nvmrc
|
||||
load-nvmrc
|
||||
```
|
||||
|
||||
|
||||
### 安装时迁移全局npm包
|
||||
|
||||
执行时通过`reinstall-packages-from`参数指定旧的`node`版本,这样可以把指定版本内`npm`全局安装的包迁移到当前的`node`版本。
|
||||
|
||||
```shelo
|
||||
nvm install v12.0.0 --reinstall-packages-from=10.0
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### nvm命令找不到(command not found)
|
||||
|
||||
需要手动配置环境变量。
|
||||
|
||||
执行命令`echo $SHELL`,根据结果判断写入的文件:
|
||||
|
||||
- /bin/zsh => zsh => .zshrc
|
||||
- /bin/bash => bash => .bash_profile
|
||||
|
||||
#### .zshrc
|
||||
|
||||
```sh
|
||||
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
#### .bash_profile
|
||||
|
||||
```sh
|
||||
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bash_profile
|
||||
source ~/.bash_profile
|
||||
```
|
||||
175
docs/install/stable-diffusion-webui.md
Normal file
@ -0,0 +1,175 @@
|
||||
---
|
||||
nav:
|
||||
title: 快系列
|
||||
|
||||
keywords: [stable diffusion,chatgpt,aigc,mac]
|
||||
img: /images/16910608535268/16912211144978.jpg
|
||||
---
|
||||
|
||||
# mac极速安装stable diffusion webui教程
|
||||
|
||||
本文介绍的安装教程不需要魔法,能够让你快速在`mac`上安装`stable diffusion webui`,并且支持`m1`、`m2`、`intel`所有芯片平台运行,让我们赶紧享受吧!
|
||||
|
||||
注意:涉及到命令的执行请在终端执行。
|
||||
|
||||
## 安装 Homebrew
|
||||
|
||||
使用`Homebrew`一键安装命令:
|
||||
|
||||
```shell
|
||||
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
|
||||
```
|
||||
|
||||
请认准`Homebrew`快速安装教程:[https://brew.idayer.com](https://brew.idayer.com)。
|
||||
|
||||
安装完成后,在终端输入`brew -v`执行,如果返回版本号信息(如下),那恭喜你,完成万里长征最重要的一步。
|
||||
|
||||
```shell
|
||||
❯ brew -v
|
||||
Homebrew 4.1.0-27-g3dcf3db
|
||||
Homebrew/homebrew-core (git revision 468745ba82c; last commit 2023-07-23)
|
||||
Homebrew/homebrew-cask (git revision 4d3e61fae8; last commit 2023-07-23)
|
||||
```
|
||||
|
||||
## 安装 stable diffusion webui 的依赖
|
||||
|
||||
在终端执行下面命令安装相关依赖。
|
||||
|
||||
```shell
|
||||
brew install cmake protobuf rust python@3.10 wget
|
||||
```
|
||||
|
||||
## pip设置镜像
|
||||
|
||||
这里一定要使用阿里云的源,清华大学的源存在问题,不能安装`GFPGAN`。
|
||||
|
||||
```shell
|
||||
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
||||
```
|
||||
|
||||
如果`pip`找不到,请把`pip`替换为`pip3`再执行。
|
||||
|
||||
## 下载 stable diffusion webui 代码
|
||||
|
||||
在你想放置`stable diffusion webui`的目录下执行下面命令:
|
||||
|
||||
```shell
|
||||
git clone https://gitee.com/ineo6/stable-diffusion-webui.git
|
||||
```
|
||||
|
||||
成功后会出现一个`stable-diffusion-webui`目录,后面模型要放置的`model`就是在这里。
|
||||
|
||||
我们先进入到目录,以备后面操作使用:
|
||||
|
||||
```shell
|
||||
cd stable-diffusion-webui
|
||||
```
|
||||
|
||||
## 下载模型
|
||||
|
||||
代码克隆下来后,还需要下载模型,一般模型文件后缀为`.ckpt`或者`.safetensors`,而且都比较大,是以`G`为单位。我们可以参照 [Wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon#downloading-stable-diffusion-models) 说明上的链接在[Hugging Face](https://huggingface.co/)上进行下载,这里一般下载 1.4 或者 1.5 版本的就行。
|
||||
|
||||
- [Stable DIffusion 1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) ([sd-v1-4.ckpt](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt))
|
||||
- [Stable Diffusion 1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5) ([v1-5-pruned-emaonly.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt))
|
||||
- [Stable Diffusion 1.5 Inpainting](https://huggingface.co/runwayml/stable-diffusion-inpainting) ([sd-v1-5-inpainting.ckpt](https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt))
|
||||
- [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2) ([768-v-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt))
|
||||
- [Stable Diffusion 2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1) ([v2-1_768-ema-pruned.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt))
|
||||
|
||||
不过如果你想要下面这些很好看的图片,就要在[Civitai](https://civitai.com/)下载各种模型了。
|
||||
|
||||

|
||||
|
||||
比如模型[ChilloutMix](https://civitai.com/models/6424/chilloutmix),抖音 AI 小姐姐大多数都是基于这个模型生成的。
|
||||
|
||||
点击页面上的`Download`按钮进行下载。
|
||||
|
||||

|
||||
|
||||
由于是`SafeTensor`类型的模型,所以下载的文件后缀为`.safetensors`,下载完成后,将该模型文件复制到下面的目录:
|
||||
|
||||
```shell
|
||||
stable-diffusion-webui/models/Stable-diffusion
|
||||
```
|
||||
|
||||
## 启动 stable diffusion webui 本体
|
||||
|
||||
我提供的`stable-diffusion-webui`内部已经预设了加速处理,不需要使用加速工具。
|
||||
|
||||
执行下面命令启动:
|
||||
|
||||
```shell
|
||||
./webui.sh
|
||||
```
|
||||
|
||||
当你看到有如下内容时,大概率是成功了:
|
||||
|
||||
```shell
|
||||
Running on local URL: http://127.0.0.1:7860
|
||||
```
|
||||
|
||||
### 切换加速源
|
||||
|
||||
注意:`GitHub`加速使用的是第三方免费的加速服务,稳定性难以保证,所以额外配置了一些备用线路。
|
||||
|
||||
如果执行`./webui.sh`后卡住很久或速度很慢,可以尝试切换加速源(在`stable-diffusion-webui`目录下执行):
|
||||
|
||||
```shell
|
||||
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/stable-diffusion-webui/raw/master/super-gh.sh)"
|
||||
```
|
||||
|
||||
执行后会显示如下内容,输入要选择的数字即可。
|
||||
|
||||
```shell
|
||||
请选择一个加速源:
|
||||
1) ghproxy.com 3) gh.ddlc.top 5) gh.con.sh
|
||||
2) ghps.cc 4) hub.gitmirror.com
|
||||
#?
|
||||
```
|
||||
|
||||
|
||||
### 针对intel
|
||||
|
||||
如果你的`mac`是`intel`芯片,打开`webui-user.sh`文件,把`export COMMANDLINE_ARGS`前面的`#`删掉。
|
||||
|
||||
```
|
||||
# for intel
|
||||
# export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --precision full --no-half"
|
||||
```
|
||||
|
||||
## 设置中文
|
||||
|
||||
默认页面是全英文的,如果你想设置中文,可以根据如下步骤操作。
|
||||
|
||||
点开`Extensions`菜单,找到`Available`中的`localization`,默认是勾选上的,将勾选去掉,然后点击`Load from`按钮。
|
||||
|
||||

|
||||
|
||||
|
||||
此时一直往下拉或者搜索`zh_CN`找到`zh_CN Localization`,点击右侧的`Install`按钮安装。
|
||||
|
||||

|
||||
|
||||
|
||||
安装完成后点击上面的`Settings`菜单进入设置页面。
|
||||
|
||||

|
||||
|
||||
|
||||
点击左侧`User interface`,往下拉,找到`Localization (requires restart)`,点击选择刚下载的`zh_CN`语言,如果看不到`zh_CN`,点击右侧的刷新图标。
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
选择完`zh_CN`后页面拉到最上面点击`Apply settings`按钮保存设置,最后点击`Reload Ul`按钮。
|
||||
|
||||

|
||||
|
||||
|
||||
页面会重新加载,中文界面就显示出来了。
|
||||
|
||||
## 提示
|
||||
|
||||
如果你苦于不知道`Prompt`怎么写,可以参考[Civitai](https://civitai.com/)上网友是怎么写的,找到你喜欢的风格后,复制图片上的提示词
|
||||
|
||||

|
||||
41
install.sh
@ -73,6 +73,10 @@ ohai() {
|
||||
printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
|
||||
}
|
||||
|
||||
highlight() {
|
||||
printf "${tty_green} %s${tty_reset}\n" "$(shell_join "$@")"
|
||||
}
|
||||
|
||||
warn() {
|
||||
printf "${tty_red}Warning${tty_reset}: %s\n" "$(chomp "$1")" >&2
|
||||
}
|
||||
@ -744,17 +748,24 @@ fi
|
||||
|
||||
ohai "安装提示"
|
||||
|
||||
echo "中文安装教程(建议收藏):https://brew.idayer.com/"
|
||||
|
||||
echo "Mac下镜像飞速安装Homebrew教程(备用) :https://zhuanlan.zhihu.com/p/90508170"
|
||||
echo "Mac下镜像飞速安装Homebrew教程(请收藏):${tty_underline}https://brew.idayer.com/${tty_reset}"
|
||||
|
||||
echo "如果你想换源,可以使用镜像助手:https://brew.idayer.com/guide/change-source/"
|
||||
echo "备用:${tty_underline}https://zhuanlan.zhihu.com/p/90508170${tty_reset}"
|
||||
|
||||
echo
|
||||
echo ""
|
||||
highlight "欢迎使用[快系列]教程,必出精品,安装有保障!"
|
||||
|
||||
cat <<EOS
|
||||
|
||||
- ${tty_blue}[快系列]stable-diffusion-webui${tty_reset}: ${tty_underline}https://brew.idayer.com/install/stable-diffusion-webui${tty_reset}
|
||||
- ${tty_blue}[快系列]nvm快速安装教程${tty_reset}: ${tty_underline}https://brew.idayer.com/install/nvm-for-nodejs${tty_reset}
|
||||
|
||||
EOS
|
||||
|
||||
echo "安装遇到问题,可以通过讨论群寻求帮助。"
|
||||
|
||||
echo "也欢迎加群讨论,扫码关注公众号(湖中剑),回复'brew'加入讨论群。"
|
||||
echo "也欢迎加群讨论,扫码关注公众号:${tty_blue}湖中剑${tty_reset},回复'brew'加入讨论群。"
|
||||
|
||||
echo "
|
||||
█████████████████████████████████████
|
||||
@ -1179,7 +1190,7 @@ EOS
|
||||
fi
|
||||
|
||||
echo ""
|
||||
warn "重要信息!!!"
|
||||
echo "${tty_red}重要信息!!!${tty_reset}"
|
||||
|
||||
cat <<EOS
|
||||
如果遇到 ${tty_red}command not found brew${tty_reset},请执行下面脚本完成安装或者直接重新打开终端:
|
||||
@ -1222,15 +1233,23 @@ EOS
|
||||
|
||||
echo ""
|
||||
|
||||
ohai "维护加速脚本以及解答问题是很费时费力的工作,如果有幸帮助到你,可以考虑请我喝杯咖啡,或者给项目点个赞。"
|
||||
highlight "欢迎使用[快系列]教程,必出精品,安装有保障!"
|
||||
|
||||
cat <<EOS
|
||||
|
||||
- ${tty_blue}[快系列]stable-diffusion-webui${tty_reset}: ${tty_underline}https://brew.idayer.com/install/stable-diffusion-webui${tty_reset}
|
||||
- ${tty_blue}[快系列]nvm快速安装教程${tty_reset}: ${tty_underline}https://brew.idayer.com/install/nvm-for-nodejs${tty_reset}
|
||||
|
||||
EOS
|
||||
|
||||
echo ""
|
||||
|
||||
ohai "如果有幸帮助到你,可以考虑请我喝杯咖啡~"
|
||||
|
||||
cat <<EOS
|
||||
☕ 喝咖啡:${tty_underline}https://brew.idayer.com/reward/${tty_reset}
|
||||
EOS
|
||||
|
||||
cat <<EOS
|
||||
🌟 点赞:${tty_underline}https://github.com/ineo6/homebrew-install${tty_reset}
|
||||
🌟 点赞:${tty_underline}https://gitee.com/ineo6/homebrew-install${tty_reset}
|
||||
EOS
|
||||
echo ""
|
||||
|
||||
report_install_to_ga4 'brew_install_finish'
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/ineo6/homebrew-install#readme",
|
||||
"devDependencies": {
|
||||
"@umijs/plugin-helmet": "^1.1.4",
|
||||
"babel-plugin-import": "^1.13.3",
|
||||
"chalk": "^4.1.0",
|
||||
"download-git-repo": "^3.0.2",
|
||||
@ -47,5 +48,11 @@
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.5.0",
|
||||
"antd": "^4.13.1"
|
||||
},
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"@umijs/preset-dumi@1.1.50": "patches/@umijs__preset-dumi@1.1.50.patch",
|
||||
"@umijs/plugin-analytics@0.2.3": "patches/@umijs__plugin-analytics@0.2.3.patch"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
patches/@umijs__plugin-analytics@0.2.3.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/lib/index.js b/lib/index.js
|
||||
index c17f3109cb5dcf21cf28334b738ef145aa681f57..6ca897fbb91a88024f5b41fc580173e332a573ee 100644
|
||||
--- a/lib/index.js
|
||||
+++ b/lib/index.js
|
||||
@@ -81,7 +81,7 @@ var _default = api => {
|
||||
gtagScript.async = true;
|
||||
gtagScript.src = "https://www.googletagmanager.com/gtag/js?id=${code}";
|
||||
var scr = document.getElementsByTagName("script")[0];
|
||||
- s.parentNode.insertBefore(gtagScript, scr);
|
||||
+ scr.parentNode.insertBefore(gtagScript, scr);
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
116
patches/@umijs__preset-dumi@1.1.50.patch
Normal file
@ -0,0 +1,116 @@
|
||||
diff --git a/lib/transformer/remark/index.d.ts b/lib/transformer/remark/index.d.ts
|
||||
index 429efd0c8f4fe1b69875724a540be60fa14f9fa8..570e1aa79b65c2145bba83b2ef9eebcc59410ef9 100644
|
||||
--- a/lib/transformer/remark/index.d.ts
|
||||
+++ b/lib/transformer/remark/index.d.ts
|
||||
@@ -17,6 +17,7 @@ interface IDumiVFileData {
|
||||
* page title
|
||||
*/
|
||||
title?: string;
|
||||
+ description?: string;
|
||||
/**
|
||||
* component keywords
|
||||
*/
|
||||
diff --git a/lib/transformer/remark/index.js b/lib/transformer/remark/index.js
|
||||
index 2087f3a0d1761caf5c6c264ac76ca28d0dbf4df5..dfb517b5babb098b7f9ad817a647f4abdbcfc43e 100644
|
||||
--- a/lib/transformer/remark/index.js
|
||||
+++ b/lib/transformer/remark/index.js
|
||||
@@ -91,6 +91,7 @@ var _jsxify = _interopRequireDefault(require("./jsxify"));
|
||||
var _isolation = _interopRequireDefault(require("./isolation"));
|
||||
var _domWarn = _interopRequireDefault(require("./domWarn"));
|
||||
var _sourceCode = _interopRequireDefault(require("./sourceCode"));
|
||||
+var _rehypeDesc = _interopRequireDefault(require("./rehypeDesc"));
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
const log = (0, _utils().createDebug)('dumi:remark');
|
||||
function debug(name) {
|
||||
@@ -120,7 +121,7 @@ var _default = (source, fileAbsPath, type, masterKey) => {
|
||||
// rehype plugins
|
||||
.use(_rehypeMathjax().default).use(debug('mathjax')).use(_sourceCode.default).use(debug('sourceCode')).use(_raw.default).use(debug('raw')).use(_domWarn.default).use(debug('domWarn')).use(_rehypeRemoveComments().default, {
|
||||
removeConditional: true
|
||||
- }).use(debug('comments')).use(_code.default).use(debug('code')).use(_api.default).use(debug('api')).use(_mdComponent.default).use(_slug.default).use(debug('slug')).use(_embed.default).use(debug('embed')).use(_rehypeAutolinkHeadings().default).use(debug('headings')).use(_link.default).use(debug('link')).use(_img.default).use(debug('img')).use(_table.default).use(debug('table')).use(_previewer.default).use(debug('previewer')).use(_isolation.default).use(debug('isolation')).data('masterKey', masterKey).data('fileAbsPath', fileAbsPath).data('outputType', type);
|
||||
+ }).use(debug('comments')).use(_code.default).use(debug('code')).use(_api.default).use(debug('api')).use(_mdComponent.default).use(_slug.default).use(debug('slug')).use(_embed.default).use(debug('embed')).use(_rehypeAutolinkHeadings().default).use(debug('headings')).use(_link.default).use(debug('link')).use(_img.default).use(debug('img')).use(_table.default).use(debug('table')).use(_previewer.default).use(debug('previewer')).use(_isolation.default).use(debug('isolation')).use(_rehypeDesc.default).data('masterKey', masterKey).data('fileAbsPath', fileAbsPath).data('outputType', type);
|
||||
// apply compiler via type
|
||||
processor.use(rehypeCompiler[0], rehypeCompiler[1]);
|
||||
const result = processor.processSync(source);
|
||||
diff --git a/lib/transformer/remark/meta.js b/lib/transformer/remark/meta.js
|
||||
index 53d2d66e42417bc108bda7c72da27744dbcdb373..b7006cf0e43e293740d664e9b303692bb8c2b65e 100644
|
||||
--- a/lib/transformer/remark/meta.js
|
||||
+++ b/lib/transformer/remark/meta.js
|
||||
@@ -126,6 +126,7 @@ function meta() {
|
||||
args: _objectSpread({
|
||||
identifier: vFile.data.componentName,
|
||||
name: vFile.data.title,
|
||||
+ description: vFile.data.description,
|
||||
keywords: vFile.data.keywords,
|
||||
uuid: vFile.data.uuid,
|
||||
// use to parse props from component file
|
||||
diff --git a/lib/transformer/remark/rehypeDesc.d.ts b/lib/transformer/remark/rehypeDesc.d.ts
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..79a756f3101231b9ea35f0f0b5ee81ae6b146b11
|
||||
--- /dev/null
|
||||
+++ b/lib/transformer/remark/rehypeDesc.d.ts
|
||||
@@ -0,0 +1,5 @@
|
||||
+import type { IDumiUnifiedTransformer } from '.';
|
||||
+/**
|
||||
+ * rehype plugin to handle img source from local
|
||||
+ */
|
||||
+export default function rehypeDesc(): IDumiUnifiedTransformer;
|
||||
diff --git a/lib/transformer/remark/rehypeDesc.js b/lib/transformer/remark/rehypeDesc.js
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..94b5cfb4f40502ff4bd2d915bfba3669d930d874
|
||||
--- /dev/null
|
||||
+++ b/lib/transformer/remark/rehypeDesc.js
|
||||
@@ -0,0 +1,54 @@
|
||||
+"use strict";
|
||||
+
|
||||
+Object.defineProperty(exports, "__esModule", {
|
||||
+ value: true
|
||||
+});
|
||||
+exports.default = rehypeDesc;
|
||||
+function _path() {
|
||||
+ const data = _interopRequireDefault(require("path"));
|
||||
+ _path = function _path() {
|
||||
+ return data;
|
||||
+ };
|
||||
+ return data;
|
||||
+}
|
||||
+function _unistUtilVisit() {
|
||||
+ const data = _interopRequireDefault(require("unist-util-visit"));
|
||||
+ _unistUtilVisit = function _unistUtilVisit() {
|
||||
+ return data;
|
||||
+ };
|
||||
+ return data;
|
||||
+}
|
||||
+function _hastUtilToString() {
|
||||
+ const data = _interopRequireDefault(require("hast-util-to-string"));
|
||||
+ _hastUtilToString = function _hastUtilToString() {
|
||||
+ return data;
|
||||
+ };
|
||||
+ return data;
|
||||
+}
|
||||
+function _hastUtilIsElement() {
|
||||
+ const data = _interopRequireDefault(require("hast-util-is-element"));
|
||||
+ _hastUtilIsElement = function _hastUtilIsElement() {
|
||||
+ return data;
|
||||
+ };
|
||||
+ return data;
|
||||
+}
|
||||
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
+function isRelativeUrl(url) {
|
||||
+ return typeof url === 'string' && !/^(?:(?:blob:)?\w+:)?\/\//.test(url) && !_path().default.isAbsolute(url);
|
||||
+}
|
||||
+/**
|
||||
+ * rehype plugin to handle img source from local
|
||||
+ */
|
||||
+function rehypeDesc() {
|
||||
+ return (ast, vFile) => {
|
||||
+ (0, _unistUtilVisit().default)(ast, 'element', node => {
|
||||
+ if ((0, _hastUtilIsElement().default)(node, 'p')) {
|
||||
+ const text = (0, _hastUtilToString().default)(node).trim();
|
||||
+ if (text) {
|
||||
+ vFile.data.description = vFile.data.description || text.replace(/\r?\n|\r/g, '');
|
||||
+ return _unistUtilVisit().default.EXIT;
|
||||
+ }
|
||||
+ }
|
||||
+ });
|
||||
+ };
|
||||
+}
|
||||
7665
pnpm-lock.yaml
generated
Normal file
BIN
public/images/16910608535268/16912211144978.jpg
Normal file
|
After Width: | Height: | Size: 947 KiB |
BIN
public/images/16910608535268/16912212998388.jpg
Normal file
|
After Width: | Height: | Size: 489 KiB |
BIN
public/images/16910608535268/16913325458458.jpg
Normal file
|
After Width: | Height: | Size: 260 KiB |
BIN
public/images/16910608535268/16913325689866.jpg
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
public/images/16910608535268/16913325817555.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
public/images/16910608535268/16913326115608.jpg
Normal file
|
After Width: | Height: | Size: 420 KiB |
BIN
public/images/16910608535268/16913326271948.jpg
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
public/images/16910608535268/16913368869821.jpg
Normal file
|
After Width: | Height: | Size: 838 KiB |