Worked on reference slider script. It is working well currently. Still going to tune it a bit before a writeup though

This commit is contained in:
Jaret Burkett
2023-08-12 17:59:24 -06:00
parent fd95e7b60c
commit 196b693cf0
4 changed files with 54 additions and 33 deletions

View File

@@ -149,6 +149,7 @@ class PairedImageDataset(Dataset):
self.size = self.get_config('size', 512)
self.path = self.get_config('path', required=True)
self.default_prompt = self.get_config('default_prompt', '')
self.network_weight = self.get_config('network_weight', 1.0)
self.file_list = [os.path.join(self.path, file) for file in os.listdir(self.path) if
file.lower().endswith(('.jpg', '.jpeg', '.png', '.webp'))]
print(f" - Found {len(self.file_list)} images")
@@ -200,5 +201,5 @@ class PairedImageDataset(Dataset):
img = img.resize((width, height), Image.BICUBIC)
img = self.transform(img)
return img, prompt
return img, prompt, self.network_weight