“All that has passed is but a prologue,
what you hold in your heart will one day echo back.” — TensorArt
TensorArt Stable Diffusion 3.5 Medium Turbo(SD3.5M Turbo)是从 StabilityAI 的 stable-diffusion-3.5-medium 中提炼出来的高性能文本到图像模型。 该模型强调稳定性和效率,适用于各种艺术风格和创意表达场景。
型号特点
- 🚀 涡轮增压性能: 生成速度更快,是多任务和高需求场景的理想选择。
- 🎨 风格多样:支持从逼真到抽象艺术等多种风格。
- 🖼️ 高分辨率输出:生成的图像清晰度极高,细节非常复杂。
- ⚙️ 易于扩展:与 LoRA 技术集成,使用户更容易定制和试验。
代码
ckpt
import torch
from diffusers import StableDiffusion3Pipeline
pipe = StableDiffusion3Pipeline.from_pretrained("tensorart/stable-diffusion-3.5-medium-turbo", torch_dtype=torch.float16,)
pipe = pipe.to("cuda")
image = pipe(
"A beautiful bald girl with silver and white futuristic metal face jewelry, her full body made of intricately carved liquid glass in the style of Tadashi, the complexity master of cyberpunk, in the style of James Jean and Peter Mohrbacher. This concept design is trending on Artstation, with sharp focus, studio-quality photography, and highly detailed, intricate details.",
num_inference_steps=8,
guidance_scale=1.5,
height=1024,
width=768
).images[0]
image.save("./test4-2.webp")
lora
import torch
from diffusers import StableDiffusion3Pipeline
import numpy as np
from safetensors.torch import load_file
from huggingface_hub import hf_hub_download
repo = "tensorart/stable-diffusion-3.5-medium-turbo"
ckpt = "lora_sd3.5m_turbo_8steps.safetensors"
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-medium", torch_dtype=torch.float16,)
pipe = pipe.to("cuda")
pipe.load_lora_weights(hf_hub_download(repo, ckpt))
pipe.fuse_lora()
pipe = pipe.to("cuda")
image = pipe(
"A beautiful bald girl with silver and white futuristic metal face jewelry, her full body made of intricately carved liquid glass in the style of Tadashi, the complexity master of cyberpunk, in the style of James Jean and Peter Mohrbacher. This concept design is trending on Artstation, with sharp focus, studio-quality photography, and highly detailed, intricate details.",
num_inference_steps=8,
guidance_scale=1.5,
height=1024,
width=768
).images[0]
image.save("./test1.webp")