EntropyDrop commited on
Commit
73a9705
·
1 Parent(s): 01679af
.gitignore CHANGED
@@ -1,3 +1,4 @@
1
  preserved
2
  __pycache__
3
  .env
 
 
1
  preserved
2
  __pycache__
3
  .env
4
+ .DS_Store
skins/0a21e66dd70f6edc.png → control_imgs/back/2d2e43a0dfaef1e7.png RENAMED
File without changes
skins/0f7d149545431a8b.png → control_imgs/back/4b269d1465f8ae2b.png RENAMED
File without changes
skins/3dad5e769ea6f992.png → control_imgs/back/82003b68ac565c30.png RENAMED
File without changes
skins/4009ac086d910cd0.png → control_imgs/back/d8a6aa5b94cbddda.png RENAMED
File without changes
control_imgs/back/e14cc218e86d20c7.png ADDED

Git LFS Details

  • SHA256: 53701dbb33b5f4252b10dd9690376511f69eb313a8b7e6315f473d097a3287e5
  • Pointer size: 131 Bytes
  • Size of remote file: 764 kB
{skins → control_imgs/back}/f460c219216455e4.png RENAMED
File without changes
control_imgs/front/2d2e43a0dfaef1e7.png ADDED

Git LFS Details

  • SHA256: 164b941f4e4fe7d1fe738cf613f1d181c157170acb298af06ed91612d1d14510
  • Pointer size: 131 Bytes
  • Size of remote file: 767 kB
control_imgs/front/4b269d1465f8ae2b.png ADDED

Git LFS Details

  • SHA256: 45339c1cb72bcffb8eab37d9ac3d6a9122cbe9e9c342dd82c1544e361a192f70
  • Pointer size: 131 Bytes
  • Size of remote file: 927 kB
control_imgs/front/82003b68ac565c30.png ADDED

Git LFS Details

  • SHA256: 0d11a3174196a10cc43667891bf751345ae8691933035ca657d8df9c1d34ec0d
  • Pointer size: 131 Bytes
  • Size of remote file: 786 kB
control_imgs/front/d8a6aa5b94cbddda.png ADDED

Git LFS Details

  • SHA256: 8e96d8cf0c69b48cb4349dd711fed66136c3a93a13fe7540bdb85c330a98edd3
  • Pointer size: 131 Bytes
  • Size of remote file: 866 kB
control_imgs/front/e14cc218e86d20c7.png ADDED

Git LFS Details

  • SHA256: 456e1cfa4a0900e042dcf8be9de79f2c7f730f5a815234c583e59142e8f43c5d
  • Pointer size: 131 Bytes
  • Size of remote file: 793 kB
gpt_skin2real_auto.py CHANGED
@@ -9,12 +9,17 @@ from convert_skin import convert_skin_64x32_to_64x64
9
  def main():
10
  skins_dir = "skins"
11
  control_imgs_dir = "control_imgs"
 
 
 
12
 
13
  if not os.path.exists(skins_dir):
14
  print(f"Error: Skins directory '{skins_dir}' does not exist.")
15
  sys.exit(1)
16
 
17
- os.makedirs(control_imgs_dir, exist_ok=True)
 
 
18
 
19
  # List all PNG files in skins
20
  skin_files = [f for f in os.listdir(skins_dir) if f.lower().endswith(".png")]
@@ -40,10 +45,12 @@ def main():
40
 
41
  for skin_file in skin_files:
42
  skin_path = os.path.join(skins_dir, skin_file)
43
- output_path = os.path.join(control_imgs_dir, skin_file)
 
 
44
 
45
- # Check if the output control image already exists
46
- if os.path.exists(output_path):
47
  skipped += 1
48
  continue
49
 
@@ -61,12 +68,25 @@ def main():
61
  continue
62
 
63
  # Invoke gpt_skin2real.py using subprocess
64
- cmd = [sys.executable, "gpt_skin2real.py", skin_path, "-o", output_path]
65
  print(f"[*] Running command: {' '.join(cmd)}")
66
  try:
67
  # We run the command and check for success. If it fails, we output the error but continue to other skins.
68
  subprocess.run(cmd, check=True)
69
- print(f"[+] Completed: {skin_file} -> {output_path}")
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  processed += 1
71
  except subprocess.CalledProcessError as e:
72
  print(f"[!] Command failed for {skin_file}: {e}")
 
9
  def main():
10
  skins_dir = "skins"
11
  control_imgs_dir = "control_imgs"
