Comment out all remaining active Imaginate code
This commit is contained in:
parent
a11f9b36c3
commit
e759e62291
|
|
@ -56,52 +56,52 @@ pub fn commit_info_localized(localized_commit_date: &str) -> String {
|
|||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::messages::input_mapper::utility_types::input_mouse::ViewportBounds;
|
||||
use crate::messages::prelude::*;
|
||||
// #[cfg(test)]
|
||||
// mod test {
|
||||
// use crate::messages::input_mapper::utility_types::input_mouse::ViewportBounds;
|
||||
// use crate::messages::prelude::*;
|
||||
|
||||
// TODO: Fix and reenable
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn debug_ub() {
|
||||
use super::Message;
|
||||
// // TODO: Fix and reenable
|
||||
// #[ignore]
|
||||
// #[test]
|
||||
// fn debug_ub() {
|
||||
// use super::Message;
|
||||
|
||||
let mut editor = super::Editor::new();
|
||||
let mut responses = Vec::new();
|
||||
// let mut editor = super::Editor::new();
|
||||
// let mut responses = Vec::new();
|
||||
|
||||
let messages: Vec<Message> = vec![
|
||||
Message::Init,
|
||||
Message::Preferences(PreferencesMessage::Load {
|
||||
preferences: r#"{ "imaginate_server_hostname": "http://localhost:7860/", "imaginate_refresh_frequency": 1, "zoom_with_scroll": false }"#.to_string(),
|
||||
}),
|
||||
PortfolioMessage::OpenDocumentFileWithId {
|
||||
document_id: DocumentId(0),
|
||||
document_name: "".into(),
|
||||
document_is_auto_saved: true,
|
||||
document_is_saved: true,
|
||||
document_serialized_content: r#" [removed until test is reenabled] "#.into(),
|
||||
to_front: false,
|
||||
}
|
||||
.into(),
|
||||
InputPreprocessorMessage::BoundsOfViewports {
|
||||
bounds_of_viewports: vec![ViewportBounds::from_slice(&[0., 0., 1920., 1080.])],
|
||||
}
|
||||
.into(),
|
||||
];
|
||||
// let messages: Vec<Message> = vec![
|
||||
// Message::Init,
|
||||
// Message::Preferences(PreferencesMessage::Load {
|
||||
// preferences: r#"{ "imaginate_server_hostname": "http://localhost:7860/", "imaginate_refresh_frequency": 1, "zoom_with_scroll": false }"#.to_string(),
|
||||
// }),
|
||||
// PortfolioMessage::OpenDocumentFileWithId {
|
||||
// document_id: DocumentId(0),
|
||||
// document_name: "".into(),
|
||||
// document_is_auto_saved: true,
|
||||
// document_is_saved: true,
|
||||
// document_serialized_content: r#" [removed until test is reenabled] "#.into(),
|
||||
// to_front: false,
|
||||
// }
|
||||
// .into(),
|
||||
// InputPreprocessorMessage::BoundsOfViewports {
|
||||
// bounds_of_viewports: vec![ViewportBounds::from_slice(&[0., 0., 1920., 1080.])],
|
||||
// }
|
||||
// .into(),
|
||||
// ];
|
||||
|
||||
use futures::executor::block_on;
|
||||
for message in messages {
|
||||
block_on(crate::node_graph_executor::run_node_graph());
|
||||
let mut res = VecDeque::new();
|
||||
editor.poll_node_graph_evaluation(&mut res).expect("poll_node_graph_evaluation failed");
|
||||
// use futures::executor::block_on;
|
||||
// for message in messages {
|
||||
// block_on(crate::node_graph_executor::run_node_graph());
|
||||
// let mut res = VecDeque::new();
|
||||
// editor.poll_node_graph_evaluation(&mut res).expect("poll_node_graph_evaluation failed");
|
||||
|
||||
let res = editor.handle_message(message);
|
||||
responses.push(res);
|
||||
}
|
||||
let responses = responses.pop().unwrap();
|
||||
// let trigger_message = responses[responses.len() - 2].clone();
|
||||
// let res = editor.handle_message(message);
|
||||
// responses.push(res);
|
||||
// }
|
||||
// let responses = responses.pop().unwrap();
|
||||
// // let trigger_message = responses[responses.len() - 2].clone();
|
||||
|
||||
println!("responses: {responses:#?}");
|
||||
}
|
||||
}
|
||||
// println!("responses: {responses:#?}");
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -179,11 +179,11 @@ pub fn input_mappings() -> Mapping {
|
|||
entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=RectangleToolMessage::PointerMove { center: Alt, lock_ratio: Shift }),
|
||||
//
|
||||
// ImaginateToolMessage
|
||||
entry!(KeyDown(MouseLeft); action_dispatch=ImaginateToolMessage::DragStart),
|
||||
entry!(KeyUp(MouseLeft); action_dispatch=ImaginateToolMessage::DragStop),
|
||||
entry!(KeyDown(MouseRight); action_dispatch=ImaginateToolMessage::Abort),
|
||||
entry!(KeyDown(Escape); action_dispatch=ImaginateToolMessage::Abort),
|
||||
entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=ImaginateToolMessage::Resize { center: Alt, lock_ratio: Shift }),
|
||||
// entry!(KeyDown(MouseLeft); action_dispatch=ImaginateToolMessage::DragStart),
|
||||
// entry!(KeyUp(MouseLeft); action_dispatch=ImaginateToolMessage::DragStop),
|
||||
// entry!(KeyDown(MouseRight); action_dispatch=ImaginateToolMessage::Abort),
|
||||
// entry!(KeyDown(Escape); action_dispatch=ImaginateToolMessage::Abort),
|
||||
// entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=ImaginateToolMessage::Resize { center: Alt, lock_ratio: Shift }),
|
||||
//
|
||||
// EllipseToolMessage
|
||||
entry!(KeyDown(MouseLeft); action_dispatch=EllipseToolMessage::DragStart),
|
||||
|
|
|
|||
|
|
@ -71,13 +71,13 @@ pub enum DocumentMessage {
|
|||
GroupSelectedLayers {
|
||||
group_folder_type: GroupFolderType,
|
||||
},
|
||||
ImaginateGenerate {
|
||||
imaginate_node: Vec<NodeId>,
|
||||
},
|
||||
ImaginateRandom {
|
||||
imaginate_node: Vec<NodeId>,
|
||||
then_generate: bool,
|
||||
},
|
||||
// ImaginateGenerate {
|
||||
// imaginate_node: Vec<NodeId>,
|
||||
// },
|
||||
// ImaginateRandom {
|
||||
// imaginate_node: Vec<NodeId>,
|
||||
// then_generate: bool,
|
||||
// },
|
||||
MoveSelectedLayersTo {
|
||||
parent: LayerNodeIdentifier,
|
||||
insert_index: usize,
|
||||
|
|
|
|||
|
|
@ -579,37 +579,37 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
|
|||
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: new_folders });
|
||||
}
|
||||
}
|
||||
DocumentMessage::ImaginateGenerate { imaginate_node } => {
|
||||
let random_value = generate_uuid();
|
||||
responses.add(NodeGraphMessage::SetInputValue {
|
||||
node_id: *imaginate_node.last().unwrap(),
|
||||
// Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||
input_index: 17,
|
||||
value: graph_craft::document::value::TaggedValue::U64(random_value),
|
||||
});
|
||||
// DocumentMessage::ImaginateGenerate { imaginate_node } => {
|
||||
// let random_value = generate_uuid();
|
||||
// responses.add(NodeGraphMessage::SetInputValue {
|
||||
// node_id: *imaginate_node.last().unwrap(),
|
||||
// // Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||
// input_index: 17,
|
||||
// value: graph_craft::document::value::TaggedValue::U64(random_value),
|
||||
// });
|
||||
|
||||
responses.add(PortfolioMessage::SubmitGraphRender { document_id, ignore_hash: false });
|
||||
}
|
||||
DocumentMessage::ImaginateRandom { imaginate_node, then_generate } => {
|
||||
// Generate a random seed. We only want values between -2^53 and 2^53, because integer values
|
||||
// outside of this range can get rounded in f64
|
||||
let random_bits = generate_uuid();
|
||||
let random_value = ((random_bits >> 11) as f64).copysign(f64::from_bits(random_bits & (1 << 63)));
|
||||
// responses.add(PortfolioMessage::SubmitGraphRender { document_id, ignore_hash: false });
|
||||
// }
|
||||
// DocumentMessage::ImaginateRandom { imaginate_node, then_generate } => {
|
||||
// // Generate a random seed. We only want values between -2^53 and 2^53, because integer values
|
||||
// // outside of this range can get rounded in f64
|
||||
// let random_bits = generate_uuid();
|
||||
// let random_value = ((random_bits >> 11) as f64).copysign(f64::from_bits(random_bits & (1 << 63)));
|
||||
|
||||
responses.add(DocumentMessage::AddTransaction);
|
||||
// Set a random seed input
|
||||
responses.add(NodeGraphMessage::SetInputValue {
|
||||
node_id: *imaginate_node.last().unwrap(),
|
||||
// Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||
input_index: 3,
|
||||
value: graph_craft::document::value::TaggedValue::F64(random_value),
|
||||
});
|
||||
// responses.add(DocumentMessage::AddTransaction);
|
||||
// // Set a random seed input
|
||||
// responses.add(NodeGraphMessage::SetInputValue {
|
||||
// node_id: *imaginate_node.last().unwrap(),
|
||||
// // Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||
// input_index: 3,
|
||||
// value: graph_craft::document::value::TaggedValue::F64(random_value),
|
||||
// });
|
||||
|
||||
// Generate the image
|
||||
if then_generate {
|
||||
responses.add(DocumentMessage::ImaginateGenerate { imaginate_node });
|
||||
}
|
||||
}
|
||||
// // Generate the image
|
||||
// if then_generate {
|
||||
// responses.add(DocumentMessage::ImaginateGenerate { imaginate_node });
|
||||
// }
|
||||
// }
|
||||
DocumentMessage::MoveSelectedLayersTo { parent, insert_index } => {
|
||||
if !self.selection_network_path.is_empty() {
|
||||
log::error!("Moving selected layers is only supported for the Document Network");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ use graph_craft::ProtoNodeIdentifier;
|
|||
use graph_craft::concrete;
|
||||
use graph_craft::document::value::*;
|
||||
use graph_craft::document::*;
|
||||
use graph_craft::imaginate_input::ImaginateSamplingMethod;
|
||||
use graphene_core::raster::brush_cache::BrushCache;
|
||||
use graphene_core::raster::image::ImageFrameTable;
|
||||
use graphene_core::raster::{Color, RedGreenBlue, RedGreenBlueAlpha};
|
||||
|
|
@ -21,8 +20,6 @@ use graphene_core::text::{Font, TypesettingConfig};
|
|||
use graphene_core::transform::Footprint;
|
||||
use graphene_core::vector::VectorDataTable;
|
||||
use graphene_core::*;
|
||||
use graphene_std::wasm_application_io::WasmEditorApi;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::collections::{HashMap, HashSet, VecDeque};
|
||||
#[cfg(feature = "gpu")]
|
||||
use wgpu_executor::{Bindgroup, CommandBuffer, PipelineLayout, ShaderHandle, ShaderInputFrame, WgpuShaderInput};
|
||||
|
|
@ -2713,127 +2710,127 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
|||
custom
|
||||
}
|
||||
|
||||
pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentNodeDefinition {
|
||||
identifier: "Imaginate",
|
||||
category: "Raster",
|
||||
node_template: NodeTemplate {
|
||||
document_node: DocumentNode {
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
exports: vec![NodeInput::node(NodeId(1), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
inputs: vec![NodeInput::network(concrete!(ImageFrameTable<Color>), 0)],
|
||||
implementation: DocumentNodeImplementation::proto("graphene_core::memo::MonitorNode"),
|
||||
manual_composition: Some(concrete!(Context)),
|
||||
skip_deduplication: true,
|
||||
..Default::default()
|
||||
},
|
||||
DocumentNode {
|
||||
inputs: vec![
|
||||
NodeInput::node(NodeId(0), 0),
|
||||
NodeInput::network(concrete!(&WasmEditorApi), 1),
|
||||
NodeInput::network(concrete!(ImaginateController), 2),
|
||||
NodeInput::network(concrete!(f64), 3),
|
||||
NodeInput::network(concrete!(Option<DVec2>), 4),
|
||||
NodeInput::network(concrete!(u32), 5),
|
||||
NodeInput::network(concrete!(ImaginateSamplingMethod), 6),
|
||||
NodeInput::network(concrete!(f64), 7),
|
||||
NodeInput::network(concrete!(String), 8),
|
||||
NodeInput::network(concrete!(String), 9),
|
||||
NodeInput::network(concrete!(bool), 10),
|
||||
NodeInput::network(concrete!(f64), 11),
|
||||
NodeInput::network(concrete!(bool), 12),
|
||||
NodeInput::network(concrete!(f64), 13),
|
||||
NodeInput::network(concrete!(ImaginateMaskStartingFill), 14),
|
||||
NodeInput::network(concrete!(bool), 15),
|
||||
NodeInput::network(concrete!(bool), 16),
|
||||
NodeInput::network(concrete!(u64), 17),
|
||||
],
|
||||
implementation: DocumentNodeImplementation::proto("graphene_std::raster::ImaginateNode"),
|
||||
..Default::default()
|
||||
},
|
||||
]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(id, node)| (NodeId(id as u64), node))
|
||||
.collect(),
|
||||
..Default::default()
|
||||
}),
|
||||
inputs: vec![
|
||||
NodeInput::value(TaggedValue::ImageFrame(ImageFrameTable::one_empty_image()), true),
|
||||
NodeInput::scope("editor-api"),
|
||||
NodeInput::value(TaggedValue::ImaginateController(Default::default()), false),
|
||||
NodeInput::value(TaggedValue::F64(0.), false), // Remember to keep index used in `ImaginateRandom` updated with this entry's index
|
||||
NodeInput::value(TaggedValue::OptionalDVec2(None), false),
|
||||
NodeInput::value(TaggedValue::U32(30), false),
|
||||
NodeInput::value(TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false),
|
||||
NodeInput::value(TaggedValue::F64(7.5), false),
|
||||
NodeInput::value(TaggedValue::String(String::new()), false),
|
||||
NodeInput::value(TaggedValue::String(String::new()), false),
|
||||
NodeInput::value(TaggedValue::Bool(false), false),
|
||||
NodeInput::value(TaggedValue::F64(66.), false),
|
||||
NodeInput::value(TaggedValue::Bool(true), false),
|
||||
NodeInput::value(TaggedValue::F64(4.), false),
|
||||
NodeInput::value(TaggedValue::ImaginateMaskStartingFill(ImaginateMaskStartingFill::Fill), false),
|
||||
NodeInput::value(TaggedValue::Bool(false), false),
|
||||
NodeInput::value(TaggedValue::Bool(false), false),
|
||||
NodeInput::value(TaggedValue::U64(0), false),
|
||||
],
|
||||
..Default::default()
|
||||
},
|
||||
persistent_node_metadata: DocumentNodePersistentMetadata {
|
||||
network_metadata: Some(NodeNetworkMetadata {
|
||||
persistent_metadata: NodeNetworkPersistentMetadata {
|
||||
node_metadata: [
|
||||
DocumentNodeMetadata {
|
||||
persistent_metadata: DocumentNodePersistentMetadata {
|
||||
display_name: "Monitor".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
DocumentNodeMetadata {
|
||||
persistent_metadata: DocumentNodePersistentMetadata {
|
||||
display_name: "Imaginate".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(id, node)| (NodeId(id as u64), node))
|
||||
.collect(),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
}),
|
||||
input_properties: vec![
|
||||
"Input Image".into(),
|
||||
"Editor Api".into(),
|
||||
"Controller".into(),
|
||||
"Seed".into(),
|
||||
"Resolution".into(),
|
||||
"Samples".into(),
|
||||
"Sampling Method".into(),
|
||||
"Prompt Guidance".into(),
|
||||
"Prompt".into(),
|
||||
"Negative Prompt".into(),
|
||||
"Adapt Input Image".into(),
|
||||
"Image Creativity".into(),
|
||||
"Inpaint".into(),
|
||||
"Mask Blur".into(),
|
||||
"Mask Starting Fill".into(),
|
||||
"Improve Faces".into(),
|
||||
"Tiling".into(),
|
||||
],
|
||||
output_names: vec!["Image".to_string()],
|
||||
..Default::default()
|
||||
},
|
||||
},
|
||||
description: Cow::Borrowed("TODO"),
|
||||
properties: None, // Some(&node_properties::imaginate_properties),
|
||||
});
|
||||
// pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentNodeDefinition {
|
||||
// identifier: "Imaginate",
|
||||
// category: "Raster",
|
||||
// node_template: NodeTemplate {
|
||||
// document_node: DocumentNode {
|
||||
// implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
// exports: vec![NodeInput::node(NodeId(1), 0)],
|
||||
// nodes: [
|
||||
// DocumentNode {
|
||||
// inputs: vec![NodeInput::network(concrete!(ImageFrameTable<Color>), 0)],
|
||||
// implementation: DocumentNodeImplementation::proto("graphene_core::memo::MonitorNode"),
|
||||
// manual_composition: Some(concrete!(Context)),
|
||||
// skip_deduplication: true,
|
||||
// ..Default::default()
|
||||
// },
|
||||
// DocumentNode {
|
||||
// inputs: vec![
|
||||
// NodeInput::node(NodeId(0), 0),
|
||||
// NodeInput::network(concrete!(&WasmEditorApi), 1),
|
||||
// NodeInput::network(concrete!(ImaginateController), 2),
|
||||
// NodeInput::network(concrete!(f64), 3),
|
||||
// NodeInput::network(concrete!(Option<DVec2>), 4),
|
||||
// NodeInput::network(concrete!(u32), 5),
|
||||
// NodeInput::network(concrete!(ImaginateSamplingMethod), 6),
|
||||
// NodeInput::network(concrete!(f64), 7),
|
||||
// NodeInput::network(concrete!(String), 8),
|
||||
// NodeInput::network(concrete!(String), 9),
|
||||
// NodeInput::network(concrete!(bool), 10),
|
||||
// NodeInput::network(concrete!(f64), 11),
|
||||
// NodeInput::network(concrete!(bool), 12),
|
||||
// NodeInput::network(concrete!(f64), 13),
|
||||
// NodeInput::network(concrete!(ImaginateMaskStartingFill), 14),
|
||||
// NodeInput::network(concrete!(bool), 15),
|
||||
// NodeInput::network(concrete!(bool), 16),
|
||||
// NodeInput::network(concrete!(u64), 17),
|
||||
// ],
|
||||
// implementation: DocumentNodeImplementation::proto("graphene_std::raster::ImaginateNode"),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// ]
|
||||
// .into_iter()
|
||||
// .enumerate()
|
||||
// .map(|(id, node)| (NodeId(id as u64), node))
|
||||
// .collect(),
|
||||
// ..Default::default()
|
||||
// }),
|
||||
// inputs: vec![
|
||||
// NodeInput::value(TaggedValue::ImageFrame(ImageFrameTable::one_empty_image()), true),
|
||||
// NodeInput::scope("editor-api"),
|
||||
// NodeInput::value(TaggedValue::ImaginateController(Default::default()), false),
|
||||
// NodeInput::value(TaggedValue::F64(0.), false), // Remember to keep index used in `ImaginateRandom` updated with this entry's index
|
||||
// NodeInput::value(TaggedValue::OptionalDVec2(None), false),
|
||||
// NodeInput::value(TaggedValue::U32(30), false),
|
||||
// NodeInput::value(TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false),
|
||||
// NodeInput::value(TaggedValue::F64(7.5), false),
|
||||
// NodeInput::value(TaggedValue::String(String::new()), false),
|
||||
// NodeInput::value(TaggedValue::String(String::new()), false),
|
||||
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||
// NodeInput::value(TaggedValue::F64(66.), false),
|
||||
// NodeInput::value(TaggedValue::Bool(true), false),
|
||||
// NodeInput::value(TaggedValue::F64(4.), false),
|
||||
// NodeInput::value(TaggedValue::ImaginateMaskStartingFill(ImaginateMaskStartingFill::Fill), false),
|
||||
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||
// NodeInput::value(TaggedValue::U64(0), false),
|
||||
// ],
|
||||
// ..Default::default()
|
||||
// },
|
||||
// persistent_node_metadata: DocumentNodePersistentMetadata {
|
||||
// network_metadata: Some(NodeNetworkMetadata {
|
||||
// persistent_metadata: NodeNetworkPersistentMetadata {
|
||||
// node_metadata: [
|
||||
// DocumentNodeMetadata {
|
||||
// persistent_metadata: DocumentNodePersistentMetadata {
|
||||
// display_name: "Monitor".to_string(),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// ..Default::default()
|
||||
// },
|
||||
// DocumentNodeMetadata {
|
||||
// persistent_metadata: DocumentNodePersistentMetadata {
|
||||
// display_name: "Imaginate".to_string(),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// ..Default::default()
|
||||
// },
|
||||
// ]
|
||||
// .into_iter()
|
||||
// .enumerate()
|
||||
// .map(|(id, node)| (NodeId(id as u64), node))
|
||||
// .collect(),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// ..Default::default()
|
||||
// }),
|
||||
// input_properties: vec![
|
||||
// "Input Image".into(),
|
||||
// "Editor Api".into(),
|
||||
// "Controller".into(),
|
||||
// "Seed".into(),
|
||||
// "Resolution".into(),
|
||||
// "Samples".into(),
|
||||
// "Sampling Method".into(),
|
||||
// "Prompt Guidance".into(),
|
||||
// "Prompt".into(),
|
||||
// "Negative Prompt".into(),
|
||||
// "Adapt Input Image".into(),
|
||||
// "Image Creativity".into(),
|
||||
// "Inpaint".into(),
|
||||
// "Mask Blur".into(),
|
||||
// "Mask Starting Fill".into(),
|
||||
// "Improve Faces".into(),
|
||||
// "Tiling".into(),
|
||||
// ],
|
||||
// output_names: vec!["Image".to_string()],
|
||||
// ..Default::default()
|
||||
// },
|
||||
// },
|
||||
// description: Cow::Borrowed("TODO"),
|
||||
// properties: None, // Some(&node_properties::imaginate_properties),
|
||||
// });
|
||||
|
||||
type NodeProperties = HashMap<String, Box<dyn Fn(NodeId, &mut NodePropertiesContext) -> Vec<LayoutGroup> + Send + Sync>>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1354,7 +1354,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
|||
responses.add(PropertiesPanelMessage::Refresh);
|
||||
if (network_interface
|
||||
.reference(&node_id, selection_network_path)
|
||||
.is_none_or(|reference| *reference != Some("Imaginate".to_string()))
|
||||
.is_none_or(|reference| *reference != Some("Imaginate".to_string())) // TODO: Potentially remove the reference to Imaginate
|
||||
|| input_index == 0)
|
||||
&& network_interface.connected_to_output(&node_id, selection_network_path)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use glam::{DAffine2, DVec2, IVec2, UVec2};
|
|||
use graph_craft::Type;
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput};
|
||||
use graph_craft::imaginate_input::{ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
||||
use graphene_core::raster::curve::Curve;
|
||||
use graphene_core::raster::image::ImageFrameTable;
|
||||
use graphene_core::raster::{
|
||||
|
|
@ -215,38 +214,38 @@ pub(crate) fn property_from_type(
|
|||
Some(x) if x == TypeId::of::<BooleanOperation>() => boolean_operation_radio_buttons(document_node, node_id, index, name, true),
|
||||
Some(x) if x == TypeId::of::<CentroidType>() => centroid_widget(document_node, node_id, index),
|
||||
Some(x) if x == TypeId::of::<LuminanceCalculation>() => luminance_calculation(document_node, node_id, index, name, true),
|
||||
Some(x) if x == TypeId::of::<ImaginateSamplingMethod>() => vec![
|
||||
DropdownInput::new(
|
||||
ImaginateSamplingMethod::list()
|
||||
.into_iter()
|
||||
.map(|method| {
|
||||
vec![MenuListEntry::new(format!("{:?}", method)).label(method.to_string()).on_update(update_value(
|
||||
move |_| TaggedValue::ImaginateSamplingMethod(method),
|
||||
node_id,
|
||||
index,
|
||||
))]
|
||||
})
|
||||
.collect(),
|
||||
)
|
||||
.widget_holder(),
|
||||
]
|
||||
.into(),
|
||||
Some(x) if x == TypeId::of::<ImaginateMaskStartingFill>() => vec![
|
||||
DropdownInput::new(
|
||||
ImaginateMaskStartingFill::list()
|
||||
.into_iter()
|
||||
.map(|fill| {
|
||||
vec![MenuListEntry::new(format!("{:?}", fill)).label(fill.to_string()).on_update(update_value(
|
||||
move |_| TaggedValue::ImaginateMaskStartingFill(fill),
|
||||
node_id,
|
||||
index,
|
||||
))]
|
||||
})
|
||||
.collect(),
|
||||
)
|
||||
.widget_holder(),
|
||||
]
|
||||
.into(),
|
||||
// Some(x) if x == TypeId::of::<ImaginateSamplingMethod>() => vec![
|
||||
// DropdownInput::new(
|
||||
// ImaginateSamplingMethod::list()
|
||||
// .into_iter()
|
||||
// .map(|method| {
|
||||
// vec![MenuListEntry::new(format!("{:?}", method)).label(method.to_string()).on_update(update_value(
|
||||
// move |_| TaggedValue::ImaginateSamplingMethod(method),
|
||||
// node_id,
|
||||
// index,
|
||||
// ))]
|
||||
// })
|
||||
// .collect(),
|
||||
// )
|
||||
// .widget_holder(),
|
||||
// ]
|
||||
// .into(),
|
||||
// Some(x) if x == TypeId::of::<ImaginateMaskStartingFill>() => vec![
|
||||
// DropdownInput::new(
|
||||
// ImaginateMaskStartingFill::list()
|
||||
// .into_iter()
|
||||
// .map(|fill| {
|
||||
// vec![MenuListEntry::new(format!("{:?}", fill)).label(fill.to_string()).on_update(update_value(
|
||||
// move |_| TaggedValue::ImaginateMaskStartingFill(fill),
|
||||
// node_id,
|
||||
// index,
|
||||
// ))]
|
||||
// })
|
||||
// .collect(),
|
||||
// )
|
||||
// .widget_holder(),
|
||||
// ]
|
||||
// .into(),
|
||||
_ => {
|
||||
let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::General, true);
|
||||
widgets.extend_from_slice(&[
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
use graphene_std::imaginate::ImaginatePersistentData;
|
||||
use graphene_std::text::FontCache;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct PersistentData {
|
||||
pub font_cache: FontCache,
|
||||
pub imaginate: ImaginatePersistentData,
|
||||
pub use_vello: bool,
|
||||
// pub imaginate: ImaginatePersistentData,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy, Default, Debug, serde::Serialize, serde::Deserialize)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use graph_craft::wasm_application_io::EditorPreferences;
|
|||
|
||||
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, specta::Type)]
|
||||
pub struct PreferencesMessageHandler {
|
||||
pub imaginate_server_hostname: String,
|
||||
pub imaginate_refresh_frequency: f64,
|
||||
// pub imaginate_server_hostname: String,
|
||||
// pub imaginate_refresh_frequency: f64,
|
||||
pub selection_mode: SelectionMode,
|
||||
pub zoom_with_scroll: bool,
|
||||
pub use_vello: bool,
|
||||
|
|
@ -24,7 +24,7 @@ impl PreferencesMessageHandler {
|
|||
|
||||
pub fn editor_preferences(&self) -> EditorPreferences {
|
||||
EditorPreferences {
|
||||
imaginate_hostname: self.imaginate_server_hostname.clone(),
|
||||
// imaginate_hostname: self.imaginate_server_hostname.clone(),
|
||||
use_vello: self.use_vello && self.supports_wgpu(),
|
||||
}
|
||||
}
|
||||
|
|
@ -36,17 +36,12 @@ impl PreferencesMessageHandler {
|
|||
|
||||
impl Default for PreferencesMessageHandler {
|
||||
fn default() -> Self {
|
||||
let EditorPreferences {
|
||||
imaginate_hostname: host_name,
|
||||
use_vello,
|
||||
} = Default::default();
|
||||
|
||||
Self {
|
||||
imaginate_server_hostname: host_name,
|
||||
imaginate_refresh_frequency: 1.,
|
||||
// imaginate_server_hostname: EditorPreferences::default().imaginate_hostname,
|
||||
// imaginate_refresh_frequency: 1.,
|
||||
selection_mode: SelectionMode::Touched,
|
||||
zoom_with_scroll: matches!(MappingVariant::default(), MappingVariant::ZoomWithScroll),
|
||||
use_vello,
|
||||
use_vello: EditorPreferences::default().use_vello,
|
||||
vector_meshes: false,
|
||||
graph_wire_style: GraphWireStyle::default(),
|
||||
viewport_zoom_wheel_rate: VIEWPORT_ZOOM_WHEEL_RATE,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ pub use crate::messages::tool::tool_messages::eyedropper_tool::{EyedropperToolMe
|
|||
pub use crate::messages::tool::tool_messages::fill_tool::{FillToolMessage, FillToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::freehand_tool::{FreehandToolMessage, FreehandToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::gradient_tool::{GradientToolMessage, GradientToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::imaginate_tool::{ImaginateToolMessage, ImaginateToolMessageDiscriminant};
|
||||
// pub use crate::messages::tool::tool_messages::imaginate_tool::{ImaginateToolMessage, ImaginateToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::line_tool::{LineToolMessage, LineToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::navigate_tool::{NavigateToolMessage, NavigateToolMessageDiscriminant};
|
||||
pub use crate::messages::tool::tool_messages::path_tool::{PathToolMessage, PathToolMessageDiscriminant};
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ pub enum ToolMessage {
|
|||
// Relight(RelightToolMessage),
|
||||
// // #[child]
|
||||
// Detail(DetailToolMessage),
|
||||
#[child]
|
||||
Imaginate(ImaginateToolMessage),
|
||||
// #[child]
|
||||
// Imaginate(ImaginateToolMessage),
|
||||
|
||||
// Messages
|
||||
ActivateToolSelect,
|
||||
|
|
@ -76,8 +76,8 @@ pub enum ToolMessage {
|
|||
ActivateToolPolygon,
|
||||
|
||||
ActivateToolBrush,
|
||||
ActivateToolImaginate,
|
||||
|
||||
// ActivateToolImaginate,
|
||||
//
|
||||
ActivateTool {
|
||||
tool_type: ToolType,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ impl MessageHandler<ToolMessage, ToolMessageData<'_>> for ToolMessageHandler {
|
|||
ToolMessage::ActivateToolPolygon => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Polygon }),
|
||||
|
||||
ToolMessage::ActivateToolBrush => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Brush }),
|
||||
ToolMessage::ActivateToolImaginate => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Imaginate }),
|
||||
|
||||
// ToolMessage::ActivateToolImaginate => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Imaginate }),
|
||||
ToolMessage::ActivateTool { tool_type } => {
|
||||
let tool_data = &mut self.tool_state.tool_data;
|
||||
let old_tool = tool_data.active_tool_type;
|
||||
|
|
@ -314,7 +313,7 @@ impl MessageHandler<ToolMessage, ToolMessageData<'_>> for ToolMessageHandler {
|
|||
ActivateToolPolygon,
|
||||
|
||||
ActivateToolBrush,
|
||||
ActivateToolImaginate,
|
||||
// ActivateToolImaginate,
|
||||
|
||||
SelectRandomPrimaryColor,
|
||||
ResetColors,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pub mod eyedropper_tool;
|
|||
pub mod fill_tool;
|
||||
pub mod freehand_tool;
|
||||
pub mod gradient_tool;
|
||||
pub mod imaginate_tool;
|
||||
// pub mod imaginate_tool;
|
||||
pub mod line_tool;
|
||||
pub mod navigate_tool;
|
||||
pub mod path_tool;
|
||||
|
|
|
|||
|
|
@ -381,7 +381,8 @@ fn list_tools_in_groups() -> Vec<Vec<ToolAvailability>> {
|
|||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Patch, "RasterPatchTool").tooltip("Coming Soon: Patch Tool")),
|
||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Detail, "RasterDetailTool").tooltip("Coming Soon: Detail Tool (D)")),
|
||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Relight, "RasterRelightTool").tooltip("Coming Soon: Relight Tool (O)")),
|
||||
// ToolAvailability::Available(Box::<imaginate_tool::ImaginateTool>::default()), // TODO: Fix and reenable
|
||||
// TODO: Fix and reenable Imaginate tool
|
||||
// ToolAvailability::Available(Box::<imaginate_tool::ImaginateTool>::default()),
|
||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Heal, "RasterImaginateTool").tooltip("Coming Soon: Imaginate Tool")),
|
||||
],
|
||||
]
|
||||
|
|
@ -415,7 +416,7 @@ pub fn tool_message_to_tool_type(tool_message: &ToolMessage) -> ToolType {
|
|||
// ToolMessage::Patch(_) => ToolType::Patch,
|
||||
// ToolMessage::Detail(_) => ToolType::Detail,
|
||||
// ToolMessage::Relight(_) => ToolType::Relight,
|
||||
ToolMessage::Imaginate(_) => ToolType::Imaginate,
|
||||
// ToolMessage::Imaginate(_) => ToolType::Imaginate,
|
||||
_ => panic!("Conversion from ToolMessage to ToolType impossible because the given ToolMessage does not have a matching ToolType. Got: {tool_message:?}"),
|
||||
}
|
||||
}
|
||||
|
|
@ -448,7 +449,7 @@ pub fn tool_type_to_activate_tool_message(tool_type: ToolType) -> ToolMessageDis
|
|||
// ToolType::Patch => ToolMessageDiscriminant::ActivateToolPatch,
|
||||
// ToolType::Detail => ToolMessageDiscriminant::ActivateToolDetail,
|
||||
// ToolType::Relight => ToolMessageDiscriminant::ActivateToolRelight,
|
||||
ToolType::Imaginate => ToolMessageDiscriminant::ActivateToolImaginate,
|
||||
// ToolType::Imaginate => ToolMessageDiscriminant::ActivateToolImaginate,
|
||||
_ => panic!("Conversion from ToolType to ToolMessage impossible because the given ToolType does not have a matching ToolMessage. Got: {tool_type:?}"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -731,6 +731,9 @@ impl NodeGraphExecutor {
|
|||
}
|
||||
}
|
||||
}
|
||||
// NodeGraphUpdate::NodeGraphUpdateMessage(NodeGraphUpdateMessage::ImaginateStatusUpdate) => {
|
||||
// responses.add(DocumentMessage::PropertiesPanel(PropertiesPanelMessage::Refresh));
|
||||
// }
|
||||
NodeGraphUpdate::CompilationResponse(execution_response) => {
|
||||
let CompilationResponse { node_graph_errors, result } = execution_response;
|
||||
let type_delta = match result {
|
||||
|
|
@ -759,9 +762,6 @@ impl NodeGraphExecutor {
|
|||
});
|
||||
responses.add(NodeGraphMessage::SendGraph);
|
||||
}
|
||||
NodeGraphUpdate::NodeGraphUpdateMessage(NodeGraphUpdateMessage::ImaginateStatusUpdate) => {
|
||||
responses.add(DocumentMessage::PropertiesPanel(PropertiesPanelMessage::Refresh));
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ pub enum ApplicationError {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum NodeGraphUpdateMessage {
|
||||
ImaginateStatusUpdate,
|
||||
// ImaginateStatusUpdate,
|
||||
}
|
||||
|
||||
pub trait NodeGraphUpdateSender {
|
||||
|
|
@ -236,7 +236,7 @@ impl<T: NodeGraphUpdateSender> NodeGraphUpdateSender for std::sync::Mutex<T> {
|
|||
}
|
||||
|
||||
pub trait GetEditorPreferences {
|
||||
fn hostname(&self) -> &str;
|
||||
// fn hostname(&self) -> &str;
|
||||
fn use_vello(&self) -> bool;
|
||||
}
|
||||
|
||||
|
|
@ -278,9 +278,9 @@ impl NodeGraphUpdateSender for Logger {
|
|||
struct DummyPreferences;
|
||||
|
||||
impl GetEditorPreferences for DummyPreferences {
|
||||
fn hostname(&self) -> &str {
|
||||
"dummy_endpoint"
|
||||
}
|
||||
// fn hostname(&self) -> &str {
|
||||
// "dummy_endpoint"
|
||||
// }
|
||||
|
||||
fn use_vello(&self) -> bool {
|
||||
false
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use super::DocumentNode;
|
||||
pub use crate::imaginate_input::{ImaginateCache, ImaginateController, ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
||||
use crate::proto::{Any as DAny, FutureAny};
|
||||
use crate::wasm_application_io::WasmEditorApi;
|
||||
use dyn_any::DynAny;
|
||||
|
|
@ -163,15 +162,15 @@ tagged_value! {
|
|||
OptionalDVec2(Option<DVec2>),
|
||||
DAffine2(DAffine2),
|
||||
Image(graphene_core::raster::Image<Color>),
|
||||
ImaginateCache(ImaginateCache),
|
||||
Color(graphene_core::raster::color::Color),
|
||||
OptionalColor(Option<graphene_core::raster::color::Color>),
|
||||
Subpaths(Vec<bezier_rs::Subpath<graphene_core::vector::PointId>>),
|
||||
BlendMode(BlendMode),
|
||||
LuminanceCalculation(LuminanceCalculation),
|
||||
ImaginateSamplingMethod(ImaginateSamplingMethod),
|
||||
ImaginateMaskStartingFill(ImaginateMaskStartingFill),
|
||||
ImaginateController(ImaginateController),
|
||||
// ImaginateCache(ImaginateCache),
|
||||
// ImaginateSamplingMethod(ImaginateSamplingMethod),
|
||||
// ImaginateMaskStartingFill(ImaginateMaskStartingFill),
|
||||
// ImaginateController(ImaginateController),
|
||||
Fill(graphene_core::vector::style::Fill),
|
||||
Stroke(graphene_core::vector::style::Stroke),
|
||||
F64Array4([f64; 4]),
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
#[macro_use]
|
||||
extern crate graphene_core;
|
||||
|
||||
pub use graphene_core::{ProtoNodeIdentifier, Type, TypeDescriptor, concrete, generic};
|
||||
|
||||
pub mod document;
|
||||
pub mod proto;
|
||||
|
||||
pub mod graphene_compiler;
|
||||
pub mod imaginate_input;
|
||||
|
||||
pub mod wasm_application_io;
|
||||
|
||||
pub mod proto;
|
||||
#[cfg(feature = "loading")]
|
||||
pub mod util;
|
||||
pub mod wasm_application_io;
|
||||
|
|
|
|||
|
|
@ -271,31 +271,22 @@ impl ApplicationIo for WasmApplicationIo {
|
|||
pub type WasmSurfaceHandle = SurfaceHandle<wgpu_executor::Window>;
|
||||
pub type WasmSurfaceHandleFrame = SurfaceHandleFrame<wgpu_executor::Window>;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Hash, specta::Type)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Hash, specta::Type)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct EditorPreferences {
|
||||
pub imaginate_hostname: String,
|
||||
// pub imaginate_hostname: String,
|
||||
pub use_vello: bool,
|
||||
}
|
||||
|
||||
impl graphene_core::application_io::GetEditorPreferences for EditorPreferences {
|
||||
fn hostname(&self) -> &str {
|
||||
&self.imaginate_hostname
|
||||
}
|
||||
// fn hostname(&self) -> &str {
|
||||
// &self.imaginate_hostname
|
||||
// }
|
||||
fn use_vello(&self) -> bool {
|
||||
self.use_vello
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for EditorPreferences {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
imaginate_hostname: "http://localhost:7860/".into(),
|
||||
use_vello: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl dyn_any::StaticType for EditorPreferences {
|
||||
type Static = EditorPreferences;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,13 @@
|
|||
// `macro_use` puts the log macros (`error!`, `warn!`, `debug!`, `info!` and `trace!`) in scope for the crate
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
// pub mod value;
|
||||
// #![feature(const_type_name)]
|
||||
|
||||
pub mod raster;
|
||||
|
||||
pub mod text;
|
||||
|
||||
pub mod vector;
|
||||
|
||||
pub mod http;
|
||||
|
||||
pub mod any;
|
||||
|
||||
#[cfg(feature = "gpu")]
|
||||
pub mod gpu_nodes;
|
||||
|
||||
pub mod http;
|
||||
pub mod raster;
|
||||
pub mod text;
|
||||
pub mod vector;
|
||||
pub use graphene_core::*;
|
||||
|
||||
pub mod image_color_palette;
|
||||
|
||||
pub mod brush;
|
||||
|
||||
pub mod dehaze;
|
||||
pub mod image_color_palette;
|
||||
#[cfg(feature = "wasm")]
|
||||
pub mod wasm_application_io;
|
||||
|
||||
pub mod dehaze;
|
||||
|
||||
pub mod imaginate;
|
||||
|
|
|
|||
Loading…
Reference in New Issue