bghira commited on
Commit
9014145
·
verified ·
1 Parent(s): f8adf1f

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +147 -0
README.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: creativeml-openrail-m
3
+ base_model: "stabilityai/stable-diffusion-xl-base-1.0"
4
+ tags:
5
+ - sdxl
6
+ - sdxl-diffusers
7
+ - text-to-image
8
+ - image-to-image
9
+ - diffusers
10
+ - simpletuner
11
+ - not-for-all-audiences
12
+ - lora
13
+ - template:sd-lora
14
+ - standard
15
+ pipeline_tag: text-to-image
16
+ inference: true
17
+ widget:
18
+ - text: 'unconditional (blank prompt)'
19
+ parameters:
20
+ negative_prompt: 'blurry, cropped, ugly'
21
+ output:
22
+ url: ./assets/image_0_0.png
23
+ - text: 'A photo-realistic image of a cat'
24
+ parameters:
25
+ negative_prompt: 'blurry, cropped, ugly'
26
+ output:
27
+ url: ./assets/image_1_0.png
28
+ - text: 'prompt not found (2)'
29
+ parameters:
30
+ negative_prompt: 'blurry, cropped, ugly'
31
+ output:
32
+ url: ./assets/image_2_0.png
33
+ - text: 'prompt not found (3)'
34
+ parameters:
35
+ negative_prompt: 'blurry, cropped, ugly'
36
+ output:
37
+ url: ./assets/image_3_0.png
38
+ ---
39
+
40
+ # simpletuner-controlnet-sdxl-lora-test
41
+
42
+ This is a standard PEFT LoRA derived from [stabilityai/stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0).
43
+
44
+ The main validation prompt used during training was:
45
+ ```
46
+ A photo-realistic image of a cat
47
+ ```
48
+
49
+
50
+ ## Validation settings
51
+ - CFG: `4.2`
52
+ - CFG Rescale: `0.0`
53
+ - Steps: `20`
54
+ - Sampler: `ddim`
55
+ - Seed: `42`
56
+ - Resolution: `1024x1024`
57
+
58
+
59
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
60
+
61
+ You can find some example images in the following gallery:
62
+
63
+
64
+ <Gallery />
65
+
66
+ The text encoder **was not** trained.
67
+ You may reuse the base model text encoder for inference.
68
+
69
+
70
+ ## Training settings
71
+
72
+ - Training epochs: 1
73
+ - Training steps: 10
74
+ - Learning rate: 3e-07
75
+ - Learning rate schedule: constant
76
+ - Warmup steps: 100
77
+ - Max grad value: 2.0
78
+ - Effective batch size: 3
79
+ - Micro-batch size: 1
80
+ - Gradient accumulation steps: 1
81
+ - Number of GPUs: 3
82
+ - Gradient checkpointing: True
83
+ - Prediction type: epsilon (extra parameters=['training_scheduler_timestep_spacing=trailing', 'inference_scheduler_timestep_spacing=trailing'])
84
+ - Optimizer: bnb-lion8bit
85
+ - Trainable parameter precision: Pure BF16
86
+ - Base model precision: `no_change`
87
+ - Caption dropout probability: 0.1%
88
+
89
+
90
+ - LoRA Rank: 16
91
+ - LoRA Alpha: None
92
+ - LoRA Dropout: 0.1
93
+ - LoRA initialisation style: default
94
+
95
+
96
+ ## Datasets
97
+
98
+ ### antelope-data
99
+ - Repeats: 0
100
+ - Total number of images: ~24
101
+ - Total number of aspect buckets: 1
102
+ - Resolution: 1.048576 megapixels
103
+ - Cropped: True
104
+ - Crop style: center
105
+ - Crop aspect: square
106
+ - Used for regularisation data: No
107
+
108
+
109
+ ## Inference
110
+
111
+
112
+ ```python
113
+ import torch
114
+ from diffusers import DiffusionPipeline
115
+
116
+ model_id = 'stabilityai/stable-diffusion-xl-base-1.0'
117
+ adapter_id = 'bghira/simpletuner-controlnet-sdxl-lora-test'
118
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
119
+ pipeline.load_lora_weights(adapter_id)
120
+
121
+ prompt = "A photo-realistic image of a cat"
122
+ negative_prompt = 'blurry, cropped, ugly'
123
+
124
+ ## Optional: quantise the model to save on vram.
125
+ ## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
126
+ #from optimum.quanto import quantize, freeze, qint8
127
+ #quantize(pipeline.unet, weights=qint8)
128
+ #freeze(pipeline.unet)
129
+
130
+ pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
131
+ model_output = pipeline(
132
+ prompt=prompt,
133
+ negative_prompt=negative_prompt,
134
+ num_inference_steps=20,
135
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
136
+ width=1024,
137
+ height=1024,
138
+ guidance_scale=4.2,
139
+ guidance_rescale=0.0,
140
+ ).images[0]
141
+
142
+ model_output.save("output.png", format="PNG")
143
+
144
+ ```
145
+
146
+
147
+