initial commit
This commit is contained in:
28
my_icons.py
Normal file
28
my_icons.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
from recraft_ai import sanitize_filename
|
||||
from replicate_image_models import nkodeicon_v3
|
||||
|
||||
|
||||
def run_nkodeicon_v3():
|
||||
icon_dir = os.path.expanduser("~/nkodeiconv3_my_icons")
|
||||
os.makedirs(icon_dir, exist_ok=True)
|
||||
with open("my_iconnames.txt", "r") as fp:
|
||||
prompts = fp.readlines()
|
||||
for prompt in tqdm(prompts):
|
||||
file_path = icon_dir + "/" + sanitize_filename(prompt) + ".webp"
|
||||
if os.path.exists(file_path):
|
||||
print(f"file exists {file_path}")
|
||||
continue
|
||||
|
||||
nkodeicon_v3(
|
||||
f"{prompt}",
|
||||
Path(file_path),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_nkodeicon_v3()
|
||||
Reference in New Issue
Block a user