add old files requirements.txt
This commit is contained in:
25
main.py
25
main.py
@@ -1,5 +1,6 @@
|
||||
from src.image_gen import image_style, icon_gen, Styles
|
||||
from src.llm_description_gen import describe_noun
|
||||
from src.image_gen import image_style, replicate_flux_schnell_image_gen, Styles, save_image_url, \
|
||||
replicate_flux_1_1_pro_image_gen
|
||||
from src.llm_description_gen import describe_noun_llama_3_8b, describe_noun_llama_3_70b
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -7,16 +8,22 @@ if __name__ == "__main__":
|
||||
with open("./data/imageable_deduplicate.txt", "r") as fp:
|
||||
nouns = fp.read().split("\n")
|
||||
|
||||
for i in range(55, 100):
|
||||
for i in range(100):
|
||||
noun = nouns[i]
|
||||
print(f"image {noun} {i}")
|
||||
description = describe_noun(noun)
|
||||
content = str(description.content).lower()
|
||||
description = describe_noun_llama_3_70b(noun)
|
||||
content = description.lower()
|
||||
if "invalid" in content:
|
||||
continue
|
||||
|
||||
description_styled = image_style(content, style=Styles.cartoon)
|
||||
output_dir = f"./output/test1/{noun}"
|
||||
icon_gen(description_styled, quality="hd", model="dall-e-3", output=Path(output_dir))
|
||||
output_dir = Path(f"./output/test9/flux_1_1_pro/{noun}")
|
||||
content = image_style(content, Styles.cartoon)
|
||||
try:
|
||||
image_url = replicate_flux_1_1_pro_image_gen(content)
|
||||
except Exception as e:
|
||||
print(f"error: {str(e)} for content: {content}")
|
||||
continue
|
||||
|
||||
save_image_url(image_url, output_dir)
|
||||
with open(Path(output_dir) / "description.txt", "w") as fp:
|
||||
fp.write(description_styled)
|
||||
fp.write(content)
|
||||
|
||||
Reference in New Issue
Block a user