prompt argument for comfy

This commit is contained in:
Brandon Thomas committed 2024-02-04 01:48:05 -05:00
1 parent 05025d8817
commit a1fc56ecee
2 files changed
+9

No files matched your search

@@ -67,6 +67,7 @@ pub enum ExecutableOrCommand {
pub struct InferenceArgs<'s> {
pub stderr_output_file: &'s Path,
pub stdout_output_file: &'s Path,
pub prompt_location: &'s Path,
}
impl ComfyInferenceCommand {
@@ -156,6 +157,10 @@ impl ComfyInferenceCommand {
}
}
command.push_str(" --prompt ");
command.push_str(&path_to_string(args.prompt_location));
command.push_str(" ");
if let Some(docker_options) = self.maybe_docker_options.as_ref() {
command = docker_options.to_command_string(&command);
}
@@ -324,16 +324,20 @@ pub async fn process_job(args: ComfyProcessJobArgs<'_>) -> Result<JobSuccessResu
info!("Running ComfyUI inference...");
// ==================== RUN INFERENCE SCRIPT ==================== //
let stderr_output_file = work_temp_dir.path().join("stderr.txt");
let stdout_output_file = work_temp_dir.path().join("stdout.txt");
let inference_start_time = Instant::now();
let prompt_path = PathBuf::from(&workflow_path);
let command_exit_status = model_dependencies
.inference_command
.execute_inference(InferenceArgs {
stderr_output_file: &stderr_output_file,
stdout_output_file: &stdout_output_file,
prompt_location: &prompt_path,
});
let inference_duration = Instant::now().duration_since(inference_start_time);