File size: 3,616 Bytes
c3ec4c5
 
45c688e
 
 
 
 
 
 
 
 
 
 
 
c3ec4c5
45c688e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
license: cc-by-nc-4.0
base_model: stabilityai/stable-diffusion-xl-base-1.0
dataset: sshh12/planet-textures
tags:
  - stable-diffusion-xl
  - stable-diffusion-xl-diffusers
  - text-to-image
  - diffusers
  - lora
  - planets
  - space
  - procedural-generation
inference: false
---

These are LoRA adaption weights for stabilityai/stable-diffusion-xl-base-1.0. The weights were fine-tuned on the sshh12/planet-textures dataset.

Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.

| Prompt                                                                                                                              | Image                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A turquoise-hued gas giant, streaked with swirling white wisps of high-altitude clouds, wrapped in a thin, multicolored ring system | ![img_1](./imgs/img_aturquoise-huedgasgiantstreakedwithswirlingwhitewispsofhigh-altitudecloudswrappedinathinmulticoloredringsystem_ckpt1300_gs20.0_seed100.png) |
| A barren desert planet, coated in fine rusty-red sand, pockmarked with deep, dark craters, and cloaked in a thin, hazy atmosphere   | ![img_2](./imgs/img_abarrendesertplanetcoatedinfinerusty-redsandpockmarkedwithdeepdarkcratersandcloakedinathinhazyatmosphere_ckpt2000_gs10.0_seed0.png)         |
| A small, icy moon, encased in a shell of pure white ice and dust, covered with intricate patterns of frosty fissures                | ![img_3](./imgs/img_asmallicymoonencasedinashellofpurewhiteiceanddustcoveredwithintricatepatternsoffrostyfissures_ckpt2000_gs10.0_seed0.png)                    |

## 🧨 Diffusers Usage

```py
import torch
from diffusers import DiffusionPipeline, AutoencoderKL

vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", vae=vae, torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
pipe.load_lora_weights("sshh12/sdxl-lora-planet-textures")
pipe.to("cuda")

prompt = "A dwarf planet exhibiting a striking purple color, with a surface peppered with craters and towering ice formations"
negative_prompt = 'blurry, fuzzy, low resolution, cartoon, painting'

image = pipe(prompt=prompt, negative_prompt=negative_prompt, width=1024, height=512).images[0]
image
```

## Training

GitHub: https://github.com/sshh12/planet-diffusion

```py
MODEL_NAME="stabilityai/stable-diffusion-xl-base-1.0"
DATASET_NAME="sshh12/planet-textures"

!accelerate launch v2/train_text_to_image_lora_sdxl.py \
  --pretrained_model_name_or_path="$MODEL_NAME" \
  --pretrained_vae_model_name_or_path="madebyollin/sdxl-vae-fp16-fix" \
  --dataset_name="$DATASET_NAME" \
  --caption_column="text" \
  --width=1024 \
  --height=512 \
  --random_hflip \
  --random_vflip \
  --mixed_precision="fp16" \
  --use_8bit_adam \
  --train_batch_size=1 \
  --gradient_accumulation_steps=2 \
  --num_train_epochs=500 \
  --checkpointing_steps=100 \
  --learning_rate=1e-05 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --seed=0 \
  --validation_epochs=5 \
  --validation_prompt_file="v2/validation_prompts.txt" \
  --enable_xformers_memory_efficient_attention \
  --report_to="wandb"
```