This commit is contained in:
lvmin 2023-08-09 15:20:07 -07:00
parent 9cdf7671e2
commit 6530ddc368
2 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,11 @@ def get_batch(keys, value_dict, N, device="cuda"):
.to(device)
.repeat(*N, 1)
)
batch_uc["original_size_as_tuple"] = (
torch.tensor([value_dict["orig_height"], value_dict["orig_width"]])
.to(device)
.repeat(*N, 1) / 2
)
elif key == "crop_coords_top_left":
batch["crop_coords_top_left"] = (
torch.tensor(
@ -104,7 +109,7 @@ with torch.no_grad():
model.conditioner.embedders[1].device = 'cpu'
value_dict = {
"prompt": "a handsome man in forest", "negative_prompt": "ugly, bad", "orig_height": 1024, "orig_width": 1024,
"prompt": "dragon, digital art", "negative_prompt": "ugly, bad", "orig_height": 1024, "orig_width": 1024,
"crop_coords_top": 0, "crop_coords_left": 0, "target_height": 1024, "target_width": 1024, "aesthetic_score": 7.5,
"negative_aesthetic_score": 2.0,
}

BIN
img.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB