start simple
This commit is contained in:
parent
250e0407a8
commit
51cd488f5f
4 changed files with 14 additions and 10 deletions
|
@ -17,10 +17,10 @@ model:
|
||||||
scale_factor: 0.18215
|
scale_factor: 0.18215
|
||||||
ckpt_path: "/fsx/stable-diffusion/stable-diffusion/checkpoints/v1pp/v1pp-flatlined-hr.ckpt"
|
ckpt_path: "/fsx/stable-diffusion/stable-diffusion/checkpoints/v1pp/v1pp-flatlined-hr.ckpt"
|
||||||
|
|
||||||
concat_keys:
|
#concat_keys:
|
||||||
- mask
|
# - mask
|
||||||
- masked_image
|
# - masked_image
|
||||||
- smoothing_strength
|
# - smoothing_strength
|
||||||
|
|
||||||
c_concat_log_start: 1
|
c_concat_log_start: 1
|
||||||
c_concat_log_end: 5
|
c_concat_log_end: 5
|
||||||
|
@ -38,7 +38,7 @@ model:
|
||||||
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
||||||
params:
|
params:
|
||||||
image_size: 32 # unused
|
image_size: 32 # unused
|
||||||
in_channels: 10 # 4 data + 4 downscaled image + 1 mask + 1 strength
|
in_channels: 9 # 4 data + 4 downscaled image + 1 mask
|
||||||
out_channels: 4
|
out_channels: 4
|
||||||
model_channels: 320
|
model_channels: 320
|
||||||
attention_resolutions: [ 4, 2, 1 ]
|
attention_resolutions: [ 4, 2, 1 ]
|
||||||
|
|
|
@ -264,8 +264,8 @@ class AddEdge(PRNGMixin):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
assert mode in list(MASK_MODES.keys()), f'unknown mask generation mode "{mode}"'
|
assert mode in list(MASK_MODES.keys()), f'unknown mask generation mode "{mode}"'
|
||||||
self.make_mask = MASK_MODES[mode]
|
self.make_mask = MASK_MODES[mode]
|
||||||
self.n_down_choices = [0, 1, 2]
|
self.n_down_choices = [0]
|
||||||
self.sigma_choices = [1, 2, 3, 4, 5]
|
self.sigma_choices = [1]
|
||||||
self.mask_edges = mask_edges
|
self.mask_edges = mask_edges
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
|
@ -285,7 +285,7 @@ class AddEdge(PRNGMixin):
|
||||||
n_choices = len(self.n_down_choices)*len(self.sigma_choices)
|
n_choices = len(self.n_down_choices)*len(self.sigma_choices)
|
||||||
raveled_idx = np.ravel_multi_index((n_down_idx, sigma_idx),
|
raveled_idx = np.ravel_multi_index((n_down_idx, sigma_idx),
|
||||||
(len(self.n_down_choices), len(self.sigma_choices)))
|
(len(self.n_down_choices), len(self.sigma_choices)))
|
||||||
normalized_idx = raveled_idx/(n_choices-1)
|
normalized_idx = raveled_idx/max(1, n_choices-1)
|
||||||
|
|
||||||
n_down = self.n_down_choices[n_down_idx]
|
n_down = self.n_down_choices[n_down_idx]
|
||||||
sigma = self.sigma_choices[sigma_idx]
|
sigma = self.sigma_choices[sigma_idx]
|
||||||
|
@ -322,6 +322,7 @@ class AddEdge(PRNGMixin):
|
||||||
sample['masked_image'] = y * (mask < 0.5)
|
sample['masked_image'] = y * (mask < 0.5)
|
||||||
else:
|
else:
|
||||||
sample['masked_image'] = y
|
sample['masked_image'] = y
|
||||||
|
sample['mask'] = torch.zeros_like(sample['mask'])
|
||||||
|
|
||||||
# concat normalized idx
|
# concat normalized idx
|
||||||
sample['smoothing_strength'] = torch.ones_like(sample['mask'])*normalized_idx
|
sample['smoothing_strength'] = torch.ones_like(sample['mask'])*normalized_idx
|
||||||
|
|
|
@ -23,6 +23,9 @@ cd /fsx/stable-diffusion/stable-diffusion
|
||||||
|
|
||||||
CONFIG="/fsx/stable-diffusion/stable-diffusion/configs/stable-diffusion/inpainting/v1-edgeinpainting.yaml"
|
CONFIG="/fsx/stable-diffusion/stable-diffusion/configs/stable-diffusion/inpainting/v1-edgeinpainting.yaml"
|
||||||
|
|
||||||
|
# start without masking
|
||||||
|
EXTRA="data.params.train.postprocess.params.mask_edges=false"
|
||||||
|
|
||||||
# resume and set new seed to reshuffle data
|
# resume and set new seed to reshuffle data
|
||||||
#EXTRA="--seed 543 --resume_from_checkpoint ..."
|
#EXTRA="--seed 543 --resume_from_checkpoint ..."
|
||||||
|
|
||||||
|
@ -38,4 +41,4 @@ CONFIG="/fsx/stable-diffusion/stable-diffusion/configs/stable-diffusion/inpainti
|
||||||
# detect bad gpus early on
|
# detect bad gpus early on
|
||||||
/bin/bash /fsx/stable-diffusion/stable-diffusion/scripts/test_gpu.sh
|
/bin/bash /fsx/stable-diffusion/stable-diffusion/scripts/test_gpu.sh
|
||||||
|
|
||||||
python main.py --base $CONFIG --gpus 0,1,2,3,4,5,6,7 -t --num_nodes ${WORLD_SIZE} --scale_lr False
|
python main.py --base $CONFIG --gpus 0,1,2,3,4,5,6,7 -t --num_nodes ${WORLD_SIZE} --scale_lr False $EXTRA
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#SBATCH --partition=compute-od-gpu
|
#SBATCH --partition=compute-od-gpu
|
||||||
#SBATCH --job-name=stable-diffusion-v1-edgeinpainting
|
#SBATCH --job-name=stable-diffusion-v1-edgeinpainting
|
||||||
#SBATCH --nodes 24
|
#SBATCH --nodes 8
|
||||||
#SBATCH --ntasks-per-node 1
|
#SBATCH --ntasks-per-node 1
|
||||||
#SBATCH --cpus-per-gpu=4
|
#SBATCH --cpus-per-gpu=4
|
||||||
#SBATCH --gres=gpu:8
|
#SBATCH --gres=gpu:8
|
||||||
|
|
Loading…
Reference in a new issue