Instructions to use AiArtLab/sdxs-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AiArtLab/sdxs-1b with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("AiArtLab/sdxs-1b", dtype=torch.bfloat16, device_map="cuda") prompt = "sdxs-1b" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
2604
Browse files
train.py
CHANGED
|
@@ -716,10 +716,10 @@ for epoch in range(start_epoch, start_epoch + num_epochs):
|
|
| 716 |
# шум
|
| 717 |
noise = torch.randn_like(latents, dtype=latents.dtype)
|
| 718 |
|
| 719 |
-
# 3. Время t (с
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
# интерполяция между x0 и шумом
|
| 724 |
noisy_latents = (1.0 - t.view(-1, 1, 1, 1)) * latents + t.view(-1, 1, 1, 1) * noise
|
| 725 |
# делаем integer timesteps для UNet
|
|
|
|
| 716 |
# шум
|
| 717 |
noise = torch.randn_like(latents, dtype=latents.dtype)
|
| 718 |
|
| 719 |
+
# 3. Время t, bias = -0.5 (Фокус на Деталях ~300) bias = 0.5 (Фокус на структуре) bias = 0 (колокол/ равномерно)
|
| 720 |
+
bias = 0.0
|
| 721 |
+
t = torch.sigmoid(torch.randn(latents.shape[0], device=latents.device, dtype=latents.dtype) + bias)
|
| 722 |
+
|
| 723 |
# интерполяция между x0 и шумом
|
| 724 |
noisy_latents = (1.0 - t.view(-1, 1, 1, 1)) * latents + t.view(-1, 1, 1, 1) * noise
|
| 725 |
# делаем integer timesteps для UNet
|