企业网网站怎么做,什么是网络营销网络营销的特点有哪些,工业设计灵感网站,一般通过什么渠道了解防灾减灾知识本地部署 Stable Cascade 0. 引言1. 事前准备2. 本地部署 Stable Cascade3. 使用 Stable Cascade 生成图片4. Stable Cascade Github 地址 0. 引言
Stable Cascade 模型建立在 Wrstchen 架构之上#xff0c;它与 Stable Diffusion 等其他模型的主要区别在于它的工作潜在空间要… 本地部署 Stable Cascade 0. 引言1. 事前准备2. 本地部署 Stable Cascade3. 使用 Stable Cascade 生成图片4. Stable Cascade Github 地址 0. 引言
Stable Cascade 模型建立在 Würstchen 架构之上它与 Stable Diffusion 等其他模型的主要区别在于它的工作潜在空间要小得多。为什么这很重要潜在空间越小运行推理的速度就越快训练成本就越低。
因此这种模型非常适合效率很重要的用途。此外所有已知的扩展如微调、LoRA、ControlNet、IP-Adapter、LCM 等也可以通过这种方法实现。其中一些已经在训练和推理部分提供微调、ControlNet、LoRA。
此外Stable Cascade 在视觉和评估方面都取得了令人印象深刻的结果。根据我们的评估在几乎所有比较中Stable Cascade 在快速对齐和美学质量方面都表现最佳。
Stable Cascade 对效率的关注通过其架构和更高压缩的潜在空间得到了证明。尽管最大的模型比 Stable Diffusion XL 多包含 14 亿个参数但它仍然具有更快的推理时间。 1. 事前准备
创建虚拟环境
conda create -n stable-cascade python3.11 -y
conda activate stable-cascade更新 pip
python -m pip install -U pip2. 本地部署 Stable Cascade
克隆代码
git clone https://github.com/Stability-AI/StableCascade.git; cd StableCascade安装依赖库
pip install -r .\requirements.txt下载模型(如果无法使用curl命令请直接访问每个命令后面的下载地址将文件下载到models目录下面)
curl -o ./models/stage_a.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_a.safetensors
curl -o ./models/previewer.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/previewer.safetensors
curl -o ./models/effnet_encoder.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/effnet_encoder.safetensors
# 该项目的示例代码是基于 bfloat16 的推荐下载 bfloat16 版本模型。
curl -o ./models/stage_b_bf16.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_b_bf16.safetensors
curl -o ./models/stage_c_bf16.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_c_bf16.safetensors
# 根据需要下载 float32 的文件使用 float32 模型需要进行一些代码修改不推荐新手尝试。
# curl -o ./models/stage_b.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_b.safetensors
# curl -o ./models/stage_c.safetensors -L -s -O --show-error https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_c.safetensors3. 使用 Stable Cascade 生成图片
安装 jupyterlab 库
pip install jupyterlab更新 jupyter 和 ipywidgets 库
pip install -U jupyter ipywidgets启动 jupyterlab
jupyter lab打开 inference/text_to_image.ipynb从上往下运行各段代码 Stable Cascade 刚刚发布使用 Notebook 仅适合简单体验一下估计后续会有大佬发布 Web UI。
4. Stable Cascade Github 地址
https://github.com/Stability-AI/StableCascade
完结