face detailer and upscaler args

This commit is contained in:
Brandon Thomas committed 2024-05-13 16:24:34 -07:00
1 parent a7c747554a
commit d5f07376ef
6 files changed
+35

No files matched your search

@@ -134,4 +134,12 @@ pub struct WorkflowArgs {
#[serde(rename = "pa")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rollout_python_workflow_args: Option<bool>,
#[serde(rename = "fd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_face_detailer: Option<bool>,
#[serde(rename = "up")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_upscaler: Option<bool>,
}
@@ -99,6 +99,9 @@ pub struct InferenceArgs<'s> {
/// If set, Python will be in charge of overwriting the prompt JSON file
/// with the correct workflow args.
pub maybe_style: Option<StyleTransferName>,
pub face_detailer_enabled: bool,
pub upscaler_enabled: bool,
}
impl ComfyInferenceCommand {
@@ -234,6 +237,14 @@ impl ComfyInferenceCommand {
command.push_str(" ");
}
if args.face_detailer_enabled {
command.push_str(" --face-detailer-enabled=true ");
}
if args.upscaler_enabled {
command.push_str(" --upscaler-enabled=true ");
}
if let Some(docker_options) = self.maybe_docker_options.as_ref() {
command = docker_options.to_command_string(&command);
}
@@ -409,6 +409,8 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result<JobSuccessResu
maybe_positive_prompt_filename,
maybe_negative_prompt_filename,
maybe_style,
face_detailer_enabled: comfy_args.use_face_detailer.unwrap_or(false),
upscaler_enabled: comfy_args.use_upscaler.unwrap_or(false),
});
let inference_duration = Instant::now().duration_since(inference_start_time);
@@ -279,6 +279,8 @@ pub async fn enqueue_comfy_ui_handler(
enable_lipsync: None,
rollout_python_workflow_args: get_request_header_optional(&http_request, "PYTHON-WORKFLOW-ARGS")
.map(|value| str_to_bool(&value)),
use_face_detailer: None,
use_upscaler: None,
};
info!("Creating ComfyUI job record...");
@@ -78,6 +78,14 @@ pub struct EnqueueVideoStyleTransferRequest {
/// Only for premium accounts
remove_watermark: Option<bool>,
/// Use face detailer
/// Only for premium accounts
use_face_detailer: Option<bool>,
/// Use video upscaler
/// Only for premium accounts
use_upscaler: Option<bool>,
/// Optional visibility setting override.
creator_set_visibility: Option<Visibility>,
}
@@ -290,6 +298,8 @@ pub async fn enqueue_video_style_transfer_handler(
target_fps: None,
rollout_python_workflow_args: get_request_header_optional(&http_request, "PYTHON-WORKFLOW-ARGS")
.map(|value| str_to_bool(&value)),
use_face_detailer: request.use_face_detailer,
use_upscaler: request.use_upscaler,
};
info!("Creating ComfyUI job record...");
@@ -248,6 +248,8 @@ pub async fn enqueue_workflow_upload_request(
enable_lipsync: None,
rollout_python_workflow_args: get_request_header_optional(&http_request, "PYTHON-WORKFLOW-ARGS")
.map(|value| str_to_bool(&value)),
use_face_detailer: None,
use_upscaler: None,
};
// create the inference args here