mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 06:42:14 +00:00
more debugging, more job params
This commit is contained in:
1 parent
dbc0f5f62e
commit
397241fb84
5 files changed
+50
-5
No files matched your search
+8
@@ -26,4 +26,12 @@ pub struct StudioGen2Payload {
|
||||
#[serde(rename = "sm")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub after_job_debug_sleep_millis: Option<u64>,
|
||||
|
||||
#[serde(rename = "ow")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub output_width: Option<u64>,
|
||||
|
||||
#[serde(rename = "oh")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub output_height: Option<u64>,
|
||||
}
|
||||
+2
@@ -216,6 +216,8 @@ pub async fn process_single_studio_gen2_job(
|
||||
posenet_model_name_or_path: &gen2_deps.posenet_model_name_or_path,
|
||||
face_encoder_model_name_or_path: &gen2_deps.face_encoder_model_name_or_path,
|
||||
unet_model_name_or_path: &gen2_deps.unet_model_name_or_path,
|
||||
output_width: studio_args.output_width,
|
||||
output_height: studio_args.output_height,
|
||||
}).await;
|
||||
|
||||
let inference_duration = Instant::now().duration_since(inference_start_time);
|
||||
|
||||
+26
@@ -80,6 +80,9 @@ pub struct InferenceArgs<'s> {
|
||||
pub posenet_model_name_or_path: &'s Path,
|
||||
pub face_encoder_model_name_or_path: &'s Path,
|
||||
pub unet_model_name_or_path: &'s Path,
|
||||
|
||||
pub output_width: Option<u64>,
|
||||
pub output_height: Option<u64>,
|
||||
}
|
||||
|
||||
impl StableAnimatorCommand {
|
||||
@@ -161,6 +164,29 @@ impl StableAnimatorCommand {
|
||||
command.push_str(&path_to_string(&args.unet_model_name_or_path));
|
||||
command.push_str(" ");
|
||||
|
||||
if let Some(width) = args.output_width {
|
||||
command.push_str(" --width ");
|
||||
command.push_str(&width.to_string());
|
||||
command.push_str(" ");
|
||||
}
|
||||
|
||||
if let Some(height) = args.output_height {
|
||||
command.push_str(" --height ");
|
||||
command.push_str(&height.to_string());
|
||||
command.push_str(" ");
|
||||
}
|
||||
|
||||
// TODO(bt,2025-01-24): These should maybe be set as defaults upstream. These are from an
|
||||
// inference shell script and are not the defaults in the python arg parser.
|
||||
command.push_str(" --guidance_scale=3.0 ");
|
||||
command.push_str(" --num_inference_steps=25 ");
|
||||
command.push_str(" --tile_size=16 ");
|
||||
command.push_str(" --overlap=4 ");
|
||||
command.push_str(" --noise_aug_strength=0.02 ");
|
||||
command.push_str(" --frames_overlap=4 ");
|
||||
command.push_str(" --decode_chunk_size=4 ");
|
||||
command.push_str(" --gradient_checkpointing ");;
|
||||
|
||||
if let Some(docker_options) = self.maybe_docker_options.as_ref() {
|
||||
command = docker_options.to_command_string(&command);
|
||||
}
|
||||
|
||||
+4
-4
@@ -169,10 +169,10 @@ pub async fn validate_and_save_results(args: SaveResultsArgs<'_>) -> Result<Medi
|
||||
// .primary_video.record.maybe_style_transfer_source_media_file_token.as_ref()
|
||||
// .unwrap_or_else(|| &args.videos.primary_video.record.token);
|
||||
|
||||
let prompt_token = PromptToken::generate();
|
||||
//let prompt_token = PromptToken::generate();
|
||||
|
||||
let product = MediaFileOriginProductCategory::StorytellerStudio;
|
||||
let maybe_model_type = MediaFileOriginModelType::StorytellerStudio;
|
||||
//let product = MediaFileOriginProductCategory::StorytellerStudio;
|
||||
//let maybe_model_type = MediaFileOriginModelType::StorytellerStudio;
|
||||
|
||||
//let product = match args.comfy_args.workflow_type {
|
||||
// Some(WorkflowType::StorytellerStudio) => Some(MediaFileOriginProductCategory::StorytellerStudio),
|
||||
@@ -196,7 +196,7 @@ pub async fn validate_and_save_results(args: SaveResultsArgs<'_>) -> Result<Medi
|
||||
maybe_scene_source_media_file_token: None,
|
||||
file_size_bytes,
|
||||
sha256_checksum: &file_checksum,
|
||||
maybe_prompt_token: Some(&prompt_token),
|
||||
maybe_prompt_token: None,
|
||||
public_bucket_directory_hash: result_bucket_location.get_object_hash(),
|
||||
maybe_public_bucket_prefix: Some(PREFIX),
|
||||
maybe_public_bucket_extension: Some(&ext_suffix),
|
||||
|
||||
+10
-1
@@ -62,6 +62,13 @@ pub struct EnqueueStudioGen2Request {
|
||||
|
||||
/// Optional visibility setting override.
|
||||
pub creator_set_visibility: Option<Visibility>,
|
||||
|
||||
/// Sleep for debugging
|
||||
pub debug_sleep_millis: Option<u64>,
|
||||
|
||||
// TODO
|
||||
pub output_width: Option<u64>,
|
||||
pub output_height: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, ToSchema)]
|
||||
@@ -245,7 +252,9 @@ pub async fn enqueue_studio_gen2_handler(
|
||||
video_file: Some(request.video_file.clone()),
|
||||
creator_visibility: Some(set_visibility),
|
||||
watermark_type,
|
||||
after_job_debug_sleep_millis: None,
|
||||
after_job_debug_sleep_millis: request.debug_sleep_millis,
|
||||
output_width: request.output_width,
|
||||
output_height: request.output_height,
|
||||
};
|
||||
|
||||
info!("Creating ComfyUI job record...");
|
||||
|
||||
Reference in new issue
Block a user