Struct sal_e_api::ComfyPromptApi
source · pub struct ComfyPromptApi {
pub client: Comfy,
pub params: ComfyParams,
pub output_node: Option<String>,
pub prompt_node: Option<String>,
}
Expand description
Struct wrapping a connection to the ComfyUI API.
Fields§
§client: Comfy
The ComfyUI client.
params: ComfyParams
Default parameters for the ComfyUI API.
output_node: Option<String>
The output node.
prompt_node: Option<String>
The prompt node.
Implementations§
source§impl ComfyPromptApi
impl ComfyPromptApi
sourcepub fn new(prompt: Prompt) -> Result<Self, ComfyPromptApiError>
pub fn new(prompt: Prompt) -> Result<Self, ComfyPromptApiError>
sourcepub fn new_with_url<S>(
url: S,
prompt: Prompt,
) -> Result<Self, ComfyPromptApiError>
pub fn new_with_url<S>( url: S, prompt: Prompt, ) -> Result<Self, ComfyPromptApiError>
Constructs a new ComfyPromptApi
client with the provided url and prompt.
§Arguments
url
- The URL to use for the API. Must be a valid URL, e.g. `http://localhost:8188prompt
- The prompt to use for the API.
§Returns
A new ComfyPromptApi
instance on success, or an error if there was a failure in the ComfyUI API client.
sourcepub fn new_with_client_and_url<S>(
client: Client,
url: S,
prompt: Prompt,
) -> Result<Self>
pub fn new_with_client_and_url<S>( client: Client, url: S, prompt: Prompt, ) -> Result<Self>
Constructs a new ComfyPromptApi
client with the provided url and prompt.
§Arguments
client
- An instance ofreqwest::Client
.url
- The URL to use for the API. Must be a valid URL, e.g. `http://localhost:8188prompt
- The prompt to use for the API.
§Returns
A new ComfyPromptApi
instance on success, or an error if there was a failure in the ComfyUI API client.
Trait Implementations§
source§impl Clone for ComfyPromptApi
impl Clone for ComfyPromptApi
source§fn clone(&self) -> ComfyPromptApi
fn clone(&self) -> ComfyPromptApi
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ComfyPromptApi
impl Debug for ComfyPromptApi
source§impl Default for ComfyPromptApi
impl Default for ComfyPromptApi
source§fn default() -> ComfyPromptApi
fn default() -> ComfyPromptApi
Returns the “default value” for a type. Read more
source§impl Img2ImgApi for ComfyPromptApi
impl Img2ImgApi for ComfyPromptApi
source§fn img2img<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 dyn GenParams,
) -> Pin<Box<dyn Future<Output = Result<Response, Img2ImgApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn img2img<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 dyn GenParams,
) -> Pin<Box<dyn Future<Output = Result<Response, Img2ImgApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generates an image using image-to-image. Read more
source§impl Txt2ImgApi for ComfyPromptApi
impl Txt2ImgApi for ComfyPromptApi
source§fn txt2img<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 dyn GenParams,
) -> Pin<Box<dyn Future<Output = Result<Response, Txt2ImgApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn txt2img<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 dyn GenParams,
) -> Pin<Box<dyn Future<Output = Result<Response, Txt2ImgApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generates an image using text-to-image. Read more
Auto Trait Implementations§
impl Freeze for ComfyPromptApi
impl !RefUnwindSafe for ComfyPromptApi
impl Send for ComfyPromptApi
impl Sync for ComfyPromptApi
impl Unpin for ComfyPromptApi
impl !UnwindSafe for ComfyPromptApi
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more