主要是将 Stable Diffusion 的 CHECKPOINT.safetensors 文件解析保存,提高基础模型加载速度
您可以通过如下git clone命令,或者ModelScope SDK来下载模型
Git下载
#Git模型下载
git clone https://www.modelscope.cn/YslLin/StableDiffusionCheckPoint.git
林鹤-人像光影摄影极限写实真实感大模型_v2.6.1
linhe-pipeline 模型使用
# 1. 下载文件
base_model_path = snapshot_download('YslLin/StableDiffusionCheckPoint', revision='v1.0.1')
# 2. 加载模型
pipe = StableDiffusionPipeline.from_pretrained(os.path.join(base_model_path, "linhe-pipeline"), safety_checker=None, torch_dtype=torch.float32)
# 3. 推理文生图
init_image = pipe(prompt='1girl',
negative_prompt='ng_deepnegative_v1_75t,lowres,bad anatomy,bad hands',
num_inference_steps=20, guidance_scale=7, num_images_per_prompt=1,).images[0]
# 4. 显示图片
init_image.show()
AWPortrait_v1.4
awportrait-pipeline 模型使用
# 注意:更换版本号与子路径!!
# 1. 下载文件
base_model_path = snapshot_download('YslLin/StableDiffusionCheckPoint', revision='v1.0.2')
# 2. 加载模型
pipe = StableDiffusionPipeline.from_pretrained(os.path.join(base_model_path, "awportrait-pipeline"), safety_checker=None, torch_dtype=torch.float32)
# 3. 推理文生图
init_image = pipe(prompt='1girl',
negative_prompt='ng_deepnegative_v1_75t,lowres,bad anatomy,bad hands',
num_inference_steps=20, guidance_scale=7, num_images_per_prompt=1,).images[0]
# 4. 显示图片
init_image.show()
IdolTraineeJuicyBoyYear_1.0
idoltrainee-pipeline 模型使用
# 注意:更换版本号与子路径!!
# 1. 下载文件
base_model_path = snapshot_download('YslLin/StableDiffusionCheckPoint', revision='v1.0.3')
# 2. 加载模型
pipe = StableDiffusionPipeline.from_pretrained(os.path.join(base_model_path, "idoltrainee-pipeline"), safety_checker=None, torch_dtype=torch.float32)
# 3. 推理文生图
init_image = pipe(prompt='1boy',
negative_prompt='EasyNegative,ng_deepnegative_v1_75t,lowres,bad anatomy,bad hands',
num_inference_steps=20, guidance_scale=7, num_images_per_prompt=1,).images[0]
# 4. 显示图片
init_image.show()
TAILANG XL TurboLcm(mini)mix_v3
tailangsdxlturbo-pipeline 模型使用
# 这是SDXL版本的turbo,少量步数才有好效果。
# 注意:更换版本号与子路径!!
# 1. 下载文件
base_model_path = snapshot_download('YslLin/StableDiffusionCheckPoint', revision='v1.0.3')
# 2. 加载模型
pipe = StableDiffusionPipeline.from_pretrained(os.path.join(base_model_path, "tailang_sdxl_turbo-pipeline"), safety_checker=None, torch_dtype=torch.float32)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
# 3. 推理文生图
init_image = pipe(prompt='1boy',
negative_prompt='cartoon,painting,illustration,(worst quality, low quality, normal quality:2),(worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch),tooth,open mouth,bad hand,bad fingers,',
num_inference_steps=8, guidance_scale=2.5, num_images_per_prompt=1,).images[0]
# 4. 显示图片
init_image.show()
评论