From 0c9f45786620f2c8b7a85b8a074d68eaa4ad28b4 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Tue, 27 Dec 2022 14:30:54 -0800 Subject: [PATCH] Rename some Imaginate parameters --- .../document/document_message_handler.rs | 2 +- .../document_node_types.rs | 8 +++---- .../node_properties.rs | 24 +++++++++---------- .../portfolio/portfolio_message_handler.rs | 8 +++---- .../assets/icon-16px-solid/node-imaginate.svg | 4 ---- .../components/widgets/inputs/FieldInput.vue | 2 +- node-graph/graph-craft/src/imaginate_input.rs | 2 +- 7 files changed, 23 insertions(+), 27 deletions(-) diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index d197044a..8c90ff27 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -919,7 +919,7 @@ impl DocumentMessageHandler { } }; - // Prepare the node graph base image base image + // Prepare the node graph input image // Calculate the size of the region to be exported diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs index 51c4b8c8..95f75eda 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs @@ -259,15 +259,15 @@ pub const IMAGINATE_NODE: DocumentNodeType = DocumentNodeType { category: "Image Synthesis", identifier: NodeIdentifier::new("graphene_std::raster::ImaginateNode", &[concrete!("&TypeErasedNode")]), inputs: &[ - DocumentInputType::new("Base Image", TaggedValue::Image(Image::empty()), true), + DocumentInputType::new("Input Image", TaggedValue::Image(Image::empty()), true), DocumentInputType::new("Seed", TaggedValue::F64(0.), false), DocumentInputType::new("Resolution", TaggedValue::OptionalDVec2(None), false), DocumentInputType::new("Samples", TaggedValue::F64(30.), false), DocumentInputType::new("Sampling Method", TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false), - DocumentInputType::new("Text Guidance", TaggedValue::F64(10.), false), - DocumentInputType::new("Text Prompt", TaggedValue::String(String::new()), false), + DocumentInputType::new("Prompt Guidance", TaggedValue::F64(10.), false), + DocumentInputType::new("Prompt", TaggedValue::String(String::new()), false), DocumentInputType::new("Negative Prompt", TaggedValue::String(String::new()), false), - DocumentInputType::new("Use Base Image", TaggedValue::Bool(false), false), + DocumentInputType::new("Adapt Input Image", TaggedValue::Bool(false), false), DocumentInputType::new("Image Creativity", TaggedValue::F64(66.), false), DocumentInputType::new("Masking Layer", TaggedValue::LayerPath(None), false), DocumentInputType::new("Inpaint", TaggedValue::Bool(true), false), diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs index 99bdc75b..df3a439f 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs @@ -308,10 +308,10 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte let resolution_index = resolve_input("Resolution"); let samples_index = resolve_input("Samples"); let sampling_method_index = resolve_input("Sampling Method"); - let text_guidance_index = resolve_input("Text Guidance"); - let text_index = resolve_input("Text Prompt"); + let text_guidance_index = resolve_input("Prompt Guidance"); + let text_index = resolve_input("Prompt"); let neg_index = resolve_input("Negative Prompt"); - let base_img_index = resolve_input("Use Base Image"); + let base_img_index = resolve_input("Adapt Input Image"); let img_creativity_index = resolve_input("Image Creativity"); let mask_index = resolve_input("Masking Layer"); let inpaint_index = resolve_input("Inpaint"); @@ -390,7 +390,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte None => "Ready".into(), }, ImaginateStatus::Beginning => "Beginning...".into(), - ImaginateStatus::Uploading(percent) => format!("Uploading Base Image: {percent:.0}%"), + ImaginateStatus::Uploading(percent) => format!("Uploading Input Image: {percent:.0}%"), ImaginateStatus::Generating => format!("Generating: {percent_complete:.0}%"), ImaginateStatus::Terminating => "Terminating...".into(), ImaginateStatus::Terminated => format!("{percent_complete:.0}% (Terminated)"), @@ -653,7 +653,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte }; let text_guidance = { - let widgets = number_widget(document_node, node_id, text_guidance_index, "Text Guidance", NumberInput::new().min(0.).max(30.), true); + let widgets = number_widget(document_node, node_id, text_guidance_index, "Prompt Guidance", NumberInput::new().min(0.).max(30.), true); LayoutGroup::Row { widgets }.with_tooltip( "Amplification of the text prompt's influence over the outcome. At 0, the prompt is entirely ignored.\n\ \n\ @@ -664,7 +664,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte }; let text_prompt = { - let widgets = text_area_widget(document_node, node_id, text_index, "Text Prompt", true); + let widgets = text_area_widget(document_node, node_id, text_index, "Prompt", true); LayoutGroup::Row { widgets }.with_tooltip( "Description of the desired image subject and style.\n\ \n\ @@ -679,14 +679,14 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte LayoutGroup::Row { widgets }.with_tooltip("A negative text prompt can be used to list things like objects or colors to avoid") }; let base_image = { - let widgets = bool_widget(document_node, node_id, base_img_index, "Use Base Image", true); - LayoutGroup::Row { widgets }.with_tooltip("Generate an image based upon some raster data") + let widgets = bool_widget(document_node, node_id, base_img_index, "Adapt Input Image", true); + LayoutGroup::Row { widgets }.with_tooltip("Generate an image based upon the bitmap data plugged into this node") }; let image_creativity = { let props = NumberInput::new().percentage().disabled(!use_base_image); let widgets = number_widget(document_node, node_id, img_creativity_index, "Image Creativity", props, true); LayoutGroup::Row { widgets }.with_tooltip( - "Strength of the artistic liberties allowing changes from the base image. The image is unchanged at 0% and completely different at 100%.\n\ + "Strength of the artistic liberties allowing changes from the input image. The image is unchanged at 0% and completely different at 100%.\n\ \n\ This parameter is otherwise known as denoising strength.", ) @@ -724,7 +724,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte ]); } LayoutGroup::Row { widgets }.with_tooltip( - "Reference to a layer or folder which masks parts of the base image. Image generation is constrained to masked areas.\n\ + "Reference to a layer or folder which masks parts of the input image. Image generation is constrained to masked areas.\n\ \n\ Black shapes represent the masked regions. Lighter shades of gray act as a partial mask, and colors become grayscale.", ) @@ -814,7 +814,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte ]); } LayoutGroup::Row { widgets }.with_tooltip( - "Begin in/outpainting the masked areas using this fill content as the starting base image.\n\ + "Begin in/outpainting the masked areas using this fill content as the starting input image.\n\ \n\ Each option can be visualized by generating with 'Sampling Steps' set to 0.", ) @@ -827,7 +827,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte LayoutGroup::Row { widgets }.with_tooltip( "Postprocess human (or human-like) faces to look subtly less distorted.\n\ \n\ - This filter can be used on its own by enabling 'Use Base Image' and setting 'Sampling Steps' to 0.", + This filter can be used on its own by enabling 'Adapt Input Image' and setting 'Sampling Steps' to 0.", ) }; let tiling = { diff --git a/editor/src/messages/portfolio/portfolio_message_handler.rs b/editor/src/messages/portfolio/portfolio_message_handler.rs index a4a3c525..1abfdc23 100644 --- a/editor/src/messages/portfolio/portfolio_message_handler.rs +++ b/editor/src/messages/portfolio/portfolio_message_handler.rs @@ -789,17 +789,17 @@ impl PortfolioMessageHandler { sampling_method: Self::compute_input::(&network, &imaginate_node, get("Sampling Method"), Cow::Borrowed(&image))? .api_value() .to_string(), - text_guidance: Self::compute_input(&network, &imaginate_node, get("Text Guidance"), Cow::Borrowed(&image))?, - text_prompt: Self::compute_input(&network, &imaginate_node, get("Text Prompt"), Cow::Borrowed(&image))?, + text_guidance: Self::compute_input(&network, &imaginate_node, get("Prompt Guidance"), Cow::Borrowed(&image))?, + text_prompt: Self::compute_input(&network, &imaginate_node, get("Prompt"), Cow::Borrowed(&image))?, negative_prompt: Self::compute_input(&network, &imaginate_node, get("Negative Prompt"), Cow::Borrowed(&image))?, image_creativity: Some(Self::compute_input::(&network, &imaginate_node, get("Image Creativity"), Cow::Borrowed(&image))? / 100.), restore_faces: Self::compute_input(&network, &imaginate_node, get("Improve Faces"), Cow::Borrowed(&image))?, tiling: Self::compute_input(&network, &imaginate_node, get("Tiling"), Cow::Borrowed(&image))?, }; - let use_base_image = Self::compute_input::(&network, &imaginate_node, get("Use Base Image"), Cow::Borrowed(&image))?; + let use_base_image = Self::compute_input::(&network, &imaginate_node, get("Adapt Input Image"), Cow::Borrowed(&image))?; let base_image = if use_base_image { - let image: Image = Self::compute_input(&network, &imaginate_node, get("Base Image"), Cow::Borrowed(&image))?; + let image: Image = Self::compute_input(&network, &imaginate_node, get("Input Image"), Cow::Borrowed(&image))?; // Only use if has size if image.width > 0 && image.height > 0 { let (image_data, size) = Self::encode_img(image, Some(resolution), image::ImageOutputFormat::Png)?; diff --git a/frontend/assets/icon-16px-solid/node-imaginate.svg b/frontend/assets/icon-16px-solid/node-imaginate.svg index 95451b44..e4db791a 100644 --- a/frontend/assets/icon-16px-solid/node-imaginate.svg +++ b/frontend/assets/icon-16px-solid/node-imaginate.svg @@ -1,7 +1,3 @@ - - - - diff --git a/frontend/src/components/widgets/inputs/FieldInput.vue b/frontend/src/components/widgets/inputs/FieldInput.vue index cffc7f55..bba12093 100644 --- a/frontend/src/components/widgets/inputs/FieldInput.vue +++ b/frontend/src/components/widgets/inputs/FieldInput.vue @@ -113,7 +113,7 @@ } textarea { - min-height: calc(18px * 2); + min-height: calc(18px * 3); margin: 3px; padding: 0 5px; box-sizing: border-box; diff --git a/node-graph/graph-craft/src/imaginate_input.rs b/node-graph/graph-craft/src/imaginate_input.rs index 31d7226f..eca5ce75 100644 --- a/node-graph/graph-craft/src/imaginate_input.rs +++ b/node-graph/graph-craft/src/imaginate_input.rs @@ -63,7 +63,7 @@ impl std::fmt::Display for ImaginateMaskStartingFill { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { ImaginateMaskStartingFill::Fill => write!(f, "Smeared Surroundings"), - ImaginateMaskStartingFill::Original => write!(f, "Original Base Image"), + ImaginateMaskStartingFill::Original => write!(f, "Original Input Image"), ImaginateMaskStartingFill::LatentNoise => write!(f, "Randomness (Latent Noise)"), ImaginateMaskStartingFill::LatentNothing => write!(f, "Neutral (Latent Nothing)"), }