SUMMARY Memory leak in KRITA NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** STEPS TO REPRODUCE 1. Run KRITA 2. Create New Document 512x512 3. I click on the "Configure" button in the ConfyUI plugin window to access the configuration. 4. I don't click anything in this configuration, just observe the memory growth in Process Hacker. I see that the RAM is being filled at intervals of 2-15 seconds on the krita.exe process. CONFYUI itself is not yet running. The memory is not filling up much, approximately 0.10MB. I close the canvas completely and exit the configuration. The memory does not fill up, but it doesn't get released either. Moving on... I create a new canvas again and launch ConfyUI, connect through Connect, and set the Generation mode to LIVE. I press the Start button to initiate the generation process in Live mode. Memory does not leak until the ready result appears (a white image). The white image is because I didn't draw anything, just started Live. At this stage, when the image appears, the memory increases slightly and stops at 445.5MB. No questions so far. Moving on... I make the first stroke with a black color using a regular brush: 465MB. I make the second stroke with a black color using a regular brush: 471MB. Wait for 20 seconds: 481MB. Increase the Strength from 30% to 90%: 488MB, 491MB, 492MB... Wait for 1 minute: 511MB. Try to take the image from ConfyUI and transfer it to the CANVAS: 539MB, 570MB, 581MB. I noticed that after taking the image by pressing the "Copy the current result to the image as a new layer you want to see, or leave empty" button, the memory started leaking rapidly. At the moment, 764MB, although no Krita operations are currently being performed. 30 seconds after: 852MB. 870MB... Try using this button 10 more times: 1GB. Now I will try to terminate ConfyUI and disconnect it from KRITA by stopping and closing the canvas completely: 1.11GB. The leak has stopped, but the memory has not been freed. Now I will try to repeat the same procedures, only close the canvas but not close ConfyUI. 1.37GB. Now I close the canvas but do not close CONFYUI and leave the program for 5 minutes: 1.37GB. Conclusion: The leak only occurs when the canvas is open - very weakly and tolerably. The leak occurs when working with ConfyUI, specifically, it is strongly pronounced with "Strength around 60-100%" and pressing the "Copy the current result to the image as a new layer you want to see, or leave empty" button. Memory is not cleared but preserved in KRITA until the program is completely closed, for example, when memory is overloaded and the process crashes. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: 10 macOS: - Linux/KDE Plasma: - (available in About System) KDE Plasma Version: I'm not aware of the version, but it's possibly the latest one; I downloaded the program on March 9, 2024. KDE Frameworks Version: I'm not aware of the version, but it's possibly the latest one; I downloaded the program on March 9, 2024. Qt Version: I'm not aware of the version, but it's possibly the latest one; I downloaded the program on March 9, 2024. ADDITIONAL INFORMATION The version of ConfyUI is the latest one available at the time of submitting this report. No extra nodes are installed, only those required by KRITA with the "Generative AI for Krita" plugin.
I also want to point out that KRITA inefficiently utilizes the power of the Graphics Card. In Live Mode, it constantly generates the image even if there are no changes to the image. ConfyUI has a feature for Live generation, but there is also an option called "change," which indicates that generation should only start when there are any changes in the project. In other words, if ConfyUI detects that no changes have occurred in the project, it simply reproduces the cached result. For KRITA, I recommend implementing a similar setting and activating Live mode generation only when there are any changes on the canvas.
Can you reproduce the leak without ComfyUI ? If not, maybe it is better to report to the ComfyUI dev here: https://github.com/comfyanonymous/ComfyUI/issues
(In reply to David REVOY from comment #2) > Можете ли вы воспроизвести утечку без ComfyUI? > Если нет, возможно, лучше сообщить об этом разработчику ComfyUI здесь: > https://github.com/comfyanonymous/ComfyUI/issues (In reply to David REVOY from comment #2) > Can you reproduce the leak without ComfyUI ? > If not, maybe it is better to report to the ComfyUI dev here: > https://github.com/comfyanonymous/ComfyUI/issues Hello! This critical memory leak seems to occur only with ConfyUI, based on my experience. However, even if I need to write to the ConfyUI developer, what should I do about the memory that is not being released from the program? The leak appears to be on the side of the Krita.exe process, not Python.exe. I'm sorry if I'm asking, I'm not familiar with this.
The plugin is not official and if there is no memory leak with Krita without the plugin then it is not a Krita issue. Can you reproduce this with other similar plugins. PLease report bugs to the plugin maker
(In reply to Raghavendra kamath from comment #4) > The plugin is not official and if there is no memory leak with Krita without > the plugin then it is not a Krita issue. Can you reproduce this with other > similar plugins. PLease report bugs to the plugin maker I reported it, but considering that there are 1200 other issues besides mine, I don't think the problem will be addressed in the near future. However, if you are acquainted with the ConfyUI developer, I would appreciate it if you could inform them about this, as I haven't found a better solution than using ConfyUI+Paint for now. Topic: [link to the GitHub issue] (https://github.com/comfyanonymous/ComfyUI/issues/3006)
Hi, all! I'm afraid Krita developers have no responsibility for the bugs in ConfyUI plugin. The plugin is developed by a separate team, please report this bug to them. We do not provide any maintenance for external plugins.