cmfy_nodes/
lib.rs

1use cmfy_macros::Node;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, Node)]
5#[node(class_type = "LoraLoader")]
6pub struct LoraLoaderInputs {
7    pub lora_name: String,
8    pub strength_clip: f32,
9    pub strength_model: f32,
10    #[serde(flatten)]
11    #[node_input(skip)]
12    pub other: serde_json::Value,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize, Node)]
16#[node(class_type = "KSampler")]
17pub struct KSamplerInputs {
18    pub cfg: f32,
19    pub denoise: f32,
20    pub sampler_name: String,
21    pub scheduler: String,
22    pub steps: u8,
23    pub seed: u64,
24    #[serde(flatten)]
25    #[node_input(skip)]
26    pub other: serde_json::Value,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize, Node)]
30#[node(class_type = "EmptyLatentImage")]
31pub struct EmptyLatentImageInputs {
32    pub batch_size: u8,
33    pub height: usize,
34    pub width: usize,
35}
36
37#[derive(Debug, Clone, Serialize, Deserialize, Node)]
38#[node(class_type = "CLIPTextEncode")]
39pub struct ClipTextEncodeInput {
40    pub text: String,
41    pub clip: serde_json::Value,
42}