Skip to content

Comfy Nodes that make utilizing resources from Civitas easy as copying and pasting

Notifications You must be signed in to change notification settings

Chaoses-Ib/civitai_comfy_nodes

 
 

Repository files navigation

Civitai Comfy Nodes

PyPI - Version

def CivitAICheckpointLoader(
    ckpt_air: str = '{model_id}@{model_version}',
    ckpt_name: CivitAICheckpointLoader.ckpt_name = 'none',
    download_chunks: int | None = 4,
    download_path: CivitAICheckpointLoader.download_path | None = r'models\checkpoints'
) -> tuple[Model, Clip, Vae]

def CivitAILoraLoader(
    model: Model,
    clip: Clip,
    lora_air: str = '{model_id}@{model_version}',
    lora_name: CivitAILoraLoader.lora_name = 'none',
    strength_model: float = 1.0,
    strength_clip: float = 1.0,
    download_chunks: int | None = 4,
    download_path: CivitAILoraLoader.download_path | None = r'models\loras'
) -> tuple[Model, Clip]

An air can be in the following formats:

ComfyScript examples:

model, clip, vae = CivitAICheckpointLoader('101055@128078')
model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055?modelVersionId=128078')
model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055/sd-xl?modelVersionId=128078')

model, clip = CivitAILoraLoader(model, clip, '350450@391994', strength_clip=1, strength_model=1)
model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450?modelVersionId=391994', strength_clip=1, strength_model=1)
model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450/sdxl-lightning-lora-2step?modelVersionId=391994', strength_clip=1, strength_model=1)

Original docs

Tired of manually downloading and moving models, LoRAs, and more to the right places?
Sick of scouring Civitai for that one mystical LoRA someone was using to make that cool image?
Want to be share a fully reproducable workflow?

This is the set of nodes for you!

Nodes

Checkpoint Loader

  • Load checkpoints directly from Civitai using just a Model AIR (model id or version id)
  • Resources used in images will be automatically detected on image upload
  • Workflows copied from Civitai or shared via image metadata will include everything needed to generate the image including all resources

LoRA Loader

  • Load LoRAs directly from Civitai using just a LoRA AIR (model id or version id)
  • Resources used in images will be automatically detected on image upload
  • Workflows copied from Civitai or shared via image metadata will include everything needed to generate the image including all resources

Embedding Loader (Coming Soon)

  • Automatically detect textual inversions in prompts using embedding:{air} and download all the files needed.
  • Resources used in images will be automatically detected on image upload
  • Workflows copied from Civitai or shared via image metadata will include everything needed to generate the image including all resources

AIR: AI Resource

An AIR is Civitai's way of universally referencing AI Resources. It follows the Uniform Resource Naming standard. If you're into that kinda thing, you can read more about it here.

On Civitai, to keep things brief, an AIR is a combination of model id and optionally at a specific model version. Ex. {model_id} or {model_id}@{version_id}.

Easy Copy AIRs

You can enable the display of AIRs on the site for easy copying from the Early Access settings of your Account Settings.

Examples

This example would get the base model Isabelle Fuhrman 109395 and request the LORA version isabellefuhrmanV02-000007.safetensors 84321

109395@84321

While using only the ID would fetch Isabelle Fuhrman 109395 and find it's default model (which is the top most model an author designates)

109395

About

Comfy Nodes that make utilizing resources from Civitas easy as copying and pasting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%