Upload 3 files
Browse files- configs/sd_xl_base.yaml +93 -0
- configs/sd_xl_inpaint.yaml +98 -0
- configs/v1-inpainting-inference.yaml +70 -0
configs/sd_xl_base.yaml
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
target: sgm.models.diffusion.DiffusionEngine
|
| 3 |
+
params:
|
| 4 |
+
scale_factor: 0.13025
|
| 5 |
+
disable_first_stage_autocast: True
|
| 6 |
+
|
| 7 |
+
denoiser_config:
|
| 8 |
+
target: sgm.modules.diffusionmodules.denoiser.DiscreteDenoiser
|
| 9 |
+
params:
|
| 10 |
+
num_idx: 1000
|
| 11 |
+
|
| 12 |
+
scaling_config:
|
| 13 |
+
target: sgm.modules.diffusionmodules.denoiser_scaling.EpsScaling
|
| 14 |
+
discretization_config:
|
| 15 |
+
target: sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization
|
| 16 |
+
|
| 17 |
+
network_config:
|
| 18 |
+
target: sgm.modules.diffusionmodules.openaimodel.UNetModel
|
| 19 |
+
params:
|
| 20 |
+
adm_in_channels: 2816
|
| 21 |
+
num_classes: sequential
|
| 22 |
+
use_checkpoint: True
|
| 23 |
+
in_channels: 4
|
| 24 |
+
out_channels: 4
|
| 25 |
+
model_channels: 320
|
| 26 |
+
attention_resolutions: [4, 2]
|
| 27 |
+
num_res_blocks: 2
|
| 28 |
+
channel_mult: [1, 2, 4]
|
| 29 |
+
num_head_channels: 64
|
| 30 |
+
use_linear_in_transformer: True
|
| 31 |
+
transformer_depth: [1, 2, 10]
|
| 32 |
+
context_dim: 2048
|
| 33 |
+
spatial_transformer_attn_type: softmax-xformers
|
| 34 |
+
|
| 35 |
+
conditioner_config:
|
| 36 |
+
target: sgm.modules.GeneralConditioner
|
| 37 |
+
params:
|
| 38 |
+
emb_models:
|
| 39 |
+
- is_trainable: False
|
| 40 |
+
input_key: txt
|
| 41 |
+
target: sgm.modules.encoders.modules.FrozenCLIPEmbedder
|
| 42 |
+
params:
|
| 43 |
+
layer: hidden
|
| 44 |
+
layer_idx: 11
|
| 45 |
+
|
| 46 |
+
- is_trainable: False
|
| 47 |
+
input_key: txt
|
| 48 |
+
target: sgm.modules.encoders.modules.FrozenOpenCLIPEmbedder2
|
| 49 |
+
params:
|
| 50 |
+
arch: ViT-bigG-14
|
| 51 |
+
version: laion2b_s39b_b160k
|
| 52 |
+
freeze: True
|
| 53 |
+
layer: penultimate
|
| 54 |
+
always_return_pooled: True
|
| 55 |
+
legacy: False
|
| 56 |
+
|
| 57 |
+
- is_trainable: False
|
| 58 |
+
input_key: original_size_as_tuple
|
| 59 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 60 |
+
params:
|
| 61 |
+
outdim: 256
|
| 62 |
+
|
| 63 |
+
- is_trainable: False
|
| 64 |
+
input_key: crop_coords_top_left
|
| 65 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 66 |
+
params:
|
| 67 |
+
outdim: 256
|
| 68 |
+
|
| 69 |
+
- is_trainable: False
|
| 70 |
+
input_key: target_size_as_tuple
|
| 71 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 72 |
+
params:
|
| 73 |
+
outdim: 256
|
| 74 |
+
|
| 75 |
+
first_stage_config:
|
| 76 |
+
target: sgm.models.autoencoder.AutoencoderKL
|
| 77 |
+
params:
|
| 78 |
+
embed_dim: 4
|
| 79 |
+
monitor: val/rec_loss
|
| 80 |
+
ddconfig:
|
| 81 |
+
attn_type: vanilla-xformers
|
| 82 |
+
double_z: true
|
| 83 |
+
z_channels: 4
|
| 84 |
+
resolution: 256
|
| 85 |
+
in_channels: 3
|
| 86 |
+
out_ch: 3
|
| 87 |
+
ch: 128
|
| 88 |
+
ch_mult: [1, 2, 4, 4]
|
| 89 |
+
num_res_blocks: 2
|
| 90 |
+
attn_resolutions: []
|
| 91 |
+
dropout: 0.0
|
| 92 |
+
lossconfig:
|
| 93 |
+
target: torch.nn.Identity
|
configs/sd_xl_inpaint.yaml
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
target: sgm.models.diffusion.DiffusionEngine
|
| 3 |
+
params:
|
| 4 |
+
scale_factor: 0.13025
|
| 5 |
+
disable_first_stage_autocast: True
|
| 6 |
+
|
| 7 |
+
denoiser_config:
|
| 8 |
+
target: sgm.modules.diffusionmodules.denoiser.DiscreteDenoiser
|
| 9 |
+
params:
|
| 10 |
+
num_idx: 1000
|
| 11 |
+
|
| 12 |
+
weighting_config:
|
| 13 |
+
target: sgm.modules.diffusionmodules.denoiser_weighting.EpsWeighting
|
| 14 |
+
scaling_config:
|
| 15 |
+
target: sgm.modules.diffusionmodules.denoiser_scaling.EpsScaling
|
| 16 |
+
discretization_config:
|
| 17 |
+
target: sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization
|
| 18 |
+
|
| 19 |
+
network_config:
|
| 20 |
+
target: sgm.modules.diffusionmodules.openaimodel.UNetModel
|
| 21 |
+
params:
|
| 22 |
+
adm_in_channels: 2816
|
| 23 |
+
num_classes: sequential
|
| 24 |
+
use_checkpoint: True
|
| 25 |
+
in_channels: 9
|
| 26 |
+
out_channels: 4
|
| 27 |
+
model_channels: 320
|
| 28 |
+
attention_resolutions: [4, 2]
|
| 29 |
+
num_res_blocks: 2
|
| 30 |
+
channel_mult: [1, 2, 4]
|
| 31 |
+
num_head_channels: 64
|
| 32 |
+
use_spatial_transformer: True
|
| 33 |
+
use_linear_in_transformer: True
|
| 34 |
+
transformer_depth: [1, 2, 10] # note: the first is unused (due to attn_res starting at 2) 32, 16, 8 --> 64, 32, 16
|
| 35 |
+
context_dim: 2048
|
| 36 |
+
spatial_transformer_attn_type: softmax-xformers
|
| 37 |
+
legacy: False
|
| 38 |
+
|
| 39 |
+
conditioner_config:
|
| 40 |
+
target: sgm.modules.GeneralConditioner
|
| 41 |
+
params:
|
| 42 |
+
emb_models:
|
| 43 |
+
# crossattn cond
|
| 44 |
+
- is_trainable: False
|
| 45 |
+
input_key: txt
|
| 46 |
+
target: sgm.modules.encoders.modules.FrozenCLIPEmbedder
|
| 47 |
+
params:
|
| 48 |
+
layer: hidden
|
| 49 |
+
layer_idx: 11
|
| 50 |
+
# crossattn and vector cond
|
| 51 |
+
- is_trainable: False
|
| 52 |
+
input_key: txt
|
| 53 |
+
target: sgm.modules.encoders.modules.FrozenOpenCLIPEmbedder2
|
| 54 |
+
params:
|
| 55 |
+
arch: ViT-bigG-14
|
| 56 |
+
version: laion2b_s39b_b160k
|
| 57 |
+
freeze: True
|
| 58 |
+
layer: penultimate
|
| 59 |
+
always_return_pooled: True
|
| 60 |
+
legacy: False
|
| 61 |
+
# vector cond
|
| 62 |
+
- is_trainable: False
|
| 63 |
+
input_key: original_size_as_tuple
|
| 64 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 65 |
+
params:
|
| 66 |
+
outdim: 256 # multiplied by two
|
| 67 |
+
# vector cond
|
| 68 |
+
- is_trainable: False
|
| 69 |
+
input_key: crop_coords_top_left
|
| 70 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 71 |
+
params:
|
| 72 |
+
outdim: 256 # multiplied by two
|
| 73 |
+
# vector cond
|
| 74 |
+
- is_trainable: False
|
| 75 |
+
input_key: target_size_as_tuple
|
| 76 |
+
target: sgm.modules.encoders.modules.ConcatTimestepEmbedderND
|
| 77 |
+
params:
|
| 78 |
+
outdim: 256 # multiplied by two
|
| 79 |
+
|
| 80 |
+
first_stage_config:
|
| 81 |
+
target: sgm.models.autoencoder.AutoencoderKLInferenceWrapper
|
| 82 |
+
params:
|
| 83 |
+
embed_dim: 4
|
| 84 |
+
monitor: val/rec_loss
|
| 85 |
+
ddconfig:
|
| 86 |
+
attn_type: vanilla-xformers
|
| 87 |
+
double_z: true
|
| 88 |
+
z_channels: 4
|
| 89 |
+
resolution: 256
|
| 90 |
+
in_channels: 3
|
| 91 |
+
out_ch: 3
|
| 92 |
+
ch: 128
|
| 93 |
+
ch_mult: [1, 2, 4, 4]
|
| 94 |
+
num_res_blocks: 2
|
| 95 |
+
attn_resolutions: []
|
| 96 |
+
dropout: 0.0
|
| 97 |
+
lossconfig:
|
| 98 |
+
target: torch.nn.Identity
|
configs/v1-inpainting-inference.yaml
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
base_learning_rate: 7.5e-05
|
| 3 |
+
target: ldm.models.diffusion.ddpm.LatentInpaintDiffusion
|
| 4 |
+
params:
|
| 5 |
+
linear_start: 0.00085
|
| 6 |
+
linear_end: 0.0120
|
| 7 |
+
num_timesteps_cond: 1
|
| 8 |
+
log_every_t: 200
|
| 9 |
+
timesteps: 1000
|
| 10 |
+
first_stage_key: "jpg"
|
| 11 |
+
cond_stage_key: "txt"
|
| 12 |
+
image_size: 64
|
| 13 |
+
channels: 4
|
| 14 |
+
cond_stage_trainable: false # Note: different from the one we trained before
|
| 15 |
+
conditioning_key: hybrid # important
|
| 16 |
+
monitor: val/loss_simple_ema
|
| 17 |
+
scale_factor: 0.18215
|
| 18 |
+
finetune_keys: null
|
| 19 |
+
|
| 20 |
+
scheduler_config: # 10000 warmup steps
|
| 21 |
+
target: ldm.lr_scheduler.LambdaLinearScheduler
|
| 22 |
+
params:
|
| 23 |
+
warm_up_steps: [ 2500 ] # NOTE for resuming. use 10000 if starting from scratch
|
| 24 |
+
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
|
| 25 |
+
f_start: [ 1.e-6 ]
|
| 26 |
+
f_max: [ 1. ]
|
| 27 |
+
f_min: [ 1. ]
|
| 28 |
+
|
| 29 |
+
unet_config:
|
| 30 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
| 31 |
+
params:
|
| 32 |
+
image_size: 32 # unused
|
| 33 |
+
in_channels: 9 # 4 data + 4 downscaled image + 1 mask
|
| 34 |
+
out_channels: 4
|
| 35 |
+
model_channels: 320
|
| 36 |
+
attention_resolutions: [ 4, 2, 1 ]
|
| 37 |
+
num_res_blocks: 2
|
| 38 |
+
channel_mult: [ 1, 2, 4, 4 ]
|
| 39 |
+
num_heads: 8
|
| 40 |
+
use_spatial_transformer: True
|
| 41 |
+
transformer_depth: 1
|
| 42 |
+
context_dim: 768
|
| 43 |
+
use_checkpoint: True
|
| 44 |
+
legacy: False
|
| 45 |
+
|
| 46 |
+
first_stage_config:
|
| 47 |
+
target: ldm.models.autoencoder.AutoencoderKL
|
| 48 |
+
params:
|
| 49 |
+
embed_dim: 4
|
| 50 |
+
monitor: val/rec_loss
|
| 51 |
+
ddconfig:
|
| 52 |
+
double_z: true
|
| 53 |
+
z_channels: 4
|
| 54 |
+
resolution: 256
|
| 55 |
+
in_channels: 3
|
| 56 |
+
out_ch: 3
|
| 57 |
+
ch: 128
|
| 58 |
+
ch_mult:
|
| 59 |
+
- 1
|
| 60 |
+
- 2
|
| 61 |
+
- 4
|
| 62 |
+
- 4
|
| 63 |
+
num_res_blocks: 2
|
| 64 |
+
attn_resolutions: []
|
| 65 |
+
dropout: 0.0
|
| 66 |
+
lossconfig:
|
| 67 |
+
target: torch.nn.Identity
|
| 68 |
+
|
| 69 |
+
cond_stage_config:
|
| 70 |
+
target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
|