If you are not sure if the website you would like to visit is secure, you can verify it here. Enter the website address of the page and see parts of its content and the thumbnail images on this site. None (if any) dangerous scripts on the referenced page will be executed. Additionally, if the selected site contains subpages, you can verify it (review) in batches containing 5 pages.
favicon.ico: web.archive.org/web/20221130171234/https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065 - #3449 - VRAM leak when switchi.

site address: web.archive.org/web/20221129061517/https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065 redirected to: web.archive.org/web/20221130171234/https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065

site title: #3449 - VRAM leak when switching to/from inpainting checkpoint by JaySmithWpg · Pull Request #5065 · AUTOMATIC1111/stable-diffusion-webui · GitHub

Our opinion (on Thursday 01 October 2026 6:49:12 UTC):

GREEN status (no comments) - no comments
After content analysis of this website we propose the following hashtags:



Meta tags:
description=The Problem This PR addresses issue #3449: Switching between sd-v1-5-impainting and another checkpoint can result in a large amount of VRAM being consumed. Since the problem is in the TorchHijack class, this issue only occurs if you generate images with a batch size of at least 2 before switching checkpoints. The TorchHijack class is a global hijack that contains a reference to the sampler being used. Unfortunately, the sampler also contains a reference to the loaded checkpoint. Since this reference persists after image generation is complete, the checkpoint cannot be garbage collected. If shared.load_model is called when the program is in this state, it will attempt to load a second checkpoint with the previous checkpoint still in memory. The Solution Instead of keeping a reference to the entire sampler in TorchHijack, we only pass it the minimal amount of information it needs: a collection of sample noises. I ve further optimized TorchHijack by replacing the use of a one-way iterator with a deque, so the sample noises can be garbage collected immediately after they re used. Steps to Reproduce With sd-v-1-5-impainting, use txt2img to generate images with a batch size of at least 2. Switch to a non-impainting checkpoint. Your VRAM is now mostly gone.;

Headings (most frequently used words):

commented, nov, 26, 2022, jaysmithwpg, to, jn, jairo, 3449, vram, leak, when, switching, from, inpainting, checkpoint, 5065, the, footer, edited, problem, solution, conversation, steps, reproduce, progamergov, navigation,

Text of the page (most frequently used words):
the (51), this (30), that (20), 2022 (18), nov (17), github (16), from (14), all (14), #inpainting (14), #checkpoint (14), and (13), automatic1111 (12), you (11), with (11), about (11), vram (11), applied (10), code (10), jaysmithwpg (10), sign (9), something (9), switching (9), reference (9), pull (8), sorry (8), went (8), wrong (8), reactions (8), model (8), commented (8), copy (8), link (8), 3449 (8), leak (8), when (8), can (7), suggestions (7), cannot (7), issues (7), for (7), problem (7), models (7), file (7), issue (7), another (6), suggestion (6), fix (6), jump (6), request (5), not (5), batch (5), commit (5), one (5), changes (5), merged (5), use (5), yaml (5), config (5), just (5), contributor (5), being (5), your (4), security (4), while (4), has (4), change (4), account (4), said (4), jairo (4), back (4), though (4), other (4), but (4), references (4), some (4), memory (4), able (4), switch (4), without (4), script (4), torchhijack (4), open (4), 5065 (4), out (3), line (3), create (3), only (3), because (3), none (3), yet (3), projects (3), already (3), conversation (3), into (3), master (3), same (3), different (3), author (3), after (3), don (3), least (3), fixes (3), grid (3), good (3), load (3), using (3), name (3), plot (3), axis (3), management (3), consider (3), separate (3), having (3), restart (3), app (3), collaborator (3), there (3), more (3), keeping (3), review (3), impainting (3), sampler (3), contains (3), characters (3), unicode (3), actions (3), discussions (3), stable (3), diffusion (3), webui (3), repository (3), signed (2), tab (2), window (2), refresh (2), session (2), reload (2), time (2), blog (2), pricing (2), contact (2), privacy (2), terms (2), footer (2), navigation (2), add (2), single (2), closed (2), may (2), these (2), milestone (2), have (2), free (2), view (2), details (2), will (2), case (2), before (2), progamergov (2), wasn (2), related (2), edited (2), reaction (2), 0xdevalias (2), reacted (2), heart (2), emoji (2), title (2), workflow (2), changed (2), job (2), bug (2), weights (2), requires (2), generation (2), checkpoints (2), any (2), work (2), find (2), previous (2), generate (2), images (2), size (2), amount (2), sample (2), noises (2), garbage (2), collected (2), used (2), solution (2), since (2), class (2), hidden (2), bidirectional (2), community (2), project (2), insights (2), wiki (2), requests (2), source (2), manage (2), packages (2), web (2), capture (2), perform, action, training, api, docs, status, inc, queued, merge, multi, comments, pending, reviews, been, marked, resolved, outdated, must, existing, order, valid, applying, deleted, lines, supported, per, viewing, subset, invalid, were, made, participants, successfully, merging, close, development, labels, assigned, assignees, reviewers, comment, join, check, passed, 01f2ed6, hide, approved, suspect, underlying, hoping, isn, specific, anytime, was, most, common, where, happened, came, noticed, released, main, 768, might, keep, want, hold, hunt, down, very, dropped, word, take, crack, fixing, well, normally, include, art, appreciate, debugging, challenge, forgot, say, saying, should, addressed, part, finding, testing, does, releasing, sd_model, once, done, every, falls, scope, automatically, cleaned, run, trouble, lot, clean, whole, tried, great, know, are, places, like, kind, hell, removed, always, place, task, inconsistent, stability, changing, mentioned, requested, owner, c833d5b, now, mostly, gone, non, txt2img, steps, reproduce, instead, entire, pass, minimal, information, needs, collection, further, optimized, replacing, way, iterator, deque, immediately, they, persists, image, complete, shared, load_model, called, program, state, attempt, second, still, occurs, global, hijack, unfortunately, also, loaded, addresses, between, result, large, consumed, show, text, interpreted, compiled, differently, than, what, appears, below, editor, reveals, learn, files, checks, commits, bottom, clicking, agree, our, occasionally, send, emails, statement, service, password, email, address, pick, username, its, maintainers, question, new, 108, star, fork, notifications, public, message, user, suggested, results, collections, trending, topics, repositories, articles, readme, fund, developers, sponsors, resources, customer, stories, studies, devsecops, devops, automation, education, startups, teams, enterprise, solutions, skills, documentation, features, explore, collaborate, outside, plan, track, write, better, copilot, instant, dev, environments, codespaces, vulnerabilities, host, automate, product, toggle, skip, content, wayback, machine, http, archive, org, 20221130171234, https, com, timestamps, fail, success, 2023, 2021, dec, oct,