12
+ tmp_dir = os.path.join(control_imgs_dir, "tmp")
13
+ front_dir = os.path.join(control_imgs_dir, "front")
14
+ back_dir = os.path.join(control_imgs_dir, "back")
15
 
16
  if not os.path.exists(skins_dir):
17
  print(f"Error: Skins directory '{skins_dir}' does not exist.")
18
  sys.exit(1)
19
 
20
+ os.makedirs(tmp_dir, exist_ok=True)
21
+ os.makedirs(front_dir, exist_ok=True)
22
+ os.makedirs(back_dir, exist_ok=True)
23
 
24
  # List all PNG files in skins
25
  skin_files = [f for f in os.listdir(skins_dir) if f.lower().endswith(".png")]
 
45
 
46
  for skin_file in skin_files:
47
  skin_path = os.path.join(skins_dir, skin_file)
48
+ front_path = os.path.join(front_dir, skin_file)
49
+ back_path = os.path.join(back_dir, skin_file)
50
+ tmp_output_path = os.path.join(tmp_dir, skin_file)
51
 
52
+ # Check if the output control images (front and back) already exist
53
+ if os.path.exists(front_path) and os.path.exists(back_path):
54
  skipped += 1
55
  continue
56
 
 
68
  continue
69
 
70
  # Invoke gpt_skin2real.py using subprocess
71
+ cmd = [sys.executable, "gpt_skin2real.py", skin_path, "-o", tmp_output_path]
72
  print(f"[*] Running command: {' '.join(cmd)}")
73
  try:
74
  # We run the command and check for success. If it fails, we output the error but continue to other skins.
75
  subprocess.run(cmd, check=True)
76
+
77
+ # Split the generated image into front and back
78
+ with Image.open(tmp_output_path) as img:
79
+ width, height = img.size
80
+ left_half = img.crop((0, 0, width // 2, height))
81
+ right_half = img.crop((width // 2, 0, width, height))
82
+ left_half.save(front_path)
83
+ right_half.save(back_path)
84
+
85
+ # Clean up the temporary file in control_imgs/tmp
86
+ if os.path.exists(tmp_output_path):
87
+ os.remove(tmp_output_path)
88
+
89
+ print(f"[+] Completed: {skin_file} -> {front_path} and {back_path}")
90
  processed += 1
91
  except subprocess.CalledProcessError as e:
92
  print(f"[!] Command failed for {skin_file}: {e}")
skins/48267dc651d6765b.png DELETED

Git LFS Details

  • SHA256: 7cbb273ff35ab3c57bda56285b925de1706882919dd322ed947c7faf135ac0ed
  • Pointer size: 129 Bytes
  • Size of remote file: 1.53 kB
skins/5d25747c5a542d06.png DELETED

Git LFS Details

  • SHA256: 8b0c04232a23f46139210a23bf6e3c36d4bfad1ade0d207c62d40a6d24b20c44
  • Pointer size: 129 Bytes
  • Size of remote file: 1.61 kB
skins/add3f55a8eac224a.png DELETED

Git LFS Details

  • SHA256: d8dedc9b84ef2651dfe45b38848b6b230e79fd03515dc6c0e495c88c7c1979e5
  • Pointer size: 128 Bytes
  • Size of remote file: 851 Bytes
skins/b0803700648041c1.png DELETED

Git LFS Details

  • SHA256: bcd6a17b7e074318dd6e0f2ae76396cecad91dff11b37fecd5d0b5a0ade23fc6
  • Pointer size: 128 Bytes
  • Size of remote file: 818 Bytes
skins/c74430a976a62bd3.png DELETED

Git LFS Details

  • SHA256: b740159464d319699230d78aa50eaa0d191d0ed8eafb0a0b384714ab485bf965
  • Pointer size: 129 Bytes
  • Size of remote file: 1.03 kB
skins/da745147f2294b01.png DELETED

Git LFS Details

  • SHA256: b3ea8e38e525540735045d99db601a082b261d34e0f74981237a383c1c49624f
  • Pointer size: 128 Bytes
  • Size of remote file: 712 Bytes
skins/efa527b0fe6c9013.png DELETED

Git LFS Details

  • SHA256: fa75b385f984d15f3d0f1007b001cb5eaf17e2b02321dbb1778696ec44d240a6
  • Pointer size: 129 Bytes
  • Size of remote file: 1.38 kB
skins/f6570156f010f493.png DELETED

Git LFS Details

  • SHA256: 3c12a8996a23f35d01c0a7886ce0e29221794279699f88ec98a47d193af02617
  • Pointer size: 128 Bytes
  • Size of remote file: 681 Bytes