Commit
·
c114a31
1
Parent(s):
7143830
entry.py
CHANGED
|
@@ -41,6 +41,11 @@ def get_batch(keys, value_dict, N, device="cuda"):
|
|
| 41 |
.to(device)
|
| 42 |
.repeat(*N, 1)
|
| 43 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
elif key == "crop_coords_top_left":
|
| 45 |
batch["crop_coords_top_left"] = (
|
| 46 |
torch.tensor(
|
|
@@ -104,7 +109,7 @@ with torch.no_grad():
|
|
| 104 |
model.conditioner.embedders[1].device = 'cpu'
|
| 105 |
|
| 106 |
value_dict = {
|
| 107 |
-
"prompt": "
|
| 108 |
"crop_coords_top": 0, "crop_coords_left": 0, "target_height": 1024, "target_width": 1024, "aesthetic_score": 7.5,
|
| 109 |
"negative_aesthetic_score": 2.0,
|
| 110 |
}
|
|
|
|
| 41 |
.to(device)
|
| 42 |
.repeat(*N, 1)
|
| 43 |
)
|
| 44 |
+
batch_uc["original_size_as_tuple"] = (
|
| 45 |
+
torch.tensor([value_dict["orig_height"], value_dict["orig_width"]])
|
| 46 |
+
.to(device)
|
| 47 |
+
.repeat(*N, 1) / 2
|
| 48 |
+
)
|
| 49 |
elif key == "crop_coords_top_left":
|
| 50 |
batch["crop_coords_top_left"] = (
|
| 51 |
torch.tensor(
|
|
|
|
| 109 |
model.conditioner.embedders[1].device = 'cpu'
|
| 110 |
|
| 111 |
value_dict = {
|
| 112 |
+
"prompt": "dragon, digital art", "negative_prompt": "ugly, bad", "orig_height": 1024, "orig_width": 1024,
|
| 113 |
"crop_coords_top": 0, "crop_coords_left": 0, "target_height": 1024, "target_width": 1024, "aesthetic_score": 7.5,
|
| 114 |
"negative_aesthetic_score": 2.0,
|
| 115 |
}
|