Text of the page (random words):
3449 vram leak when switching to from inpainting checkpoint by jaysmithwpg pull request 5065 automatic1111 stable diffusion webui github 1 capture 30 nov 2022 oct nov dec 30 2021 2022 2023 success fail about this capture timestamps the wayback machine http web archive org web 20221130171234 https github com automatic1111 stable diffusion webui pull 5065 skip to content toggle navigation sign up product actions automate any workflow packages host and manage packages security find and fix vulnerabilities codespaces instant dev environments copilot write better code with ai code review manage code changes issues plan and track work discussions collaborate outside of code explore all features documentation github skills blog solutions for enterprise teams startups education by solution ci cd automation devops devsecops case studies customer stories resources open source github sponsors fund open source developers the readme project github community articles repositories topics trending collections pricing in this repository all github jump to no suggested jump to results in this repository all github jump to in this user all github jump to in this repository all github jump to sign in sign up message automatic1111 stable diffusion webui public notifications fork 4 2k star 23 1k code issues 1 3k pull requests 108 discussions actions projects 0 wiki security insights more code issues pull requests discussions actions projects wiki security insights new issue have a question about this project sign up for a free github account to open an issue and contact its maintainers and the community pick a username email address password sign up for github by clicking sign up for github you agree to our terms of service and privacy statement we ll occasionally send you account related emails already on github sign in to your account jump to bottom 3449 vram leak when switching to from inpainting checkpoint 5065 merged automatic1111 merged 1 commit into automatic1111 master from jaysmithwpg vram leak nov 27 2022 merged 3449 vram leak when switching to from inpainting checkpoint 5065 automatic1111 merged 1 commit into automatic1111 master from jaysmithwpg vram leak nov 27 2022 15 18 conversation 7 commits 1 checks 1 files changed 1 conversation this file contains bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters copy link contributor jaysmithwpg commented nov 26 2022 edited the problem this pr addresses issue 3449 switching between sd v1 5 impainting and another checkpoint can result in a large amount of vram being consumed since the problem is in the torchhijack class this issue only occurs if you generate images with a batch size of at least 2 before switching checkpoints the torchhijack class is a global hijack that contains a reference to the sampler being used unfortunately the sampler also contains a reference to the loaded checkpoint since this reference persists after image generation is complete the checkpoint cannot be garbage collected if shared load_model is called when the program is in this state it will attempt to load a second checkpoint with the previous checkpoint still in memory the solution instead of keeping a reference to the entire sampler in torchhijack we only pass it the minimal amount of information it needs a collection of sample noises i ve further optimized torchhijack by replacing the use of a one way iterator with a deque so the sample noises can be garbage collected immediately after they re used steps to reproduce with sd v 1 5 impainting use txt2img to generate images with a batch size of at least 2 switch to a non impainting checkpoint your vram is now mostly gone sorry something went wrong ️ 1 0xdevalias reacted with heart emoji all reactions ️ 1 reaction fixes 3449 vram leak when switching to from inpainting model c833d5b jaysmithwpg requested a review from automatic1111 as a code owner nov 26 2022 jaysmithwpg mentioned this pull request nov 26 2022 bug inconsistent stability when changing from v1 5 model to inpainting v1 5 model 3449 closed 1 task copy link collaborator jn jairo commented nov 26 2022 great but just for you to know there are more places keeping a reference like the xy grid script it is kind of a reference hell i already removed some references in a previous pr but there is always another place keeping a reference it is a lot of work to clean up the whole code i tried to fix the reference problem in the xy grid script but i wasn t able to find all the references in there all reactions sorry something went wrong copy link contributor author jaysmithwpg commented nov 26 2022 from my testing the xy script does a good job of releasing sd_model references once the generation is done every reference in it falls out of scope and is automatically cleaned up with this fix you can run the xy script and change checkpoints without any trouble that said using checkpoint name as an x y plot axis has some memory management issues i d consider that a separate issue though this is about being able to switch to inpainting and back without having to restart the app all reactions sorry something went wrong copy link collaborator jn jairo commented nov 26 2022 that said using checkpoint name as an x y plot axis has some memory management issues i d consider that a separate issue though this is about being able to switch to inpainting and back without having to restart the app that is the problem it is not about inpainting models it is about change to models that requires a different yaml config file because models that use the same yaml config file don t create another model it just load the other weights all reactions sorry something went wrong copy link collaborator jn jairo commented nov 26 2022 that said using checkpoint name as an x y plot axis has some memory management issues i d consider that a separate issue though this is about being able to switch to inpainting and back without having to restart the app that is the problem it is not about inpainting models it is about change to models that requires a different yaml config file because models that use the same yaml config file don t create another model it just load the other weights i forgot to say i am not saying the other references should be addressed in this pr it is ok to fix one part at a time good job finding this bug all reactions sorry something went wrong jaysmithwpg changed the title fixes 3449 vram leak when switching to from inpainting checkpoint 3449 vram leak when switching to from inpainting checkpoint nov 26 2022 copy link contributor author jaysmithwpg commented nov 26 2022 at the very least i ve dropped the word fixes from the title i ll take a crack at fixing the xy grid as well it s not something i normally include in my art workflow but i appreciate a good debugging challenge i ll keep this pr as it is though i don t want to hold up this fix while i hunt down the other one ️ 1 0xdevalias reacted with heart emoji all reactions ️ 1 reaction sorry something went wrong copy link contributor progamergov commented nov 26 2022 edited i just noticed that the vram wasn t released after switching from the main 768 model back to a 1 5 model might be related all reactions sorry something went wrong copy link contributor author jaysmithwpg commented nov 26 2022 progamergov i suspect it s the same underlying problem and i m hoping this will fix it for you as jn jairo said this problem isn t specific to inpainting models it s anytime you use a model with a different yaml config file inpainting was just the most common case where that happened before v2 came out all reactions sorry something went wrong automatic1111 approved these changes nov 27 2022 view changes hide details view details automatic1111 merged commit 01f2ed6 into automatic1111 master nov 27 2022 1 check passed sign up for free to join this conversation on github already have an account sign in to comment reviewers automatic1111 assignees no one assigned labels none yet projects none yet milestone no milestone development successfully merging this pull request may close these issues none yet 4 participants add this suggestion to a batch that can be applied as a single commit this suggestion is invalid because no changes were made to the code suggestions cannot be applied while the pull request is closed suggestions cannot be applied while viewing a subset of changes only one suggestion per line can be applied in a batch add this suggestion to a batch that can be applied as a single commit applying suggestions on deleted lines is not supported you must change the existing code in this line in order to create a valid suggestion outdated suggestions cannot be applied this suggestion has been applied or marked resolved suggestions cannot be applied from pending reviews suggestions cannot be applied on multi line comments suggestions cannot be applied while the pull request is queued to merge footer 2022 github inc footer navigation terms privacy security status docs contact github pricing api training blog about you can t perform that action at this time you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session
Thumbnail images (randomly selected): * Images may be subject to copyright.GREEN status (no comments)
  • loading
  • JaySmithWpg
  • @JaySmithWpg
  • @JaySmithWpg
  • @JaySmithWpg
  • @jn-jairo
  • @JaySmithWpg
  • @ProGamerGov
  • AUTOMATIC1111
  • @AUTOMATIC1111
  • @AUTOMATIC1111
  • @JaySmithWpg
  • @jn-jairo
  • @ProGamerGov
  • @AUTOMATIC1111

Verified site has: 69 subpage(s). Do you want to verify them? Verify pages:

1-5 6-10 11-15 16-20 21-25 26-30 31-35 36-40 41-45 46-50
51-55 56-60 61-65 66-69


The site also has references to the 2 subdomain(s)

  archive.org  Verify   help.archive.org  Verify


Top 50 hastags from of all verified websites.

Supplementary Information (add-on for SEO geeks)*- See more on header.verify-www.com

Header

HTTP/1.1 302 FOUND
Server nginx
Date Thu, 01 Oct 2026 06:49:06 GMT
Content-Type text/plain; charset=utf-8
Content-Length 0
Connection close
x-archive-redirect-reason found capture at 20221130171234
location htt???/web.archive.org/web/20221130171234/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065
server-timing captures_list;dur=0.442791, exclusion.robots;dur=0.047339, exclusion.robots.policy;dur=0.039710, esindex;dur=0.006595, cdx.remote;dur=13.414958, LoadShardBlock;dur=321.236617, PetaboxLoader3.resolve;dur=137.098162, PetaboxLoader3.datanode;dur=82.034310
x-app-server wwwb-app219-dc8
x-ts 302
x-tr 355
server-timing TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie wb-p-SERVER=wwwb-app219; path=/
X-location All
X-AS 16276
X-RL 0
X-NA 0
X-Page-Cache MISS
Server-Timing MISS
X-NID OVH SAS
Referrer-Policy no-referrer-when-downgrade
Permissions-Policy interest-cohort=()
X-sd 0
HTTP/1.1 200 OK
Server nginx
Date Thu, 01 Oct 2026 06:49:11 GMT
Content-Type text/html; charset=utf-8
Transfer-Encoding chunked
Connection close
x-archive-orig-server GitHub.com
x-archive-orig-date Wed, 30 Nov 2022 17:12:35 GMT
x-archive-orig-cache-control no-cache
x-archive-orig-content-security-policy default-src none ; base-uri self ; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src self uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com wss://*.actions.githubusercontent.com online.visualstudio.com/api/v1/locations github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action self github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors none ; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src self data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/ opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src self ; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/; script-src github.githubassets.com; style-src unsafe-inline github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
x-archive-orig-referrer-policy no-referrer-when-downgrade
x-archive-orig-server-timing pull_request_layout-fragment;desc= pull_request_layout fragment ;dur=313.338527,conversation_content-fragment;desc= conversation_content fragment ;dur=845.383383,conversation_sidebar-fragment;desc= conversation_sidebar fragment ;dur=229.787184,nginx;desc= NGINX ;dur=1.102151,glb;desc= GLB ;dur=16.131246
x-archive-orig-strict-transport-security max-age=31536000; includeSubdomains; preload
x-archive-orig-vary X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
x-archive-orig-x-content-type-options nosniff
x-archive-orig-x-frame-options deny
x-archive-orig-x-pjax-url htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065
x-archive-orig-x-voltron-version cc85742
x-archive-orig-x-xss-protection 0
x-archive-orig-set-cookie _gh_sess=CZa%2BH6%2BDhLkn7RoxTN3oLmfLqDLr2IT0sqd7fWjZNc5lxanZtBgvwHxB%2FradqsQAycvpnmgZ%2Fc4HtFR8DtKm3W9HEdXkme1nfmrTzvphl5NAl1CHzpi7aeuXiJwUaLXT45Xl6qTR4OEVYx5g84V1%2FQQ6vvWjR%2FLgIVBzRdo0PlfKc7DBVKyBzFYdp8iUE4oejFpDmAK9m748215r75H92pUvkeC1QeI4Zoig3di%2ByDAiI%2Bdewr1rvX3WhMLtM8BEVtOzA4y3JH14Zv3YAkzdlw%3D%3D--mf3rM2y6cgt79Ggx--i%2F9wJbm1O%2B2c%2BFtVDGqDCw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
x-archive-orig-set-cookie _octo=GH1.1.1466700053.1669828354; Path=/; Domain=github.com; Expires=Thu, 30 Nov 2023 17:12:34 GMT; Secure; SameSite=Lax
x-archive-orig-set-cookie logged_in=no; Path=/; Domain=github.com; Expires=Thu, 30 Nov 2023 17:12:34 GMT; HttpOnly; Secure; SameSite=Lax
x-archive-orig-accept-ranges bytes
x-archive-orig-transfer-encoding chunked
x-archive-orig-x-github-request-id B18C:7B62:32E2B54:4C3E1A9:63878F02
x-archive-orig-connection close
x-archive-guessed-content-type text/html
x-archive-guessed-charset utf-8
x-archive-orig-content-encoding gzip
memento-datetime Wed, 30 Nov 2022 17:12:34 GMT
link <htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= original , <htt???/web.archive.org/web/timemap/link/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= timemap ; type= application/link-format , <htt???/web.archive.org/web/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= timegate , <htt???/web.archive.org/web/20221130171234/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= first memento ; datetime= Wed, 30 Nov 2022 17:12:34 GMT , <htt???/web.archive.org/web/20221130171234/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= memento ; datetime= Wed, 30 Nov 2022 17:12:34 GMT , <htt???/web.archive.org/web/20221130171234/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065>; rel= last memento ; datetime= Wed, 30 Nov 2022 17:12:34 GMT
content-security-policy default-src self unsafe-eval unsafe-inline data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src SPNOUTLINKS-20221130165652-crawl901/SPNOUTLINKS-20221130170515-00644.warc.gz
server-timing captures_list;dur=0.483405, exclusion.robots;dur=0.054478, exclusion.robots.policy;dur=0.044643, esindex;dur=0.006467, cdx.remote;dur=20.132527, LoadShardBlock;dur=194.096993, PetaboxLoader3.datanode;dur=1815.475988, PetaboxLoader3.resolve;dur=3043.510303, load_resource;dur=5052.083958, nav;dur=0.207683
x-app-server wwwb-app262-dc8
x-ts 200
x-tr 5420
server-timing TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie wb-p-SERVER=wwwb-app262; path=/
X-location All
X-AS 16276
X-RL 0
X-NA 0
X-Page-Cache MISS
Server-Timing MISS
X-NID OVH SAS
Referrer-Policy no-referrer-when-downgrade
Permissions-Policy interest-cohort=()
X-sd 0
Content-Encoding gzip

