aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/dataset.py
diff options
context:
space:
mode:
authoralg-wiki <alg.4chan@gmail.com>2022-10-10 08:07:46 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-10 14:05:12 +0000
commitea00c1624bbb0dcb5be07f59c9509061baddf5b1 (patch)
tree318542cd14407b1244e78a5924fcc5757dd2152c /modules/textual_inversion/dataset.py
parent8f1efdc130cf7ff47cb8d3722cdfc0dbeba3069e (diff)
downloadstable-diffusion-webui-gfx803-ea00c1624bbb0dcb5be07f59c9509061baddf5b1.tar.gz
stable-diffusion-webui-gfx803-ea00c1624bbb0dcb5be07f59c9509061baddf5b1.tar.bz2
stable-diffusion-webui-gfx803-ea00c1624bbb0dcb5be07f59c9509061baddf5b1.zip
Textual Inversion: Added custom training image size and number of repeats per input image in a single epoch
Diffstat (limited to 'modules/textual_inversion/dataset.py')
-rw-r--r--modules/textual_inversion/dataset.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/textual_inversion/dataset.py b/modules/textual_inversion/dataset.py
index 7c44ea5b..acc4ce59 100644
--- a/modules/textual_inversion/dataset.py
+++ b/modules/textual_inversion/dataset.py
@@ -15,13 +15,13 @@ re_tag = re.compile(r"[a-zA-Z][_\w\d()]+")
class PersonalizedBase(Dataset):
- def __init__(self, data_root, size=None, repeats=100, flip_p=0.5, placeholder_token="*", width=512, height=512, model=None, device=None, template_file=None):
+ def __init__(self, data_root, size, repeats, flip_p=0.5, placeholder_token="*", model=None, device=None, template_file=None):
self.placeholder_token = placeholder_token
self.size = size
- self.width = width
- self.height = height
+ self.width = size
+ self.height = size
self.flip = transforms.RandomHorizontalFlip(p=flip_p)
self.dataset = []