Files
InvokeAI/contributing/DOWNLOAD_QUEUE/index.html

3090 lines
74 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="author" content="mauwii">
<link rel="canonical" href="https://invoke-ai.github.io/InvokeAI/contributing/DOWNLOAD_QUEUE/">
<link rel="prev" href="../MODEL_MANAGER/">
<link rel="next" href="../contribution_guides/translation/">
<link rel="icon" href="../../img/favicon.ico">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.33">
<title>Download Queue - InvokeAI Documentation</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.3cba04c6.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../../assets/_mkdocstrings.css">
<link rel="stylesheet" href="../../stylesheets/extra.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-2X4JR4S4FB"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document$.subscribe(function(){var a=document.forms.feedback;if(void 0!==a)for(var e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}),location$.subscribe(function(e){n("config","G-2X4JR4S4FB",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-2X4JR4S4FB",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script>
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
</head>
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#the-invokeai-download-queue" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow md-header--lifted" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="InvokeAI Documentation" class="md-header__button md-logo" aria-label="InvokeAI Documentation" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
InvokeAI Documentation
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Download Queue
</span>
</div>
</div>
</div>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/invoke-ai/InvokeAI" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
</div>
<div class="md-source__repository">
invoke-ai/InvokeAI
</div>
</a>
</div>
</nav>
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../.." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../../installation/INSTALLATION/" class="md-tabs__link">
Installation
</a>
</li>
<li class="md-tabs__item">
<a href="../../nodes/overview/" class="md-tabs__link">
Workflows & Nodes
</a>
</li>
<li class="md-tabs__item">
<a href="../../nodes/communityNodes/" class="md-tabs__link">
Community Nodes
</a>
</li>
<li class="md-tabs__item">
<a href="../../features/" class="md-tabs__link">
Features
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="../CONTRIBUTING/" class="md-tabs__link">
Contributing
</a>
</li>
<li class="md-tabs__item">
<a href="../../help/gettingStartedWithAI/" class="md-tabs__link">
Help
</a>
</li>
<li class="md-tabs__item">
<a href="../../other/CONTRIBUTORS/" class="md-tabs__link">
Other
</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted md-nav--integrated" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="InvokeAI Documentation" class="md-nav__button md-logo" aria-label="InvokeAI Documentation" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
InvokeAI Documentation
</label>
<div class="md-nav__source">
<a href="https://github.com/invoke-ai/InvokeAI" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
</div>
<div class="md-source__repository">
invoke-ai/InvokeAI
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Installation
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Installation
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../installation/INSTALLATION/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/INSTALL_REQUIREMENTS/" class="md-nav__link">
<span class="md-ellipsis">
Requirements
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/010_INSTALL_AUTOMATED/" class="md-nav__link">
<span class="md-ellipsis">
Automatic Install
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/020_INSTALL_MANUAL/" class="md-nav__link">
<span class="md-ellipsis">
Manual Install
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/INSTALL_DEVELOPMENT/" class="md-nav__link">
<span class="md-ellipsis">
Developer Install
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/040_INSTALL_DOCKER/" class="md-nav__link">
<span class="md-ellipsis">
Docker
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/050_INSTALLING_MODELS/" class="md-nav__link">
<span class="md-ellipsis">
Installing Models
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/060_INSTALL_PATCHMATCH/" class="md-nav__link">
<span class="md-ellipsis">
Installing PyPatchMatch
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
<span class="md-ellipsis">
Workflows & Nodes
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Workflows & Nodes
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../nodes/overview/" class="md-nav__link">
<span class="md-ellipsis">
Nodes Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/NODES/" class="md-nav__link">
<span class="md-ellipsis">
Workflow Editor Basics
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/defaultNodes/" class="md-nav__link">
<span class="md-ellipsis">
List of Default Nodes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/exampleWorkflows/" class="md-nav__link">
<span class="md-ellipsis">
Example Workflows
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/comfyToInvoke/" class="md-nav__link">
<span class="md-ellipsis">
ComfyUI to InvokeAI
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/detailedNodes/faceTools/" class="md-nav__link">
<span class="md-ellipsis">
Facetool Node
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/contributingNodes/" class="md-nav__link">
<span class="md-ellipsis">
Contributing Nodes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/NODES_MIGRATION_V3_V4/" class="md-nav__link">
<span class="md-ellipsis">
Migrating from v3 to v4
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/INVOCATION_API/" class="md-nav__link">
<span class="md-ellipsis">
Invocation API
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../nodes/communityNodes/" class="md-nav__link">
<span class="md-ellipsis">
Community Nodes
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
<div class="md-nav__link md-nav__container">
<a href="../../features/" class="md-nav__link ">
<span class="md-ellipsis">
Features
</span>
</a>
<label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Features
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../help/gettingStartedWithAI/" class="md-nav__link">
<span class="md-ellipsis">
New to InvokeAI?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/CONFIGURATION/" class="md-nav__link">
<span class="md-ellipsis">
Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/DATABASE/" class="md-nav__link">
<span class="md-ellipsis">
Database
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/CONTROLNET/" class="md-nav__link">
<span class="md-ellipsis">
Control Adapters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/IMG2IMG/" class="md-nav__link">
<span class="md-ellipsis">
Image-to-Image
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/LOGGING/" class="md-nav__link">
<span class="md-ellipsis">
Controlling Logging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/LORAS/" class="md-nav__link">
<span class="md-ellipsis">
LoRAs & LCM-LoRAs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/MODEL_MERGING/" class="md-nav__link">
<span class="md-ellipsis">
Model Merging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../nodes/overview" class="md-nav__link">
<span class="md-ellipsis">
Workflows & Nodes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/WATERMARK%2BNSFW/" class="md-nav__link">
<span class="md-ellipsis">
NSFW Checker
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/POSTPROCESS/" class="md-nav__link">
<span class="md-ellipsis">
Postprocessing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/PROMPTS/" class="md-nav__link">
<span class="md-ellipsis">
Prompting Features
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_14" >
<label class="md-nav__link" for="__nav_5_14" id="__nav_5_14_label" tabindex="0">
<span class="md-ellipsis">
Textual Inversions
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_14_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_14">
<span class="md-nav__icon md-icon"></span>
Textual Inversions
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../features/TEXTUAL_INVERSIONS/" class="md-nav__link">
<span class="md-ellipsis">
Textual Inversions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/TRAINING/" class="md-nav__link">
<span class="md-ellipsis">
Textual Inversion Training
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../features/UNIFIED_CANVAS/" class="md-nav__link">
<span class="md-ellipsis">
Unified Canvas
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/WEB/" class="md-nav__link">
<span class="md-ellipsis">
InvokeAI Web Server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/WEBUIHOTKEYS/" class="md-nav__link">
<span class="md-ellipsis">
WebUI Hotkeys
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/UTILITIES/" class="md-nav__link">
<span class="md-ellipsis">
Maintenance Utilities
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../features/OTHER/" class="md-nav__link">
<span class="md-ellipsis">
Other
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" checked>
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
<span class="md-ellipsis">
Contributing
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Contributing
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../CONTRIBUTING/" class="md-nav__link">
<span class="md-ellipsis">
How to Contribute
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../CODE_OF_CONDUCT/" class="md-nav__link">
<span class="md-ellipsis">
InvokeAI Code of Conduct
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_3" >
<label class="md-nav__link" for="__nav_6_3" id="__nav_6_3_label" tabindex="0">
<span class="md-ellipsis">
Development
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6_3">
<span class="md-nav__icon md-icon"></span>
Development
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../contribution_guides/development/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../contribution_guides/newContributorChecklist/" class="md-nav__link">
<span class="md-ellipsis">
New Contributors
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../MODEL_MANAGER/" class="md-nav__link">
<span class="md-ellipsis">
Model Manager v2
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../contribution_guides/contributingToFrontend.md" class="md-nav__link">
<span class="md-ellipsis">
Frontend Documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../LOCAL_DEVELOPMENT/" class="md-nav__link">
<span class="md-ellipsis">
Local Development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../TESTS/" class="md-nav__link">
<span class="md-ellipsis">
Testing
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_3_7" >
<label class="md-nav__link" for="__nav_6_3_7" id="__nav_6_3_7_label" tabindex="0">
<span class="md-ellipsis">
Frontend
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_6_3_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6_3_7">
<span class="md-nav__icon md-icon"></span>
Frontend
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../frontend/OVERVIEW/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../frontend/STATE_MGMT/" class="md-nav__link">
<span class="md-ellipsis">
State Management
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../frontend/WORKFLOWS/" class="md-nav__link">
<span class="md-ellipsis">
Workflows
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../contribution_guides/documentation/" class="md-nav__link">
<span class="md-ellipsis">
Documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../INVOCATIONS/" class="md-nav__link">
<span class="md-ellipsis">
Nodes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../MODEL_MANAGER/" class="md-nav__link">
<span class="md-ellipsis">
Model Manager v2
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Download Queue
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Download Queue
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#simple-example" class="md-nav__link">
<span class="md-ellipsis">
Simple Example
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#the-api" class="md-nav__link">
<span class="md-ellipsis">
The API
</span>
</a>
<nav class="md-nav" aria-label="The API">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#the-queue-object" class="md-nav__link">
<span class="md-ellipsis">
The Queue Object
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#the-job-object" class="md-nav__link">
<span class="md-ellipsis">
The Job object
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#callbacks" class="md-nav__link">
<span class="md-ellipsis">
Callbacks
</span>
</a>
<nav class="md-nav" aria-label="Callbacks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#tqdmprogress" class="md-nav__link">
<span class="md-ellipsis">
TqdmProgress
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#events" class="md-nav__link">
<span class="md-ellipsis">
Events
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#job-control" class="md-nav__link">
<span class="md-ellipsis">
Job control
</span>
</a>
<nav class="md-nav" aria-label="Job control">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#job-queuedownloadsource-dest-priority-access_token-on_start-on_progress-on_complete-on_cancelled-on_error" class="md-nav__link">
<span class="md-ellipsis">
job = queue.download(source, dest, priority, access_token, on_start, on_progress, on_complete, on_cancelled, on_error)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#multifile_job-queuemultifile_downloadparts-dest-access_token-on_start-on_progress-on_complete-on_cancelled-on_error" class="md-nav__link">
<span class="md-ellipsis">
multifile_job = queue.multifile_download(parts, dest, access_token, on_start, on_progress, on_complete, on_cancelled, on_error)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#jobs-queuelist_jobs" class="md-nav__link">
<span class="md-ellipsis">
jobs = queue.list_jobs()
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#job-queueid_to_jobid" class="md-nav__link">
<span class="md-ellipsis">
job = queue.id_to_job(id)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#queueprune_jobs" class="md-nav__link">
<span class="md-ellipsis">
queue.prune_jobs()
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#queuejoin" class="md-nav__link">
<span class="md-ellipsis">
queue.join()
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../contribution_guides/translation/" class="md-nav__link">
<span class="md-ellipsis">
Translation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../contribution_guides/tutorials/" class="md-nav__link">
<span class="md-ellipsis">
Tutorials
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Help
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Help
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../help/gettingStartedWithAI/" class="md-nav__link">
<span class="md-ellipsis">
New to InvokeAI?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../help/FAQ/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../help/diffusion/" class="md-nav__link">
<span class="md-ellipsis">
Diffusion Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../help/SAMPLER_CONVERGENCE/" class="md-nav__link">
<span class="md-ellipsis">
Sampler Convergence
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Other
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Other
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../other/CONTRIBUTORS/" class="md-nav__link">
<span class="md-ellipsis">
Contributors
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../other/README-CompViz/" class="md-nav__link">
<span class="md-ellipsis">
CompViz-README
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="the-invokeai-download-queue">The InvokeAI Download Queue<a class="headerlink" href="#the-invokeai-download-queue" title="Permanent link">#</a></h1>
<p>The DownloadQueueService provides a multithreaded parallel download
queue for arbitrary URLs, with queue prioritization, event handling,
and restart capabilities.</p>
<h2 id="simple-example">Simple Example<a class="headerlink" href="#simple-example" title="Permanent link">#</a></h2>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>from invokeai.app.services.download import DownloadQueueService, TqdmProgress
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>download_queue = DownloadQueueService()
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>for url in [&#39;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/a-painting-of-a-fire.png?raw=true&#39;,
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a> &#39;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/birdhouse.png?raw=true&#39;,
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a> &#39;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/missing.png&#39;,
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a> &#39;https://civitai.com/api/download/models/152309?type=Model&amp;format=SafeTensor&#39;,
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a> ]:
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a> # urls start downloading as soon as download() is called
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a> download_queue.download(source=url,
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a> dest=&#39;/tmp/downloads&#39;,
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a> on_progress=TqdmProgress().update
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a> )
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a>
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a>download_queue.join() # wait for all downloads to finish
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a>for job in download_queue.list_jobs():
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a> print(job.model_dump_json(exclude_none=True, indent=4),&quot;\n&quot;)
</code></pre></div>
<p>Output:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>{
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a> &quot;source&quot;: &quot;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/a-painting-of-a-fire.png?raw=true&quot;,
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a> &quot;dest&quot;: &quot;/tmp/downloads&quot;,
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a> &quot;id&quot;: 0,
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a> &quot;priority&quot;: 10,
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a> &quot;status&quot;: &quot;completed&quot;,
<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a> &quot;download_path&quot;: &quot;/tmp/downloads/a-painting-of-a-fire.png&quot;,
<a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a> &quot;job_started&quot;: &quot;2023-12-04T05:34:41.742174&quot;,
<a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a> &quot;job_ended&quot;: &quot;2023-12-04T05:34:42.592035&quot;,
<a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a> &quot;bytes&quot;: 666734,
<a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a> &quot;total_bytes&quot;: 666734
<a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a>}
<a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a>
<a id="__codelineno-1-14" name="__codelineno-1-14" href="#__codelineno-1-14"></a>{
<a id="__codelineno-1-15" name="__codelineno-1-15" href="#__codelineno-1-15"></a> &quot;source&quot;: &quot;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/birdhouse.png?raw=true&quot;,
<a id="__codelineno-1-16" name="__codelineno-1-16" href="#__codelineno-1-16"></a> &quot;dest&quot;: &quot;/tmp/downloads&quot;,
<a id="__codelineno-1-17" name="__codelineno-1-17" href="#__codelineno-1-17"></a> &quot;id&quot;: 1,
<a id="__codelineno-1-18" name="__codelineno-1-18" href="#__codelineno-1-18"></a> &quot;priority&quot;: 10,
<a id="__codelineno-1-19" name="__codelineno-1-19" href="#__codelineno-1-19"></a> &quot;status&quot;: &quot;completed&quot;,
<a id="__codelineno-1-20" name="__codelineno-1-20" href="#__codelineno-1-20"></a> &quot;download_path&quot;: &quot;/tmp/downloads/birdhouse.png&quot;,
<a id="__codelineno-1-21" name="__codelineno-1-21" href="#__codelineno-1-21"></a> &quot;job_started&quot;: &quot;2023-12-04T05:34:41.741975&quot;,
<a id="__codelineno-1-22" name="__codelineno-1-22" href="#__codelineno-1-22"></a> &quot;job_ended&quot;: &quot;2023-12-04T05:34:42.652841&quot;,
<a id="__codelineno-1-23" name="__codelineno-1-23" href="#__codelineno-1-23"></a> &quot;bytes&quot;: 774949,
<a id="__codelineno-1-24" name="__codelineno-1-24" href="#__codelineno-1-24"></a> &quot;total_bytes&quot;: 774949
<a id="__codelineno-1-25" name="__codelineno-1-25" href="#__codelineno-1-25"></a>}
<a id="__codelineno-1-26" name="__codelineno-1-26" href="#__codelineno-1-26"></a>
<a id="__codelineno-1-27" name="__codelineno-1-27" href="#__codelineno-1-27"></a>{
<a id="__codelineno-1-28" name="__codelineno-1-28" href="#__codelineno-1-28"></a> &quot;source&quot;: &quot;https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/missing.png&quot;,
<a id="__codelineno-1-29" name="__codelineno-1-29" href="#__codelineno-1-29"></a> &quot;dest&quot;: &quot;/tmp/downloads&quot;,
<a id="__codelineno-1-30" name="__codelineno-1-30" href="#__codelineno-1-30"></a> &quot;id&quot;: 2,
<a id="__codelineno-1-31" name="__codelineno-1-31" href="#__codelineno-1-31"></a> &quot;priority&quot;: 10,
<a id="__codelineno-1-32" name="__codelineno-1-32" href="#__codelineno-1-32"></a> &quot;status&quot;: &quot;error&quot;,
<a id="__codelineno-1-33" name="__codelineno-1-33" href="#__codelineno-1-33"></a> &quot;job_started&quot;: &quot;2023-12-04T05:34:41.742079&quot;,
<a id="__codelineno-1-34" name="__codelineno-1-34" href="#__codelineno-1-34"></a> &quot;job_ended&quot;: &quot;2023-12-04T05:34:42.147625&quot;,
<a id="__codelineno-1-35" name="__codelineno-1-35" href="#__codelineno-1-35"></a> &quot;bytes&quot;: 0,
<a id="__codelineno-1-36" name="__codelineno-1-36" href="#__codelineno-1-36"></a> &quot;total_bytes&quot;: 0,
<a id="__codelineno-1-37" name="__codelineno-1-37" href="#__codelineno-1-37"></a> &quot;error_type&quot;: &quot;HTTPError(Not Found)&quot;,
<a id="__codelineno-1-38" name="__codelineno-1-38" href="#__codelineno-1-38"></a> &quot;error&quot;: &quot;Traceback (most recent call last):\n File \&quot;/home/lstein/Projects/InvokeAI/invokeai/app/services/download/download_default.py\&quot;, line 182, in _download_next_item\n self._do_download(job)\n File \&quot;/home/lstein/Projects/InvokeAI/invokeai/app/services/download/download_default.py\&quot;, line 206, in _do_download\n raise HTTPError(resp.reason)\nrequests.exceptions.HTTPError: Not Found\n&quot;
<a id="__codelineno-1-39" name="__codelineno-1-39" href="#__codelineno-1-39"></a>}
<a id="__codelineno-1-40" name="__codelineno-1-40" href="#__codelineno-1-40"></a>
<a id="__codelineno-1-41" name="__codelineno-1-41" href="#__codelineno-1-41"></a>{
<a id="__codelineno-1-42" name="__codelineno-1-42" href="#__codelineno-1-42"></a> &quot;source&quot;: &quot;https://civitai.com/api/download/models/152309?type=Model&amp;format=SafeTensor&quot;,
<a id="__codelineno-1-43" name="__codelineno-1-43" href="#__codelineno-1-43"></a> &quot;dest&quot;: &quot;/tmp/downloads&quot;,
<a id="__codelineno-1-44" name="__codelineno-1-44" href="#__codelineno-1-44"></a> &quot;id&quot;: 3,
<a id="__codelineno-1-45" name="__codelineno-1-45" href="#__codelineno-1-45"></a> &quot;priority&quot;: 10,
<a id="__codelineno-1-46" name="__codelineno-1-46" href="#__codelineno-1-46"></a> &quot;status&quot;: &quot;completed&quot;,
<a id="__codelineno-1-47" name="__codelineno-1-47" href="#__codelineno-1-47"></a> &quot;download_path&quot;: &quot;/tmp/downloads/xl_more_art-full_v1.safetensors&quot;,
<a id="__codelineno-1-48" name="__codelineno-1-48" href="#__codelineno-1-48"></a> &quot;job_started&quot;: &quot;2023-12-04T05:34:42.147645&quot;,
<a id="__codelineno-1-49" name="__codelineno-1-49" href="#__codelineno-1-49"></a> &quot;job_ended&quot;: &quot;2023-12-04T05:34:43.735990&quot;,
<a id="__codelineno-1-50" name="__codelineno-1-50" href="#__codelineno-1-50"></a> &quot;bytes&quot;: 719020768,
<a id="__codelineno-1-51" name="__codelineno-1-51" href="#__codelineno-1-51"></a> &quot;total_bytes&quot;: 719020768
<a id="__codelineno-1-52" name="__codelineno-1-52" href="#__codelineno-1-52"></a>}
</code></pre></div>
<h2 id="the-api">The API<a class="headerlink" href="#the-api" title="Permanent link">#</a></h2>
<p>The default download queue is <code>DownloadQueueService</code>, an
implementation of ABC <code>DownloadQueueServiceBase</code>. It juggles multiple
background download requests and provides facilities for interrogating
and cancelling the requests. Access to a current or past download task
is mediated via <code>DownloadJob</code> objects which report the current status
of a job request</p>
<h3 id="the-queue-object">The Queue Object<a class="headerlink" href="#the-queue-object" title="Permanent link">#</a></h3>
<p>A default download queue is located in
<code>ApiDependencies.invoker.services.download_queue</code>. However, you can
create additional instances if you need to isolate your queue from the
main one.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>queue = DownloadQueueService(event_bus=events)
</code></pre></div>
<p><code>DownloadQueueService()</code> takes three optional arguments:</p>
<table>
<thead>
<tr>
<th><strong>Argument</strong></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>max_parallel_dl</code></td>
<td>int</td>
<td>5</td>
<td>Maximum number of simultaneous downloads allowed</td>
</tr>
<tr>
<td><code>event_bus</code></td>
<td>EventServiceBase</td>
<td>None</td>
<td>System-wide FastAPI event bus for reporting download events</td>
</tr>
<tr>
<td><code>requests_session</code></td>
<td>requests.sessions.Session</td>
<td>None</td>
<td>An alternative requests Session object to use for the download</td>
</tr>
</tbody>
</table>
<p><code>max_parallel_dl</code> specifies how many download jobs are allowed to run
simultaneously. Each will run in a different thread of execution.</p>
<p><code>event_bus</code> is an EventServiceBase, typically the one created at
InvokeAI startup. If present, download events are periodically emitted
on this bus to allow clients to follow download progress.</p>
<p><code>requests_session</code> is a url library requests Session object. It is
used for testing.</p>
<h3 id="the-job-object">The Job object<a class="headerlink" href="#the-job-object" title="Permanent link">#</a></h3>
<p>The queue operates on a series of download job objects. These objects
specify the source and destination of the download, and keep track of
the progress of the download.</p>
<p>Two job types are defined. <code>DownloadJob</code> and
<code>MultiFileDownloadJob</code>. The former is a pydantic object with the
following fields:</p>
<table>
<thead>
<tr>
<th><strong>Field</strong></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><em>Fields passed in at job creation time</em></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>source</code></td>
<td>AnyHttpUrl</td>
<td></td>
<td>Where to download from</td>
</tr>
<tr>
<td><code>dest</code></td>
<td>Path</td>
<td></td>
<td>Where to download to</td>
</tr>
<tr>
<td><code>access_token</code></td>
<td>str</td>
<td></td>
<td>[optional] string containing authentication token for access</td>
</tr>
<tr>
<td><code>on_start</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback when the download starts</td>
</tr>
<tr>
<td><code>on_progress</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called at intervals during download progress</td>
</tr>
<tr>
<td><code>on_complete</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called after successful download completion</td>
</tr>
<tr>
<td><code>on_error</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called after an error occurs</td>
</tr>
<tr>
<td><code>id</code></td>
<td>int</td>
<td>auto assigned</td>
<td>Job ID, an integer &gt;= 0</td>
</tr>
<tr>
<td><code>priority</code></td>
<td>int</td>
<td>10</td>
<td>Job priority. Lower priorities run before higher priorities</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><em>Fields updated over the course of the download task</em></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>status</code></td>
<td>DownloadJobStatus</td>
<td></td>
<td>Status code</td>
</tr>
<tr>
<td><code>download_path</code></td>
<td>Path</td>
<td></td>
<td>Path to the location of the downloaded file</td>
</tr>
<tr>
<td><code>job_started</code></td>
<td>float</td>
<td></td>
<td>Timestamp for when the job started running</td>
</tr>
<tr>
<td><code>job_ended</code></td>
<td>float</td>
<td></td>
<td>Timestamp for when the job completed or errored out</td>
</tr>
<tr>
<td><code>job_sequence</code></td>
<td>int</td>
<td></td>
<td>A counter that is incremented each time a model is dequeued</td>
</tr>
<tr>
<td><code>bytes</code></td>
<td>int</td>
<td>0</td>
<td>Bytes downloaded so far</td>
</tr>
<tr>
<td><code>total_bytes</code></td>
<td>int</td>
<td>0</td>
<td>Total size of the file at the remote site</td>
</tr>
<tr>
<td><code>error_type</code></td>
<td>str</td>
<td></td>
<td>String version of the exception that caused an error during download</td>
</tr>
<tr>
<td><code>error</code></td>
<td>str</td>
<td></td>
<td>String version of the traceback associated with an error</td>
</tr>
<tr>
<td><code>cancelled</code></td>
<td>bool</td>
<td>False</td>
<td>Set to true if the job was cancelled by the caller</td>
</tr>
</tbody>
</table>
<p>When you create a job, you can assign it a <code>priority</code>. If multiple
jobs are queued, the job with the lowest priority runs first.</p>
<p>Every job has a <code>source</code> and a <code>dest</code>. <code>source</code> is a pydantic.networks AnyHttpUrl object.
The <code>dest</code> is a path on the local filesystem that specifies the
destination for the downloaded object. Its semantics are
described below.</p>
<p>When the job is submitted, it is assigned a numeric <code>id</code>. The id can
then be used to fetch the job object from the queue.</p>
<p>The <code>status</code> field is updated by the queue to indicate where the job
is in its lifecycle. Values are defined in the string enum
<code>DownloadJobStatus</code>, a symbol available from
<code>invokeai.app.services.download_manager</code>. Possible values are:</p>
<table>
<thead>
<tr>
<th><strong>Value</strong></th>
<th><strong>String Value</strong></th>
<th>** Description **</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>WAITING</code></td>
<td>waiting</td>
<td>Job is on the queue but not yet running</td>
</tr>
<tr>
<td><code>RUNNING</code></td>
<td>running</td>
<td>The download is started</td>
</tr>
<tr>
<td><code>COMPLETED</code></td>
<td>completed</td>
<td>Job has finished its work without an error</td>
</tr>
<tr>
<td><code>ERROR</code></td>
<td>error</td>
<td>Job encountered an error and will not run again</td>
</tr>
</tbody>
</table>
<p><code>job_started</code> and <code>job_ended</code> indicate when the job
was started (using a python timestamp) and when it completed.</p>
<p>In case of an error, the job's status will be set to <code>DownloadJobStatus.ERROR</code>, the text of the
Exception that caused the error will be placed in the <code>error_type</code>
field and the traceback that led to the error will be in <code>error</code>.</p>
<p>A cancelled job will have status <code>DownloadJobStatus.ERROR</code> and an
<code>error_type</code> field of "DownloadJobCancelledException". In addition,
the job's <code>cancelled</code> property will be set to True.</p>
<p>The <code>MultiFileDownloadJob</code> is used for diffusers model downloads,
which contain multiple files and directories under a common root:</p>
<table>
<thead>
<tr>
<th><strong>Field</strong></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><em>Fields passed in at job creation time</em></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>download_parts</code></td>
<td>Set[DownloadJob]</td>
<td></td>
<td>Component download jobs</td>
</tr>
<tr>
<td><code>dest</code></td>
<td>Path</td>
<td></td>
<td>Where to download to</td>
</tr>
<tr>
<td><code>on_start</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback when the download starts</td>
</tr>
<tr>
<td><code>on_progress</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called at intervals during download progress</td>
</tr>
<tr>
<td><code>on_complete</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called after successful download completion</td>
</tr>
<tr>
<td><code>on_error</code></td>
<td>Callable</td>
<td></td>
<td>[optional] callback called after an error occurs</td>
</tr>
<tr>
<td><code>id</code></td>
<td>int</td>
<td>auto assigned</td>
<td>Job ID, an integer &gt;= 0</td>
</tr>
<tr>
<td><em>Fields updated over the course of the download task</em></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>status</code></td>
<td>DownloadJobStatus</td>
<td></td>
<td>Status code</td>
</tr>
<tr>
<td><code>download_path</code></td>
<td>Path</td>
<td></td>
<td>Path to the root of the downloaded files</td>
</tr>
<tr>
<td><code>bytes</code></td>
<td>int</td>
<td>0</td>
<td>Bytes downloaded so far</td>
</tr>
<tr>
<td><code>total_bytes</code></td>
<td>int</td>
<td>0</td>
<td>Total size of the file at the remote site</td>
</tr>
<tr>
<td><code>error_type</code></td>
<td>str</td>
<td></td>
<td>String version of the exception that caused an error during download</td>
</tr>
<tr>
<td><code>error</code></td>
<td>str</td>
<td></td>
<td>String version of the traceback associated with an error</td>
</tr>
<tr>
<td><code>cancelled</code></td>
<td>bool</td>
<td>False</td>
<td>Set to true if the job was cancelled by the caller</td>
</tr>
</tbody>
</table>
<p>Note that the MultiFileDownloadJob does not support the <code>priority</code>,
<code>job_started</code>, <code>job_ended</code> or <code>content_type</code> attributes. You can get
these from the individual download jobs in <code>download_parts</code>.</p>
<h3 id="callbacks">Callbacks<a class="headerlink" href="#callbacks" title="Permanent link">#</a></h3>
<p>Download jobs can be associated with a series of callbacks, each with
the signature <code>Callable[["DownloadJob"], None]</code>. The callbacks are assigned
using optional arguments <code>on_start</code>, <code>on_progress</code>, <code>on_complete</code> and
<code>on_error</code>. When the corresponding event occurs, the callback wil be
invoked and passed the job. The callback will be run in a <code>try:</code>
context in the same thread as the download job. Any exceptions that
occur during execution of the callback will be caught and converted
into a log error message, thereby allowing the download to continue.</p>
<h4 id="tqdmprogress"><code>TqdmProgress</code><a class="headerlink" href="#tqdmprogress" title="Permanent link">#</a></h4>
<p>The <code>invokeai.app.services.download.download_default</code> module defines a
class named <code>TqdmProgress</code> which can be used as an <code>on_progress</code>
handler to display a completion bar in the console. Use as follows:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>from invokeai.app.services.download import TqdmProgress
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a>download_queue.download(source=&#39;http://some.server.somewhere/some_file&#39;,
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a> dest=&#39;/tmp/downloads&#39;,
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a> on_progress=TqdmProgress().update
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a> )
</code></pre></div>
<h3 id="events">Events<a class="headerlink" href="#events" title="Permanent link">#</a></h3>
<p>If the queue was initialized with the InvokeAI event bus (the case
when using <code>ApiDependencies.invoker.services.download_queue</code>), then
download events will also be issued on the bus. The events are:</p>
<ul>
<li>
<p><code>download_started</code> -- This is issued when a job is taken off the
queue and a request is made to the remote server for the URL headers, but before any data
has been downloaded. The event payload will contain the keys <code>source</code>
and <code>download_path</code>. The latter contains the path that the URL will be
downloaded to.</p>
</li>
<li>
<p><code>download_progress -- This is issued periodically as the download
runs. The payload contains the keys</code>source<code>,</code>download_path<code>,</code>current_bytes<code>and</code>total_bytes`. The latter two fields can be
used to display the percent complete.</p>
</li>
<li>
<p><code>download_complete</code> -- This is issued when the download completes
successfully. The payload contains the keys <code>source</code>, <code>download_path</code>
and <code>total_bytes</code>.</p>
</li>
<li>
<p><code>download_error</code> -- This is issued when the download stops because
of an error condition. The payload contains the fields <code>error_type</code>
and <code>error</code>. The former is the text representation of the exception,
and the latter is a traceback showing where the error occurred.</p>
</li>
</ul>
<h3 id="job-control">Job control<a class="headerlink" href="#job-control" title="Permanent link">#</a></h3>
<p>To create a job call the queue's <code>download()</code> method. You can list all
jobs using <code>list_jobs()</code>, fetch a single job by its with
<code>id_to_job()</code>, cancel a running job with <code>cancel_job()</code>, cancel all
running jobs with <code>cancel_all_jobs()</code>, and wait for all jobs to finish
with <code>join()</code>.</p>
<h4 id="job-queuedownloadsource-dest-priority-access_token-on_start-on_progress-on_complete-on_cancelled-on_error">job = queue.download(source, dest, priority, access_token, on_start, on_progress, on_complete, on_cancelled, on_error)<a class="headerlink" href="#job-queuedownloadsource-dest-priority-access_token-on_start-on_progress-on_complete-on_cancelled-on_error" title="Permanent link">#</a></h4>
<p>Create a new download job and put it on the queue, returning the
DownloadJob object.</p>
<h4 id="multifile_job-queuemultifile_downloadparts-dest-access_token-on_start-on_progress-on_complete-on_cancelled-on_error">multifile_job = queue.multifile_download(parts, dest, access_token, on_start, on_progress, on_complete, on_cancelled, on_error)<a class="headerlink" href="#multifile_job-queuemultifile_downloadparts-dest-access_token-on_start-on_progress-on_complete-on_cancelled-on_error" title="Permanent link">#</a></h4>
<p>This is similar to download(), but instead of taking a single source,
it accepts a <code>parts</code> argument consisting of a list of
<code>RemoteModelFile</code> objects. Each part corresponds to a URL/Path pair,
where the URL is the location of the remote file, and the Path is the
destination.</p>
<p><code>RemoteModelFile</code> can be imported from <code>invokeai.backend.model_manager.metadata</code>, and
consists of a url/path pair. Note that the path <em>must</em> be relative.</p>
<p>The method returns a <code>MultiFileDownloadJob</code>.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>from invokeai.backend.model_manager.metadata import RemoteModelFile
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>remote_file_1 = RemoteModelFile(url=&#39;http://www.foo.bar/my/pytorch_model.safetensors&#39;&#39;,
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a> path=&#39;my_model/textencoder/pytorch_model.safetensors&#39;
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a> )
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a>remote_file_2 = RemoteModelFile(url=&#39;http://www.bar.baz/vae.ckpt&#39;,
<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a> path=&#39;my_model/vae/diffusers_model.safetensors&#39;
<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a> )
<a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a>job = queue.multifile_download(parts=[remote_file_1, remote_file_2],
<a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a> dest=&#39;/tmp/downloads&#39;,
<a id="__codelineno-4-10" name="__codelineno-4-10" href="#__codelineno-4-10"></a> on_progress=TqdmProgress().update)
<a id="__codelineno-4-11" name="__codelineno-4-11" href="#__codelineno-4-11"></a>queue.wait_for_job(job)
<a id="__codelineno-4-12" name="__codelineno-4-12" href="#__codelineno-4-12"></a>print(f&quot;The files were downloaded to {job.download_path}&quot;)
</code></pre></div>
<h4 id="jobs-queuelist_jobs">jobs = queue.list_jobs()<a class="headerlink" href="#jobs-queuelist_jobs" title="Permanent link">#</a></h4>
<p>Return a list of all active and inactive <code>DownloadJob</code>s.</p>
<h4 id="job-queueid_to_jobid">job = queue.id_to_job(id)<a class="headerlink" href="#job-queueid_to_jobid" title="Permanent link">#</a></h4>
<p>Return the job corresponding to given ID.</p>
<p>Return a list of all active and inactive <code>DownloadJob</code>s.</p>
<h4 id="queueprune_jobs">queue.prune_jobs()<a class="headerlink" href="#queueprune_jobs" title="Permanent link">#</a></h4>
<p>Remove inactive (complete or errored) jobs from the listing returned
by <code>list_jobs()</code>.</p>
<h4 id="queuejoin">queue.join()<a class="headerlink" href="#queuejoin" title="Permanent link">#</a></h4>
<p>Block until all pending jobs have run to completion or errored out.</p>
<aside class="md-source-file">
<span class="md-source-file__fact">
<span class="md-icon" title="Last update">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1-2.1-2M12.5 7v5.2l4 2.4-1 1L11 13V7h1.5M11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2v1.8Z"/></svg>
</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">August 29, 2024</span>
</span>
<span class="md-source-file__fact">
<span class="md-icon" title="Created">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.47 15.08 11 13V7h1.5v5.25l3.08 1.83c-.41.28-.79.62-1.11 1m-1.39 4.84c-.36.05-.71.08-1.08.08-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8c0 .37-.03.72-.08 1.08.69.1 1.33.32 1.92.64.1-.56.16-1.13.16-1.72 0-5.5-4.5-10-10-10S2 6.5 2 12s4.47 10 10 10c.59 0 1.16-.06 1.72-.16-.32-.59-.54-1.23-.64-1.92M18 15v3h-3v2h3v3h2v-3h3v-2h-3v-3h-2Z"/></svg>
</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">August 29, 2024</span>
</span>
</aside>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2023 InvokeAI Team
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.instant", "navigation.tabs", "navigation.tabs.sticky", "navigation.tracking", "navigation.indexes", "navigation.path", "search.highlight", "search.suggest", "toc.integrate"], "search": "../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.af256bd8.min.js"></script>
<script src="https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js"></script>
<script src="../../javascripts/tablesort.js"></script>
<script src="../../javascript/init_kapa_widget.js"></script>
</body>
</html>