Meta Tags

title="#3449 - VRAM leak when switching to/from inpainting checkpoint by JaySmithWpg · Pull Request #5065 · AUTOMATIC1111/stable-diffusion-webui · GitHub"
charset="utf-8"
name="optimizely-datafile" content='{"groups": [], "environmentKey": "production", "rollouts": [], "typedAudiences": [], "projectId": "16737760170", "variables": [], "featureFlags": [], "experiments": [], "version": "4", "audiences": [{"conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", "id": "$opt_dummy_audience", "name": "Optimizely-Generated Audience for Backwards Compatibility"}], "anonymizeIP": true, "sdkKey": "WTc6awnGuYDdG98CYRban", "attributes": [{"id": "16822470375", "key": "user_id"}, {"id": "17143601254", "key": "spammy"}, {"id": "18175660309", "key": "organization_plan"}, {"id": "18813001570", "key": "is_logged_in"}, {"id": "19073851829", "key": "geo"}, {"id": "20175462351", "key": "requestedCurrency"}, {"id": "20785470195", "key": "country_code"}, {"id": "21656311196", "key": "opened_downgrade_dialog"}], "botFiltering": false, "accountId": "16737760170", "events": [{"experimentIds": [], "id": "17911811441", "key": "hydro_click.dashboard.teacher_toolbox_cta"}, {"experimentIds": [], "id": "18124116703", "key": "submit.organizations.complete_sign_up"}, {"experimentIds": [], "id": "18145892387", "key": "no_metric.tracked_outside_of_optimizely"}, {"experimentIds": [], "id": "18178755568", "key": "click.org_onboarding_checklist.add_repo"}, {"experimentIds": [], "id": "18180553241", "key": "submit.repository_imports.create"}, {"experimentIds": [], "id": "18186103728", "key": "click.help.learn_more_about_repository_creation"}, {"experimentIds": [], "id": "18188530140", "key": "test_event"}, {"experimentIds": [], "id": "18191963644", "key": "click.empty_org_repo_cta.transfer_repository"}, {"experimentIds": [], "id": "18195612788", "key": "click.empty_org_repo_cta.import_repository"}, {"experimentIds": [], "id": "18210945499", "key": "click.org_onboarding_checklist.invite_members"}, {"experimentIds": [], "id": "18211063248", "key": "click.empty_org_repo_cta.create_repository"}, {"experimentIds": [], "id": "18215721889", "key": "click.org_onboarding_checklist.update_profile"}, {"experimentIds": [], "id": "18224360785", "key": "click.org_onboarding_checklist.dismiss"}, {"experimentIds": [], "id": "18234832286", "key": "submit.organization_activation.complete"}, {"experimentIds": [], "id": "18252392383", "key": "submit.org_repository.create"}, {"experimentIds": [], "id": "18257551537", "key": "submit.org_member_invitation.create"}, {"experimentIds": [], "id": "18259522260", "key": "submit.organization_profile.update"}, {"experimentIds": [], "id": "18564603625", "key": "view.classroom_select_organization"}, {"experimentIds": [], "id": "18568612016", "key": "click.classroom_sign_in_click"}, {"experimentIds": [], "id": "18572592540", "key": "view.classroom_name"}, {"experimentIds": [], "id": "18574203855", "key": "click.classroom_create_organization"}, {"experimentIds": [], "id": "18582053415", "key": "click.classroom_select_organization"}, {"experime...
name="request-id" content="B18C:7B62:32E2B54:4C3E1A9:63878F02" data-pjax-transient="true"
name="html-safe-nonce" content="7abc4f98a6eb469bdc9118bb1be172503c1f27a15fe5e646a3586cb88081c40c" data-pjax-transient="true"
name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMThDOjdCNjI6MzJFMkI1NDo0QzNFMUE5OjYzODc4RjAyIiwidmlzaXRvcl9pZCI6IjYyOTk0Mjg3NjIzNDYyOTUwNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==" data-pjax-transient="true"
name="visitor-hmac" content="4df0b0ffe4fbd945bd4274297b0e6a3f1d9ce7df23533114ea6a91f8e560b41e" data-pjax-transient="true"
name="hovercard-subject-tag" content="pull_request:1136369401" data-turbo-transient
name="github-keyboard-shortcuts" content="repository,pull-request-list,pull-request-conversation,pull-request-files-changed" data-turbo-transient="true"
name="selected-link" value="repo_pulls" data-turbo-transient
name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"
name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"
name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"
name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"
name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"
name="octolytics-url" content="htt????/collector.github.com/github/collect"
name="analytics-location" content="/<user-name>/<repo-name>/voltron/pull_requests_fragments/pull_request_layout" data-turbo-transient="true"
name="user-login" content=""
name="viewport" content="width=device-width"
name="description" content="The Problem This PR addresses issue #3449: Switching between sd-v1-5-impainting and another checkpoint can result in a large amount of VRAM being consumed. Since the problem is in the TorchHijack class, this issue only occurs if you generate images with a batch size of at least 2 before switching checkpoints. The TorchHijack class is a global hijack that contains a reference to the sampler being used. Unfortunately, the sampler also contains a reference to the loaded checkpoint. Since this reference persists after image generation is complete, the checkpoint cannot be garbage collected. If shared.load_model is called when the program is in this state, it will attempt to load a second checkpoint with the previous checkpoint still in memory. The Solution Instead of keeping a reference to the entire sampler in TorchHijack, we only pass it the minimal amount of information it needs: a collection of sample noises. I've further optimized TorchHijack by replacing the use of a one-way iterator with a deque, so the sample noises can be garbage collected immediately after they're used. Steps to Reproduce With sd-v-1-5-impainting, use txt2img to generate images with a batch size of at least 2. Switch to a non-impainting checkpoint. Your VRAM is now mostly gone."
property="fb:app_id" content="1401488693436528"
name="apple-itunes-app" content="app-id=1477376905"
name="twitter:image:src" content="htt????/opengraph.githubassets.com/d28122e0c35c667eb7b6517bce340ffc81edc81cf2ad922ce4bfb74e833500dd/AUTOMATIC1111/stable-diffusion-webui/pull/5065"
name="twitter:site" content="@github"
name="twitter:card" content="summary_large_image"
name="twitter:title" content="#3449 - VRAM leak when switching to/from inpainting checkpoint by JaySmithWpg · Pull Request #5065 · AUTOMATIC1111/stable-diffusion-webui"
name="twitter:description" content="The Problem This PR addresses issue #3449: Switching between sd-v1-5-impainting and another checkpoint can result in a large amount of VRAM being consumed. Since the problem is in the TorchHijack c..."
property="og:image" content="htt???/web.archive.org/web/20221130171234im_/htt????/opengraph.githubassets.com/d28122e0c35c667eb7b6517bce340ffc81edc81cf2ad922ce4bfb74e833500dd/AUTOMATIC1111/stable-diffusion-webui/pull/5065"
property="og:image:alt" content="The Problem This PR addresses issue #3449: Switching between sd-v1-5-impainting and another checkpoint can result in a large amount of VRAM being consumed. Since the problem is in the TorchHijack c..."
property="og:image:width" content="1200"
property="og:image:height" content="600"
property="og:site_name" content="GitHub"
property="og:type" content="object"
property="og:title" content="#3449 - VRAM leak when switching to/from inpainting checkpoint by JaySmithWpg · Pull Request #5065 · AUTOMATIC1111/stable-diffusion-webui"
property="og:url" content="htt???/web.archive.org/web/20221130171234/htt????/github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5065"
property="og:description" content="The Problem This PR addresses issue #3449: Switching between sd-v1-5-impainting and another checkpoint can result in a large amount of VRAM being consumed. Since the problem is in the TorchHijack c..."
name="hostname" content="github.com"
name="expected-hostname" content="github.com"
name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS,STRICT_DEFERRED_DIFF_LINES_CHECKS"
http-equiv="x-pjax-version" content="51fd0a23ff77474139178e43e97bea7c758ff9526c2ad6587114fc663b93212d" data-turbo-track="reload"
http-equiv="x-pjax-csp-version" content="40aca5a152a13213a876f7628c466cd600db12fb858cdddccc3f1cc387eb7dad" data-turbo-track="reload"
http-equiv="x-pjax-css-version" content="111c0430ec29002910a2ce4e8da0d35872939d8ec2547342bf67a5873c945e90" data-turbo-track="reload"
http-equiv="x-pjax-js-version" content="668ca96d19ce97582c185e58eb30df99c45e00794b756fbf32b3d4123b235cc4" data-turbo-track="reload"
name="turbo-cache-control" content="no-preview" data-turbo-transient=""
name="voltron-timing" value="848"
name="go-import" content="github.com/AUTOMATIC1111/stable-diffusion-webui git htt????/github.com/AUTOMATIC1111/stable-diffusion-webui.git"
name="octolytics-dimension-user_id" content="20920490"
name="octolytics-dimension-user_login" content="AUTOMATIC1111"
name="octolytics-dimension-repository_id" content="527591471"
name="octolytics-dimension-repository_nwo" content="AUTOMATIC1111/stable-diffusion-webui"
name="octolytics-dimension-repository_public" content="true"
name="octolytics-dimension-repository_is_fork" content="false"
name="octolytics-dimension-repository_network_root_id" content="527591471"
name="octolytics-dimension-repository_network_root_nwo" content="AUTOMATIC1111/stable-diffusion-webui"
name="turbo-body-classes" content="logged-out env-production page-responsive"
name="browser-stats-url" content="htt????/api.github.com/_private/browser/stats"
name="browser-errors-url" content="htt????/api.github.com/_private/browser/errors"
name="browser-optimizely-client-errors-url" content="htt????/api.github.com/_private/browser/optimizely_client/errors"
name="theme-color" content="#1e2327"
name="color-scheme" content="light dark"

Load Info

page size56399
load time (s)6.676114
redirect count1
speed download8448
server IP 207.241.237.3
* all occurrences of the string "http://" have been changed to "htt???/"