diff --git a/eve/__init__.py b/eve/__init__.py index 919cd83..bd17463 100644 --- a/eve/__init__.py +++ b/eve/__init__.py @@ -41,9 +41,13 @@ def load_env(db): # start sentry sentry_dsn = os.getenv("SENTRY_DSN") + sentry_env = "production" if db == "PROD" else "staging" if sentry_dsn: sentry_sdk.init( - dsn=sentry_dsn, traces_sample_rate=1.0, profiles_sample_rate=1.0 + dsn=sentry_dsn, + traces_sample_rate=1.0, + profiles_sample_rate=1.0, + environment=sentry_env, ) # load api keys diff --git a/eve/clients/discord/client.py b/eve/clients/discord/client.py index f102a1e..de527bd 100644 --- a/eve/clients/discord/client.py +++ b/eve/clients/discord/client.py @@ -152,7 +152,7 @@ async def async_callback(message): result = data.get("result", {}) result["result"] = prepare_result(result["result"]) output = result["result"][0]["output"][0] - url = output["url"] + url = output.get("url") # Get creation ID from the output creation_id = str(output.get("creation")) @@ -170,7 +170,7 @@ async def async_callback(message): await self.send_message( channel, url, reference=reference, view=view ) - else: + elif url: await self.send_message(channel, url, reference=reference) elif update_type == UpdateType.END_PROMPT: diff --git a/eve/clients/discord/modal_client.py b/eve/clients/discord/modal_client.py index 1396812..a27dd7e 100644 --- a/eve/clients/discord/modal_client.py +++ b/eve/clients/discord/modal_client.py @@ -21,6 +21,7 @@ .env({"DB": db}) .apt_install("libmagic1", "ffmpeg", "wget") .pip_install_from_pyproject("pyproject.toml") + .run_commands(["playwright install"]) .copy_local_dir("../workflows", "/workflows") ) diff --git a/eve/task.py b/eve/task.py index b1e1f4c..fb1fdb1 100644 --- a/eve/task.py +++ b/eve/task.py @@ -133,6 +133,8 @@ async def _task_handler(func, *args, **kwargs): # Run both functions concurrently main_task = func(*args[:-1], task.parent_tool or task.tool, task_args) preprocess_task = _preprocess_task(task) + + # preprocess_task is just a stub. it will allow us to parallelize pre-processing tasks that dont want to hold up the main task result, preprocess_result = await asyncio.gather(main_task, preprocess_task) if output_type in ["image", "video", "audio", "lora"]: @@ -141,9 +143,9 @@ async def _task_handler(func, *args, **kwargs): for output in result["output"]: # name = preprocess_result.get("name") or task_args.get("prompt") or args.get("text_input") - name = task_args.get("prompt") or args.get("text_input") + name = task_args.get("prompt") or task_args.get("text_input") if not name: - name = args.get("interpolation_prompts") or args.get("interpolation_texts") + name = task_args.get("interpolation_prompts") or task_args.get("interpolation_texts") if name: name = " to ".join(name) new_creation = Creation( diff --git a/eve/tools/flux_trainer/api.yaml b/eve/tools/flux_trainer/api.yaml index 3f7583c..ef684ab 100644 --- a/eve/tools/flux_trainer/api.yaml +++ b/eve/tools/flux_trainer/api.yaml @@ -22,7 +22,7 @@ parameters: items: type: image label: Images - description: Images to train LoRA with + description: Images to train LoRA with (Use at least 5 imgs, 10-20 is even better) required: true min_length: 1 mode: