mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
Imaginate node fixes (#1084)
This commit is contained in:
committed by
Keavon Chambers
parent
fe233504ca
commit
9c10d18308
@@ -149,8 +149,14 @@ impl NodeGraphExecutor {
|
||||
};
|
||||
let use_base_image = self.compute_input::<bool>(&network, &imaginate_node, get("Adapt Input Image"), Cow::Borrowed(&image_frame))?;
|
||||
|
||||
let base_image = if use_base_image {
|
||||
let image: Image = self.compute_input(&network, &imaginate_node, get("Input Image"), Cow::Borrowed(&image_frame))?;
|
||||
let input_image_frame: Option<ImageFrame> = if use_base_image {
|
||||
Some(self.compute_input::<ImageFrame>(&network, &imaginate_node, get("Input Image"), Cow::Borrowed(&image_frame))?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let image_transform = input_image_frame.as_ref().map(|image_frame| image_frame.transform);
|
||||
let base_image = if let Some(ImageFrame { image, .. }) = input_image_frame {
|
||||
// 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)?;
|
||||
@@ -164,7 +170,7 @@ impl NodeGraphExecutor {
|
||||
None
|
||||
};
|
||||
|
||||
let mask_image = if base_image.is_some() {
|
||||
let mask_image = if let Some(transform) = image_transform {
|
||||
let mask_path: Option<Vec<LayerId>> = self.compute_input(&network, &imaginate_node, get("Masking Layer"), Cow::Borrowed(&image_frame))?;
|
||||
|
||||
// Calculate the size of the node graph frame
|
||||
|
||||
Reference in New Issue
Block a user