GazTrab commited on
Commit
1b7625c
·
verified ·
1 Parent(s): 3e15a15

Trained for 0 epochs and 6750 steps.

Browse files

Trained with datasets ['text-embed-cache', 'grayscale-lensing-256', 'grayscale-lensing-512']
Learning rate 1e-06, batch size 8, and 1 gradient accumulation steps.
Used DDPM noise scheduler for training with epsilon prediction type and rescaled_betas_zero_snr=False
Using 'trailing' timestep spacing.
Base model: kwai-kolors/kolors-diffusers
VAE: madebyollin/sdxl-vae-fp16-fix

.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/image_0_0.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/image_1_0.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: "kwai-kolors/kolors-diffusers"
4
+ tags:
5
+ - kolors
6
+ - kolors-diffusers
7
+ - text-to-image
8
+ - diffusers
9
+ - simpletuner
10
+ - safe-for-work
11
+ - full
12
+
13
+
14
+ inference: true
15
+ widget:
16
+ - text: 'unconditional (blank prompt)'
17
+ parameters:
18
+ negative_prompt: 'blurry, cropped, ugly'
19
+ output:
20
+ url: ./assets/image_0_0.png
21
+ - text: 'gravitational lensing effects on galaxy'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ ---
27
+
28
+ # gravlens-grayscale
29
+
30
+ This is a full rank finetune derived from [kwai-kolors/kolors-diffusers](https://huggingface.co/kwai-kolors/kolors-diffusers).
31
+
32
+
33
+ The main validation prompt used during training was:
34
+ ```
35
+ gravitational lensing effects on galaxy
36
+ ```
37
+
38
+
39
+ ## Validation settings
40
+ - CFG: `5.0`
41
+ - CFG Rescale: `0.0`
42
+ - Steps: `20`
43
+ - Sampler: `None`
44
+ - Seed: `42`
45
+ - Resolution: `512x512`
46
+
47
+
48
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
49
+
50
+ You can find some example images in the following gallery:
51
+
52
+
53
+ <Gallery />
54
+
55
+ The text encoder **was not** trained.
56
+ You may reuse the base model text encoder for inference.
57
+
58
+
59
+ ## Training settings
60
+
61
+ - Training epochs: 0
62
+ - Training steps: 6750
63
+ - Learning rate: 1e-06
64
+ - Learning rate schedule: constant
65
+ - Warmup steps: 675
66
+ - Max grad norm: 2.0
67
+ - Effective batch size: 8
68
+ - Micro-batch size: 8
69
+ - Gradient accumulation steps: 1
70
+ - Number of GPUs: 1
71
+ - Gradient checkpointing: True
72
+ - Prediction type: epsilon (extra parameters=['training_scheduler_timestep_spacing=trailing', 'inference_scheduler_timestep_spacing=trailing'])
73
+ - Optimizer: optimi-lion
74
+ - Trainable parameter precision: Pure BF16
75
+ - Caption dropout probability: 10.0%
76
+
77
+
78
+
79
+
80
+ ## Datasets
81
+
82
+ ### grayscale-lensing-256
83
+ - Repeats: 15
84
+ - Total number of images: 3689
85
+ - Total number of aspect buckets: 1
86
+ - Resolution: 0.065536 megapixels
87
+ - Cropped: False
88
+ - Crop style: None
89
+ - Crop aspect: None
90
+ - Used for regularisation data: No
91
+ ### grayscale-lensing-512
92
+ - Repeats: 15
93
+ - Total number of images: 1801
94
+ - Total number of aspect buckets: 1
95
+ - Resolution: 0.262144 megapixels
96
+ - Cropped: False
97
+ - Crop style: None
98
+ - Crop aspect: None
99
+ - Used for regularisation data: No
100
+
101
+
102
+ ## Inference
103
+
104
+
105
+ ```python
106
+ import torch
107
+ from diffusers import DiffusionPipeline
108
+
109
+ model_id = 'GazTrab/gravlens-grayscale'
110
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32) # loading directly in bf16
111
+
112
+ prompt = "gravitational lensing effects on galaxy"
113
+ negative_prompt = 'blurry, cropped, ugly'
114
+
115
+ 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
116
+ image = pipeline(
117
+ prompt=prompt,
118
+ negative_prompt=negative_prompt,
119
+ num_inference_steps=20,
120
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
121
+ width=512,
122
+ height=512,
123
+ guidance_scale=5.0,
124
+ guidance_rescale=0.0,
125
+ ).images[0]
126
+ image.save("output.png", format="PNG")
127
+ ```
128
+
129
+
130
+
assets/image_0_0.png ADDED

Git LFS Details

  • SHA256: 2bb77a46328c8b1f3516e8693c3ac9f7e7bd2cac03cfaf24a0999f3bfd2f7d36
  • Pointer size: 131 Bytes
  • Size of remote file: 757 kB
assets/image_1_0.png ADDED

Git LFS Details

  • SHA256: 83e894b97ccd1ecec7ca941909d51d2247ae5b5d9d15b380ee8b2c97f9913507
  • Pointer size: 132 Bytes
  • Size of remote file: 1.04 MB
model_index.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "KolorsPipeline",
3
+ "_diffusers_version": "0.32.2",
4
+ "_name_or_path": "kwai-kolors/kolors-diffusers",
5
+ "force_zeros_for_empty_prompt": false,
6
+ "scheduler": [
7
+ "diffusers",
8
+ "EulerDiscreteScheduler"
9
+ ],
10
+ "text_encoder": [
11
+ null,
12
+ null
13
+ ],
14
+ "tokenizer": [
15
+ "kolors",
16
+ "ChatGLMTokenizer"
17
+ ],
18
+ "unet": [
19
+ "diffusers",
20
+ "UNet2DConditionModel"
21
+ ],
22
+ "vae": [
23
+ "diffusers",
24
+ "AutoencoderKL"
25
+ ]
26
+ }
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "EulerDiscreteScheduler",
3
+ "_diffusers_version": "0.32.2",
4
+ "beta_end": 0.014,
5
+ "beta_schedule": "scaled_linear",
6
+ "beta_start": 0.00085,
7
+ "clip_sample": false,
8
+ "clip_sample_range": 1.0,
9
+ "dynamic_thresholding_ratio": 0.995,
10
+ "final_sigmas_type": "zero",
11
+ "interpolation_type": "linear",
12
+ "num_train_timesteps": 1100,
13
+ "prediction_type": "epsilon",
14
+ "rescale_betas_zero_snr": false,
15
+ "sample_max_value": 1.0,
16
+ "set_alpha_to_one": false,
17
+ "sigma_max": null,
18
+ "sigma_min": null,
19
+ "skip_prk_steps": true,
20
+ "steps_offset": 1,
21
+ "thresholding": false,
22
+ "timestep_spacing": "leading",
23
+ "timestep_type": "discrete",
24
+ "trained_betas": null,
25
+ "use_beta_sigmas": false,
26
+ "use_exponential_sigmas": false,
27
+ "use_karras_sigmas": false
28
+ }
tokenizer/special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
tokenizer/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7dc4c393423b76e4373e5157ddc34803a0189ba96b21ddbb40269d31468a6f2
3
+ size 1018370
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {},
3
+ "auto_map": {
4
+ "AutoTokenizer": [
5
+ "kwai-kolors/kolors-diffusers--tokenization_chatglm.ChatGLMTokenizer",
6
+ null
7
+ ]
8
+ },
9
+ "clean_up_tokenization_spaces": false,
10
+ "do_lower_case": false,
11
+ "encode_special_tokens": false,
12
+ "eos_token": "</s>",
13
+ "extra_special_tokens": {},
14
+ "model_max_length": 1000000000000000019884624838656,
15
+ "pad_token": "<unk>",
16
+ "padding_side": "left",
17
+ "remove_space": false,
18
+ "tokenizer_class": "ChatGLMTokenizer",
19
+ "unk_token": "<unk>",
20
+ "use_fast": false
21
+ }
unet/config.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "UNet2DConditionModel",
3
+ "_diffusers_version": "0.32.2",
4
+ "_name_or_path": "output/models/checkpoint-2700",
5
+ "act_fn": "silu",
6
+ "addition_embed_type": "text_time",
7
+ "addition_embed_type_num_heads": 64,
8
+ "addition_time_embed_dim": 256,
9
+ "attention_head_dim": [
10
+ 5,
11
+ 10,
12
+ 20
13
+ ],
14
+ "attention_type": "default",
15
+ "block_out_channels": [
16
+ 320,
17
+ 640,
18
+ 1280
19
+ ],
20
+ "center_input_sample": false,
21
+ "class_embed_type": null,
22
+ "class_embeddings_concat": false,
23
+ "conv_in_kernel": 3,
24
+ "conv_out_kernel": 3,
25
+ "cross_attention_dim": 2048,
26
+ "cross_attention_norm": null,
27
+ "down_block_types": [
28
+ "DownBlock2D",
29
+ "CrossAttnDownBlock2D",
30
+ "CrossAttnDownBlock2D"
31
+ ],
32
+ "downsample_padding": 1,
33
+ "dropout": 0.0,
34
+ "dual_cross_attention": false,
35
+ "encoder_hid_dim": 4096,
36
+ "encoder_hid_dim_type": "text_proj",
37
+ "flip_sin_to_cos": true,
38
+ "freq_shift": 0,
39
+ "in_channels": 4,
40
+ "layers_per_block": 2,
41
+ "mid_block_only_cross_attention": null,
42
+ "mid_block_scale_factor": 1,
43
+ "mid_block_type": "UNetMidBlock2DCrossAttn",
44
+ "norm_eps": 1e-05,
45
+ "norm_num_groups": 32,
46
+ "num_attention_heads": null,
47
+ "num_class_embeds": null,
48
+ "only_cross_attention": false,
49
+ "out_channels": 4,
50
+ "projection_class_embeddings_input_dim": 5632,
51
+ "resnet_out_scale_factor": 1.0,
52
+ "resnet_skip_time_act": false,
53
+ "resnet_time_scale_shift": "default",
54
+ "reverse_transformer_layers_per_block": null,
55
+ "sample_size": 128,
56
+ "time_cond_proj_dim": null,
57
+ "time_embedding_act_fn": null,
58
+ "time_embedding_dim": null,
59
+ "time_embedding_type": "positional",
60
+ "timestep_post_act": null,
61
+ "transformer_layers_per_block": [
62
+ 1,
63
+ 2,
64
+ 10
65
+ ],
66
+ "up_block_types": [
67
+ "CrossAttnUpBlock2D",
68
+ "CrossAttnUpBlock2D",
69
+ "UpBlock2D"
70
+ ],
71
+ "upcast_attention": false,
72
+ "use_linear_projection": true
73
+ }
unet/diffusion_pytorch_model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d422b485be0c2247962e148d7e88a713880c2261fe2d12ed2d60ed9cbc8130a7
3
+ size 9983649912
unet/diffusion_pytorch_model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fd7c26bbae870e0ecfb8201d29cad84fbd56760acc8465722da3a677e93c276
3
+ size 334408336
unet/diffusion_pytorch_model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
vae/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKL",
3
+ "_diffusers_version": "0.32.2",
4
+ "_name_or_path": "madebyollin/sdxl-vae-fp16-fix",
5
+ "act_fn": "silu",
6
+ "block_out_channels": [
7
+ 128,
8
+ 256,
9
+ 512,
10
+ 512
11
+ ],
12
+ "down_block_types": [
13
+ "DownEncoderBlock2D",
14
+ "DownEncoderBlock2D",
15
+ "DownEncoderBlock2D",
16
+ "DownEncoderBlock2D"
17
+ ],
18
+ "force_upcast": false,
19
+ "in_channels": 3,
20
+ "latent_channels": 4,
21
+ "latents_mean": null,
22
+ "latents_std": null,
23
+ "layers_per_block": 2,
24
+ "mid_block_add_attention": true,
25
+ "norm_num_groups": 32,
26
+ "out_channels": 3,
27
+ "sample_size": 512,
28
+ "scaling_factor": 0.13025,
29
+ "shift_factor": null,
30
+ "up_block_types": [
31
+ "UpDecoderBlock2D",
32
+ "UpDecoderBlock2D",
33
+ "UpDecoderBlock2D",
34
+ "UpDecoderBlock2D"
35
+ ],
36
+ "use_post_quant_conv": true,
37
+ "use_quant_conv": true
38
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba4c83179928f4f890c402a297d86a435ea020c844e323d350ca786c8a75c6c1
3
+ size 334643268