CodeNight-KI/text2image/main.py

34 lines
1.7 KiB
Python

from text2image import GenerateImage, Nodes, ComfyUIGenerateImageForm, load_workflow
import random
if __name__ == "__main__":
base_url = "http://172.22.0.29:8188"
client_id = "test_client"
image_file_name = "test.png"
image_file_folder = "CodeNight-KI/text2image/images"
workflow_json = load_workflow("CodeNight-KI/text2image/malerisch.json")
nodes = Nodes(
prompt=6,
negative_prompt=7,
width=5,
height=5,
seed=3,
steps=3
)
payload = ComfyUIGenerateImageForm(
workflow=workflow_json,
nodes=nodes,
# prompt="fashion photography of 23 y.o blonde woman, beautiful makeup, wearing dot dress, 35mm",
# prompt="b/w fashion photography of 23 y.o black man, instgram, 35mm",
# prompt="Cyberpunk android with glowing eyes, beautiful face, urban background, neon accents, high-tech, realistic style.",
# prompt="Cyberpunk rooftop scene, overlooking city, neon lights, futuristic skyline, atmospheric style.",
prompt="A goat with sun glasses on a skateboard. realistic. skatepark, sunny day. 35mm",
width=768,
height=768,
negative_prompt=" (octane render, render, drawing, anime, bad photo, bad photography:1.3), (worst quality, low quality, blurry:1.2), (bad teeth, deformed teeth, deformed lips), (bad anatomy, bad proportions:1.1), (deformed iris, deformed pupils), (deformed eyes, bad eyes), (deformed face, ugly face, bad face), (deformed hands, bad hands, fused fingers), morbid, mutilated, mutation, disfigured",
seed=random.randint(0, 1125899906842624),
steps=30
)
GenerateImage(payload, client_id, base_url, image_file_folder, image_file_name)