mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-04-28 11:13:41 +01:00
update flux logic
This commit is contained in:
parent
41fd1444eb
commit
073cc3bda2
21
lib.py
21
lib.py
@ -249,10 +249,20 @@ def create_image(prompt: str | None = None) -> None:
|
||||
"""Main function for generating images."""
|
||||
if prompt is None:
|
||||
prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"])
|
||||
if prompt:
|
||||
logging.info(f"Generated prompt: {prompt}") # Log generated prompt
|
||||
|
||||
if not prompt:
|
||||
logging.error("No prompt generated.")
|
||||
return
|
||||
save_prompt(prompt)
|
||||
if user_config["comfyui"]["FLUX"]:
|
||||
|
||||
use_flux = user_config["comfyui"].get("USE_FLUX", False)
|
||||
only_flux = user_config["comfyui"].get("ONLY_FLUX", False)
|
||||
|
||||
selected_workflow = "SDXL"
|
||||
if use_flux:
|
||||
selected_workflow = "FLUX" if only_flux else random.choice(["FLUX", "SDXL"])
|
||||
|
||||
if selected_workflow == "FLUX":
|
||||
generate_image(
|
||||
file_name="image",
|
||||
comfy_prompt=prompt,
|
||||
@ -267,9 +277,8 @@ def create_image(prompt: str | None = None) -> None:
|
||||
)
|
||||
else:
|
||||
generate_image("image", prompt)
|
||||
print(f"Image generation started with prompt: {prompt}")
|
||||
else:
|
||||
logging.error("No prompt generated.")
|
||||
|
||||
logging.info(f"{selected_workflow} generation started with prompt: {prompt}")
|
||||
|
||||
|
||||
def get_prompt_from_png(path):
|
||||
|
@ -11,7 +11,10 @@ output_dir = ./output/
|
||||
prompt = "Generate a random detailed prompt for stable diffusion."
|
||||
width = 1568
|
||||
height = 672
|
||||
FLUX = False
|
||||
topics =
|
||||
|
||||
USE_FLUX = False
|
||||
ONLY_FLUX = False
|
||||
|
||||
[comfyui:flux]
|
||||
models = flux1-dev-Q4_0.gguf,flux1-schnell-Q4_0.gguf
|
||||
|
Loading…
x
Reference in New Issue
Block a user