29 lines
704 B
Python
29 lines
704 B
Python
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()
|