Rename some Imaginate parameters

This commit is contained in:
Keavon Chambers 2022-12-27 14:30:54 -08:00
parent 559c05f2a9
commit 0c9f457866
7 changed files with 23 additions and 27 deletions

View File

@ -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 // Calculate the size of the region to be exported

View File

@ -259,15 +259,15 @@ pub const IMAGINATE_NODE: DocumentNodeType = DocumentNodeType {
category: "Image Synthesis", category: "Image Synthesis",
identifier: NodeIdentifier::new("graphene_std::raster::ImaginateNode", &[concrete!("&TypeErasedNode")]), identifier: NodeIdentifier::new("graphene_std::raster::ImaginateNode", &[concrete!("&TypeErasedNode")]),
inputs: &[ 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("Seed", TaggedValue::F64(0.), false),
DocumentInputType::new("Resolution", TaggedValue::OptionalDVec2(None), false), DocumentInputType::new("Resolution", TaggedValue::OptionalDVec2(None), false),
DocumentInputType::new("Samples", TaggedValue::F64(30.), false), DocumentInputType::new("Samples", TaggedValue::F64(30.), false),
DocumentInputType::new("Sampling Method", TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false), DocumentInputType::new("Sampling Method", TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false),
DocumentInputType::new("Text Guidance", TaggedValue::F64(10.), false), DocumentInputType::new("Prompt Guidance", TaggedValue::F64(10.), false),
DocumentInputType::new("Text Prompt", TaggedValue::String(String::new()), false), DocumentInputType::new("Prompt", TaggedValue::String(String::new()), false),
DocumentInputType::new("Negative 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("Image Creativity", TaggedValue::F64(66.), false),
DocumentInputType::new("Masking Layer", TaggedValue::LayerPath(None), false), DocumentInputType::new("Masking Layer", TaggedValue::LayerPath(None), false),
DocumentInputType::new("Inpaint", TaggedValue::Bool(true), false), DocumentInputType::new("Inpaint", TaggedValue::Bool(true), false),

View File

@ -308,10 +308,10 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte
let resolution_index = resolve_input("Resolution"); let resolution_index = resolve_input("Resolution");
let samples_index = resolve_input("Samples"); let samples_index = resolve_input("Samples");
let sampling_method_index = resolve_input("Sampling Method"); let sampling_method_index = resolve_input("Sampling Method");
let text_guidance_index = resolve_input("Text Guidance"); let text_guidance_index = resolve_input("Prompt Guidance");
let text_index = resolve_input("Text Prompt"); let text_index = resolve_input("Prompt");
let neg_index = resolve_input("Negative 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 img_creativity_index = resolve_input("Image Creativity");
let mask_index = resolve_input("Masking Layer"); let mask_index = resolve_input("Masking Layer");
let inpaint_index = resolve_input("Inpaint"); let inpaint_index = resolve_input("Inpaint");
@ -390,7 +390,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte
None => "Ready".into(), None => "Ready".into(),
}, },
ImaginateStatus::Beginning => "Beginning...".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::Generating => format!("Generating: {percent_complete:.0}%"),
ImaginateStatus::Terminating => "Terminating...".into(), ImaginateStatus::Terminating => "Terminating...".into(),
ImaginateStatus::Terminated => format!("{percent_complete:.0}% (Terminated)"), 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 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( LayoutGroup::Row { widgets }.with_tooltip(
"Amplification of the text prompt's influence over the outcome. At 0, the prompt is entirely ignored.\n\ "Amplification of the text prompt's influence over the outcome. At 0, the prompt is entirely ignored.\n\
\n\ \n\
@ -664,7 +664,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte
}; };
let text_prompt = { 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( LayoutGroup::Row { widgets }.with_tooltip(
"Description of the desired image subject and style.\n\ "Description of the desired image subject and style.\n\
\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") 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 base_image = {
let widgets = bool_widget(document_node, node_id, base_img_index, "Use Base Image", true); 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 some raster data") LayoutGroup::Row { widgets }.with_tooltip("Generate an image based upon the bitmap data plugged into this node")
}; };
let image_creativity = { let image_creativity = {
let props = NumberInput::new().percentage().disabled(!use_base_image); let props = NumberInput::new().percentage().disabled(!use_base_image);
let widgets = number_widget(document_node, node_id, img_creativity_index, "Image Creativity", props, true); let widgets = number_widget(document_node, node_id, img_creativity_index, "Image Creativity", props, true);
LayoutGroup::Row { widgets }.with_tooltip( 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\ \n\
This parameter is otherwise known as denoising strength.", 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( 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\ \n\
Black shapes represent the masked regions. Lighter shades of gray act as a partial mask, and colors become grayscale.", 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( 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\ \n\
Each option can be visualized by generating with 'Sampling Steps' set to 0.", 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( LayoutGroup::Row { widgets }.with_tooltip(
"Postprocess human (or human-like) faces to look subtly less distorted.\n\ "Postprocess human (or human-like) faces to look subtly less distorted.\n\
\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 = { let tiling = {

View File

@ -789,17 +789,17 @@ impl PortfolioMessageHandler {
sampling_method: Self::compute_input::<ImaginateSamplingMethod>(&network, &imaginate_node, get("Sampling Method"), Cow::Borrowed(&image))? sampling_method: Self::compute_input::<ImaginateSamplingMethod>(&network, &imaginate_node, get("Sampling Method"), Cow::Borrowed(&image))?
.api_value() .api_value()
.to_string(), .to_string(),
text_guidance: Self::compute_input(&network, &imaginate_node, get("Text Guidance"), 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("Text Prompt"), 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))?, negative_prompt: Self::compute_input(&network, &imaginate_node, get("Negative Prompt"), Cow::Borrowed(&image))?,
image_creativity: Some(Self::compute_input::<f64>(&network, &imaginate_node, get("Image Creativity"), Cow::Borrowed(&image))? / 100.), image_creativity: Some(Self::compute_input::<f64>(&network, &imaginate_node, get("Image Creativity"), Cow::Borrowed(&image))? / 100.),
restore_faces: Self::compute_input(&network, &imaginate_node, get("Improve Faces"), Cow::Borrowed(&image))?, 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))?, tiling: Self::compute_input(&network, &imaginate_node, get("Tiling"), Cow::Borrowed(&image))?,
}; };
let use_base_image = Self::compute_input::<bool>(&network, &imaginate_node, get("Use Base Image"), Cow::Borrowed(&image))?; let use_base_image = Self::compute_input::<bool>(&network, &imaginate_node, get("Adapt Input Image"), Cow::Borrowed(&image))?;
let base_image = if use_base_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 // Only use if has size
if image.width > 0 && image.height > 0 { if image.width > 0 && image.height > 0 {
let (image_data, size) = Self::encode_img(image, Some(resolution), image::ImageOutputFormat::Png)?; let (image_data, size) = Self::encode_img(image, Some(resolution), image::ImageOutputFormat::Png)?;

View File

@ -1,7 +1,3 @@
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path d="M9.6,13.6C9.5,14.5,8.7,15,8,15c-0.5,0-1-0.2-1.3-0.6L9.6,13.6z M6.3,12.5c0,0.3,0,0.6,0.1,1c0,0,0,0,0,0.1l3.3-0.8c0-0.5,0.1-0.8,0.1-1.1L6.3,12.5z M8,2c2.3,0,4.1,1.9,4.1,4.2c0,2.5-1.5,3.1-2.1,4.5c0,0,0,0.1,0,0.1l-3.8,0.9c-0.1-0.4-0.2-0.7-0.3-1C5.4,9.3,3.9,8.7,3.9,6.2c0,0,0,0,0,0C3.9,3.9,5.7,2,8,2C8,2,8,2,8,2z M8.2,8.9C8,8.7,7.3,9.2,7.1,9.5c-0.2,0.3-0.2,0.7,0.1,1c0.5,0.1,0.9,0,1.2-0.4C8.6,9.7,8.6,9.2,8.2,8.9z M8.2,8c0.3-0.7,1.2-4.7,1.2-4.7C8.2,2.7,7.1,4.2,7.1,4.2C7,5.5,7.1,6.8,7.2,8.1C7.6,8.2,7.9,8.1,8.2,8L8.2,8z" /> <path d="M9.6,13.6C9.5,14.5,8.7,15,8,15c-0.5,0-1-0.2-1.3-0.6L9.6,13.6z M6.3,12.5c0,0.3,0,0.6,0.1,1c0,0,0,0,0,0.1l3.3-0.8c0-0.5,0.1-0.8,0.1-1.1L6.3,12.5z M8,2c2.3,0,4.1,1.9,4.1,4.2c0,2.5-1.5,3.1-2.1,4.5c0,0,0,0.1,0,0.1l-3.8,0.9c-0.1-0.4-0.2-0.7-0.3-1C5.4,9.3,3.9,8.7,3.9,6.2c0,0,0,0,0,0C3.9,3.9,5.7,2,8,2C8,2,8,2,8,2z M8.2,8.9C8,8.7,7.3,9.2,7.1,9.5c-0.2,0.3-0.2,0.7,0.1,1c0.5,0.1,0.9,0,1.2-0.4C8.6,9.7,8.6,9.2,8.2,8.9z M8.2,8c0.3-0.7,1.2-4.7,1.2-4.7C8.2,2.7,7.1,4.2,7.1,4.2C7,5.5,7.1,6.8,7.2,8.1C7.6,8.2,7.9,8.1,8.2,8L8.2,8z" />
<polygon points="3,1 1,1 0,1 0,2 0,4 1,4 1,2 3,2" />
<polygon points="15,1 13,1 13,2 15,2 15,4 16,4 16,2 16,1" />
<polygon points="1,14 1,12 0,12 0,14 0,15 1,15 3,15 3,14" />
<polygon points="15,12 15,14 13,14 13,15 15,15 16,15 16,14 16,12" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 845 B

After

Width:  |  Height:  |  Size: 597 B

View File

@ -113,7 +113,7 @@
} }
textarea { textarea {
min-height: calc(18px * 2); min-height: calc(18px * 3);
margin: 3px; margin: 3px;
padding: 0 5px; padding: 0 5px;
box-sizing: border-box; box-sizing: border-box;

View File

@ -63,7 +63,7 @@ impl std::fmt::Display for ImaginateMaskStartingFill {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
ImaginateMaskStartingFill::Fill => write!(f, "Smeared Surroundings"), 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::LatentNoise => write!(f, "Randomness (Latent Noise)"),
ImaginateMaskStartingFill::LatentNothing => write!(f, "Neutral (Latent Nothing)"), ImaginateMaskStartingFill::LatentNothing => write!(f, "Neutral (Latent Nothing)"),
} }