🚀 Canopus-Textile-Patterns
Canopus-Textile-Patterns 是一个基于文本到图像生成的模型,借助 Stable Diffusion XL 基础模型,能够根据输入的文本提示生成精美的纺织图案图像,适用于设计、艺术创作等领域。
🚀 快速开始
环境设置
pipe = StableDiffusionXLPipeline.from_pretrained(
"-------------xxxxxxxxx----------",
torch_dtype=torch.float16,
use_safetensors=True,
)
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
use_safetensors=True,
)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights("prithivMLmods/Canopus-Textile-Pattern-adp-LoRA", weight_name="Canopus-Textile-Pattern-adp-LoRA.safetensors", adapter_name="tpl")
pipe.set_adapters("tpl")
pipe.to("cuda")
触发提示词
以下是一些触发图像生成的提示词示例:
- Kalamkari textile pattern, 4K
- Ikat textile pattern, 4K
- Floral textile pattern, 4K
触发关键词
你应该使用 textile pattern
来触发图像生成。
模型下载
此模型的权重以 Safetensors 格式提供。
点击下载,可在“Files & versions”标签中获取。
✨ 主要特性
- 基于 Stable Diffusion XL 基础模型,能够生成高质量的纺织图案图像。
- 支持多种纺织图案风格,如 Kalamkari、Ikat、Floral 等。
- 提供了详细的图像生成参数设置,可根据需求进行调整。
📦 安装指南
本项目的安装主要涉及环境的设置,具体代码如下:
pipe = StableDiffusionXLPipeline.from_pretrained(
"-------------xxxxxxxxx----------",
torch_dtype=torch.float16,
use_safetensors=True,
)
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
use_safetensors=True,
)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights("prithivMLmods/Canopus-Textile-Pattern-adp-LoRA", weight_name="Canopus-Textile-Pattern-adp-LoRA.safetensors", adapter_name="tpl")
pipe.set_adapters("tpl")
pipe.to("cuda")
💻 使用示例
基础用法
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
use_safetensors=True,
)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights("prithivMLmods/Canopus-Textile-Pattern-adp-LoRA", weight_name="Canopus-Textile-Pattern-adp-LoRA.safetensors", adapter_name="tpl")
pipe.set_adapters("tpl")
pipe.to("cuda")
prompt = "Floral textile pattern, 4K"
image = pipe(prompt).images[0]
image.save("output.png")
📚 详细文档
图像生成参数
参数 |
详情 |
LR Scheduler |
constant |
Noise Offset |
0.03 |
Optimizer |
AdamW |
Multires Noise Discount |
0.1 |
Network Dim |
64 |
Network Alpha |
32 |
Epoch |
09 |
Save Every N Epochs |
1 |
Multires Noise Iterations |
10 |
Repeat |
30 |
总步数 |
1080 |
提示词参数
参数 |
值 |
提示词 |
Floral textile pattern, 4K |
采样器 |
euler |
📄 许可证
本项目采用 Apache-2.0 许可证。