Struct comfyui_api::models::prompt::Prompt

source ·
pub struct Prompt {
    pub workflow: HashMap<String, NodeOrUnknown>,
}
Expand description

Struct representing a prompt workflow.

Fields§

§workflow: HashMap<String, NodeOrUnknown>

The prompt workflow, indexed by node id.

Implementations§

source§

impl Prompt

source

pub fn get_node_by_id(&self, id: &str) -> Option<&dyn Node>

source

pub fn get_node_by_id_mut(&mut self, id: &str) -> Option<&mut dyn Node>

source

pub fn get_nodes_by_type<T: Node + 'static>( &self, ) -> impl Iterator<Item = (&str, &T)>

source

pub fn get_nodes_by_type_mut<T: Node + 'static>( &mut self, ) -> impl Iterator<Item = (&str, &mut T)>

Trait Implementations§

source§

impl BatchSizeExt for Prompt

source§

fn batch_size(&self) -> Result<&u32>

Get a reference to the value. Read more
source§

fn batch_size_mut(&mut self) -> Result<&mut u32>

Get a mutable reference to the value. Read more
source§

impl CfgExt for Prompt

source§

fn cfg(&self) -> Result<&f32>

Get a reference to the value. Read more
source§

fn cfg_mut(&mut self) -> Result<&mut f32>

Get a mutable reference to the value. Read more
source§

impl Clone for Prompt

source§

fn clone(&self) -> Prompt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Prompt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Prompt

source§

fn default() -> Prompt

Returns the “default value” for a type. Read more
source§

impl DenoiseExt for Prompt

source§

fn denoise(&self) -> Result<&f32>

Get a reference to the value. Read more
source§

fn denoise_mut(&mut self) -> Result<&mut f32>

Get a mutable reference to the value. Read more
source§

impl<'de> Deserialize<'de> for Prompt

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<N: Node + 'static> GetExt<N> for Prompt

source§

fn get_typed_node(&self, node: &str) -> Result<&N>

Gets a reference to the node with id node. Read more
source§

fn get_typed_node_mut(&mut self, node: &str) -> Result<&mut N>

Gets a mutable reference to the node with id node. Read more
source§

impl HeightExt for Prompt

source§

fn height(&self) -> Result<&u32>

Get a reference to the value. Read more
source§

fn height_mut(&mut self) -> Result<&mut u32>

Get a mutable reference to the value. Read more
source§

impl LoadImageExt for Prompt

source§

fn image(&self) -> Result<&String>

Get a reference to the value. Read more
source§

fn image_mut(&mut self) -> Result<&mut String>

Get a mutable reference to the value. Read more
source§

impl ModelExt for Prompt

source§

fn ckpt_name(&self) -> Result<&String>

Get a reference to the value. Read more
source§

fn ckpt_name_mut(&mut self) -> Result<&mut String>

Get a mutable reference to the value. Read more
source§

impl NegativePromptExt for Prompt

source§

fn negative_prompt(&self) -> Result<&String>

Get a reference to the value. Read more
source§

fn negative_prompt_mut(&mut self) -> Result<&mut String>

Get a mutable reference to the value. Read more
source§

impl PromptExt for Prompt

source§

fn prompt(&self) -> Result<&String>

Get a reference to the value. Read more
source§

fn prompt_mut(&mut self) -> Result<&mut String>

Get a mutable reference to the value. Read more
source§

impl SamplerExt for Prompt

source§

fn sampler_name(&self) -> Result<&String>

Get a reference to the value. Read more
source§

fn sampler_name_mut(&mut self) -> Result<&mut String>

Get a mutable reference to the value. Read more
source§

impl SeedExt for Prompt

source§

fn seed(&self) -> Result<&i64>

Get a reference to the value. Read more
source§

fn seed_mut(&mut self) -> Result<&mut i64>

Get a mutable reference to the value. Read more
source§

impl Serialize for Prompt

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<N: Node + 'static> SetExt<N> for Prompt

source§

fn set_with<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(&mut N) -> Result<()>,

Uses a heuristic to find a Node and set the value on it. Read more
source§

fn set_node_with<F>(&mut self, node: &str, f: F) -> Result<()>
where F: FnOnce(&mut N) -> Result<()>,

Sets the value on the node with id node. Read more
source§

impl<T, N: Node + 'static> SetterExt<T, N> for Prompt

source§

fn set<S>(&mut self, value: T) -> Result<()>
where S: Setter<T, N>,

Uses a heuristic to find a Node and set the value on it. Read more
source§

fn set_from<S>(&mut self, output_node: &str, value: T) -> Result<()>
where S: Setter<T, N>,

Finds a Node leading into the given output_node and sets the value on it. Read more
source§

fn set_node<S>(&mut self, node: &str, value: T) -> Result<()>
where S: Setter<T, N>,

Sets the value on the node with id node. Read more
source§

impl StepsExt for Prompt

source§

fn steps(&self) -> Result<&u32>

Get a reference to the value. Read more
source§

fn steps_mut(&mut self) -> Result<&mut u32>

Get a mutable reference to the value. Read more
source§

impl WidthExt for Prompt

source§

fn width(&self) -> Result<&u32>

Get a reference to the value. Read more
source§

fn width_mut(&mut self) -> Result<&mut u32>

Get a mutable reference to the value. Read more

Auto Trait Implementations§

§

impl Freeze for Prompt

§

impl !RefUnwindSafe for Prompt

§

impl Send for Prompt

§

impl Sync for Prompt

§

impl Unpin for Prompt

§

impl !UnwindSafe for Prompt

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Get a reference to dyn Any.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,