mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-09-07 07:03:16 +01:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
086695d898 | |||
a63668cc93 | |||
06d3a64bb9 | |||
d7c25373bd |
@ -1,5 +1,5 @@
|
||||
[tool.bumpversion]
|
||||
current_version = "0.3.10"
|
||||
current_version = "0.3.12"
|
||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||
serialize = ["{major}.{minor}.{patch}"]
|
||||
replace = "{new_version}"
|
||||
|
@ -4,7 +4,7 @@ FROM python:3.11-slim
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
# Set version label
|
||||
ARG VERSION="0.3.10"
|
||||
ARG VERSION="0.3.12"
|
||||
LABEL version=$VERSION
|
||||
|
||||
# Copy project files into the container
|
||||
|
@ -240,7 +240,6 @@ def create_prompt_with_random_model(base_prompt: str, topic: str = "random"):
|
||||
logging.error(f"Error with OpenRouter: {e}")
|
||||
return "A colorful abstract composition" # Default fallback prompt
|
||||
|
||||
return "A colorful abstract composition" # Default fallback prompt
|
||||
|
||||
user_config = load_config()
|
||||
output_folder = user_config["comfyui"]["output_dir"]
|
@ -1,8 +1,9 @@
|
||||
import random
|
||||
import logging
|
||||
from openai import OpenAI
|
||||
from openai import OpenAI, RateLimitError
|
||||
import nest_asyncio
|
||||
from libs.generic import load_recent_prompts, load_config
|
||||
from libs.openwebui import create_prompt_on_openwebui
|
||||
import re
|
||||
nest_asyncio.apply()
|
||||
|
||||
@ -90,6 +91,20 @@ def create_prompt_on_openrouter(prompt: str, topic: str = "random", model: str =
|
||||
prompt = match.group(1)
|
||||
logging.debug(prompt)
|
||||
return prompt
|
||||
except RateLimitError as e:
|
||||
logging.warning(f"OpenRouter rate limit exceeded (429): {e}. Falling back to local OpenWebUI model.")
|
||||
# Try to use OpenWebUI as fallback
|
||||
openwebui_models = [m.strip() for m in user_config["openwebui"]["models"].split(",") if m.strip()] if "openwebui" in user_config and "models" in user_config["openwebui"] else []
|
||||
if openwebui_models:
|
||||
selected_model = random.choice(openwebui_models)
|
||||
try:
|
||||
return create_prompt_on_openwebui(user_content, topic, selected_model)
|
||||
except Exception as e2:
|
||||
logging.error(f"OpenWebUI fallback also failed: {e2}")
|
||||
return "A colorful abstract composition" # Final fallback
|
||||
else:
|
||||
logging.error("No OpenWebUI models configured for fallback.")
|
||||
return "A colorful abstract composition" # Final fallback
|
||||
except Exception as e:
|
||||
logging.error(f"Error generating prompt with OpenRouter: {e}")
|
||||
return ""
|
@ -38,7 +38,7 @@
|
||||
"inputs": {
|
||||
"filename_prefix": "ComfyUI",
|
||||
"images": [
|
||||
"8",
|
||||
"42",
|
||||
0
|
||||
]
|
||||
},
|
||||
@ -201,5 +201,19 @@
|
||||
"_meta": {
|
||||
"title": "VAELoaderMultiGPU"
|
||||
}
|
||||
},
|
||||
"42": {
|
||||
"inputs": {
|
||||
"offload_model": true,
|
||||
"offload_cache": true,
|
||||
"anything": [
|
||||
"8",
|
||||
0
|
||||
]
|
||||
},
|
||||
"class_type": "VRAMCleanup",
|
||||
"_meta": {
|
||||
"title": "🎈VRAM-Cleanup"
|
||||
}
|
||||
}
|
||||
}
|
@ -98,7 +98,7 @@
|
||||
"102": {
|
||||
"inputs": {
|
||||
"images": [
|
||||
"98",
|
||||
"129",
|
||||
0
|
||||
]
|
||||
},
|
||||
@ -143,5 +143,19 @@
|
||||
"_meta": {
|
||||
"title": "VAELoaderMultiGPU"
|
||||
}
|
||||
},
|
||||
"129": {
|
||||
"inputs": {
|
||||
"offload_model": true,
|
||||
"offload_cache": true,
|
||||
"anything": [
|
||||
"98",
|
||||
0
|
||||
]
|
||||
},
|
||||
"class_type": "VRAMCleanup",
|
||||
"_meta": {
|
||||
"title": "🎈VRAM-Cleanup"
|
||||
}
|
||||
}
|
||||
}
|
@ -52,6 +52,12 @@
|
||||
"6": {
|
||||
"inputs": {
|
||||
"text": "A bustling cyberpunk street at night, filled with neon signs, rain-soaked pavement, and futuristic street vendors. High detail, vivid neon colors, and realistic reflections.",
|
||||
"speak_and_recognation": {
|
||||
"__value__": [
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"clip": [
|
||||
"4",
|
||||
1
|
||||
@ -65,6 +71,12 @@
|
||||
"7": {
|
||||
"inputs": {
|
||||
"text": "text, watermark, deformed Avoid flat colors, poor lighting, and artificial elements. No unrealistic elements, low resolution, or flat colors. Avoid generic objects, poor lighting, and inconsistent styles, blurry, low-quality, distorted faces, overexposed lighting, extra limbs, bad anatomy, low contrast",
|
||||
"speak_and_recognation": {
|
||||
"__value__": [
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"clip": [
|
||||
"4",
|
||||
1
|
||||
@ -95,7 +107,7 @@
|
||||
"inputs": {
|
||||
"filename_prefix": "ComfyUI",
|
||||
"images": [
|
||||
"8",
|
||||
"10",
|
||||
0
|
||||
]
|
||||
},
|
||||
@ -103,5 +115,19 @@
|
||||
"_meta": {
|
||||
"title": "Save Image"
|
||||
}
|
||||
},
|
||||
"10": {
|
||||
"inputs": {
|
||||
"offload_model": true,
|
||||
"offload_cache": true,
|
||||
"anything": [
|
||||
"8",
|
||||
0
|
||||
]
|
||||
},
|
||||
"class_type": "VRAMCleanup",
|
||||
"_meta": {
|
||||
"title": "🎈VRAM-Cleanup"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user