mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Remove the serde feature and instead just always require it (#2737)
workspace: remove feature `serde`, always require it instead
This commit is contained in:
@@ -20,9 +20,9 @@ wayland = ["graph-craft/wayland"]
|
||||
[dependencies]
|
||||
# Local dependencies
|
||||
dyn-any = { workspace = true }
|
||||
graph-craft = { workspace = true, features = ["serde"] }
|
||||
graph-craft = { workspace = true }
|
||||
wgpu-executor = { workspace = true }
|
||||
graphene-core = { workspace = true, features = ["serde"] }
|
||||
graphene-core = { workspace = true }
|
||||
|
||||
# Workspace dependencies
|
||||
fastnoise-lite = { workspace = true }
|
||||
@@ -45,7 +45,6 @@ wasm-bindgen = { workspace = true, optional = true }
|
||||
wasm-bindgen-futures = { workspace = true, optional = true }
|
||||
tokio = { workspace = true, optional = true }
|
||||
vello = { workspace = true, optional = true }
|
||||
serde = { workspace = true, optional = true }
|
||||
web-sys = { workspace = true, optional = true, features = [
|
||||
"Window",
|
||||
"CanvasRenderingContext2d",
|
||||
|
||||
@@ -178,20 +178,17 @@ impl core::fmt::Display for Error {
|
||||
|
||||
impl std::error::Error for Error {}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
|
||||
#[derive(Default, Debug, Clone, serde::Deserialize)]
|
||||
struct ImageResponse {
|
||||
images: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
|
||||
#[derive(Default, Debug, Clone, serde::Deserialize)]
|
||||
struct ProgressResponse {
|
||||
progress: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, Copy, serde::Serialize)]
|
||||
struct ImaginateTextToImageRequestOverrideSettings {
|
||||
show_progress_every_n_steps: u32,
|
||||
}
|
||||
@@ -204,8 +201,7 @@ impl Default for ImaginateTextToImageRequestOverrideSettings {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, Copy, serde::Serialize)]
|
||||
struct ImaginateImageToImageRequestOverrideSettings {
|
||||
show_progress_every_n_steps: u32,
|
||||
img2img_fix_steps: bool,
|
||||
@@ -220,16 +216,14 @@ impl Default for ImaginateImageToImageRequestOverrideSettings {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
struct ImaginateTextToImageRequest<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
#[serde(flatten)]
|
||||
common: ImaginateCommonImageRequest<'a>,
|
||||
override_settings: ImaginateTextToImageRequestOverrideSettings,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
struct ImaginateMask {
|
||||
mask: String,
|
||||
mask_blur: String,
|
||||
@@ -238,21 +232,19 @@ struct ImaginateMask {
|
||||
inpainting_mask_invert: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
struct ImaginateImageToImageRequest<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
#[serde(flatten)]
|
||||
common: ImaginateCommonImageRequest<'a>,
|
||||
override_settings: ImaginateImageToImageRequestOverrideSettings,
|
||||
|
||||
init_images: Vec<String>,
|
||||
denoising_strength: f64,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
#[serde(flatten)]
|
||||
mask: Option<ImaginateMask>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
struct ImaginateCommonImageRequest<'a> {
|
||||
prompt: String,
|
||||
seed: f64,
|
||||
|
||||
@@ -305,7 +305,6 @@ fn image_value(_: impl Ctx, _primary: (), image: RasterDataTable<CPU>) -> Raster
|
||||
image
|
||||
}
|
||||
|
||||
// #[cfg(feature = "serde")]
|
||||
// macro_rules! generate_imaginate_node {
|
||||
// ($($val:ident: $t:ident: $o:ty,)*) => {
|
||||
// pub struct ImaginateNode<P: Pixel, E, C, G, $($t,)*> {
|
||||
@@ -386,7 +385,6 @@ fn image_value(_: impl Ctx, _primary: (), image: RasterDataTable<CPU>) -> Raster
|
||||
// }
|
||||
// }
|
||||
|
||||
// #[cfg(feature = "serde")]
|
||||
// generate_imaginate_node! {
|
||||
// seed: Seed: f64,
|
||||
// res: Res: Option<DVec2>,
|
||||
|
||||
Reference in New Issue
Block a user