Speedup Stable diffusion model Loading time

A1111 Webui

webui-user.bat
set COMMANDLINE_ARGS= --xformers --no-hashing --opt-channelslast --no-download-sd-model --lowram
set SAFETENSORS_FAST_GPU=1

stable-diffusion-webui/modules/sd_models.py
Switch
pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
by
pl_sd = safetensors.torch.load(open(checkpoint_file, 'rb').read())

pl_sd = safetensors.torch.load(open(checkpoint_file, 'rb').read())
pl_sd = {k: v.to(device) for k, v in pl_sd.items()}

Comfyui

Comfyui/Comfyui/comfy/utils.pyreplacing
sd = safetensors.torch.load_file(ckpt, device=device.type)
by
sd = safetensors.torch.load(open(ckpt, 'rb').read())

It will increased the speed from the HDD x6 times, from 15M/s to 200MB/s

Google Gemma

Download ollama Client: 【Click Here

普通7B版 安装指令:(适合8G显存)

ollama run gemma:7b

如果你是第一次部署,它会自动下载!

7B的全量版本:(需要16G左右的显存)

ollama run gemma:7b-instruct-fp16

2B轻量版:(适合CPU会低配电脑安装)

ollama run gemma:2b

ModelParametersSizeDownload
Llama 27B3.8GBollama run llama2
Mistral7B4.1GBollama run mistral
Dolphin Phi2.7B1.6GBollama run dolphin-phi
Phi-22.7B1.7GBollama run phi
Neural Chat7B4.1GBollama run neural-chat
Starling7B4.1GBollama run starling-lm
Code Llama7B3.8GBollama run codellama
Llama 2 Uncensored7B3.8GBollama run llama2-uncensored
Llama 2 13B13B7.3GBollama run llama2:13b
Llama 2 70B70B39GBollama run llama2:70b
Orca Mini3B1.9GBollama run orca-mini
Vicuna7B3.8GBollama run vicuna
LLaVA7B4.5GBollama run llava
Gemma2B1.4GBollama run gemma:2b
Gemma7B4.8GBollama run gemma:7b

huggingFace

https://huggingface.co/chat

Setting custom filenames in Stable Diffusion – Comfyui and Automatic1111 webui

The Stable Diffusion ComfyUI is a powerful GUI for AI image generation, but it’s also known for its limited documentation and steep learning curve for automatic1111 users.

By default, ComfyUI generated images will be dumped in the output folder with the meaningless filename ComfyUI_00001_.png with increasing numbers.

Continue reading “Setting custom filenames in Stable Diffusion – Comfyui and Automatic1111 webui”

ComfyUI shortcuts – speed up your workflow:

ShortcutExplanation
Ctrl+EnterQueue up current graph for generation
Ctrl+Shift+EnterQueue up current graph as first for generation
Ctrl+SSave workflow
Ctrl+OLoad workflow
Ctrl+ASelect all nodes
Ctrl+MMute/unmute selected nodes
DelDelete selected nodes
BackspaceDelete selected nodes
Ctrl+DelDelete the current graph
Ctrl+BackspaceDelete the current graph
SpaceMove the canvas around when held and moving the cursor
Ctrl+Left ButtonAdd clicked node to selection
Shift+Left ButtonAdd clicked node to selection
Ctrl+CCopy selected nodes
Ctrl+VPaste selected nodes while severing connections
Ctrl+Shift+VPaste selected nodes while maintaining incoming connections
Shift+Left ButtonHold and drag to move multiple selected nodes at the same time
Ctrl+DLoad default graph
QToggle visibility of the queue
HToggle visibility of history
RRefresh graph
2 X Left ButtonDouble click to open node quick search palette
Right ButtonOpen node menu

Keyboard shortcuts for Windows 10 and 11

Most users are familiar with using their computer with a keyboard and mouse. After all, this is the most intuitive method for most people. The mouse makes it easy to know what you’re pointing at, selecting, and clicking, so even first-timers don’t take too long to get the hang of it. But for proficient users, the keyboard can be a much more powerful tool, and it allows you to get things done faster. That’s why there are a ton of keyboard shortcuts in Windows 11 that help with exactly that, and we’ve compiled a list of them to help you out.

Continue reading “Keyboard shortcuts for Windows 10 and 11”

How to share model and settings when multiple sets of Stable Diffusion

I have three sets of Stable Diffusion ui installed on my computer:

  • a1111 webui
  • comfyui
  • 秋叶整合包( An integrated package of SD webui)

There are a bunch of large models, LoRA, ControlNet, plus some VAE, upscale enlargement models, etc. The ones I commonly use are about 90G. Copying three copies takes up a lot of space, and updating the version is also troublesome.

You can put all the models in one location, and then specify the model location for each SD UI.

There are usually two methods:
Mklink and Command line parameters.

1. Mklink (symbolic link)

It is similar to a folder pointer or shortcut, which allows the model folders of each SD UI, such as models, to point to the same centrally stored model folder.

Example, use mklink to create a symbolic link to point the A directory on the C drive to the B directory on the D drive:

mklink /d C:\XXX\A D:\XXX\B

Microsoft mklink documentation:

https://learn.microsoft.com/zh-cn/windows-server/administration/windows-commands/mklink

For example my model folder is:

D:\ai\models\sd\webui_using

Some commonly used model files are classified under this folder:

Continue reading “How to share model and settings when multiple sets of Stable Diffusion”

Duplicate file or floder x times with command Line

ometimes there might be a need to make multiple copies of the same file. Normally in order to make a copy of a file, one would have to open the file and click “Save As” on the Menu to the save the file in a different name. The key to having multiple copies of a file is to make sure that each file is named differently otherwise they will overlap.

Fortunately this can be done quite easily by writing some commands on the Command prompt of Windows.

Steps

  1. Create a Folder where you want to save the files.
  2. Save the File in the Folder for which you want to make multiple copies.
  3. Name the File as “cat” . For Example cat.jpg
  4. Open the Command Prompt withe CMD
  5. Change your directory to the location of the folder
  6. And then type this command
for /l %f in (1,1,5) do copy cat.pdf cat%f.pdf

On the command above “5” is the number of copies to be made. Substitute that with the number of copies you would actually need.

This is how it appears Initially. There is a Text Document named “1” on a folder.

申请SSL证书,包括FreeSSL申请、Acme脚本申请等方式

准备工作

1、域名一个

2、托管域名到 Cloudflare

3、后面 ACME 脚本申请证书,需要安装以后才可以进行使用,禁止直接使用 ACME 目录下面的证书文件。

申请 SSL 证书

FreeSSL 申请证书

这种方式申请证书,比较简单,而且还可以申请到为期一年的 “亚洲诚信” 的证书,但是,目前此网站申请证书需要进行手机验证,所以,若是有疑虑的小伙伴们还是去尝试下面其他的方法。

Acme 脚本申请证书

Acme 脚本申请证书,是我们用到的最常见的一种证书的申请方式,它有很多的申请方法,大家只需要找到一种适合自己的也就好了。

不管用下面的何种方式申请,都需要安装 Acme,有一部分的申请场景需要用到相关的插件,所以我们需要提前安装。

Continue reading “申请SSL证书,包括FreeSSL申请、Acme脚本申请等方式”