feat: support stream cmd and lowvram options#157
feat: support stream cmd and lowvram options#157Cyberhan123 wants to merge 9 commits intoleejet:masterfrom
Conversation
|
There are two IndentCaseLabels in the current .clang-format. I try to set them to true or false, but they will format the code that I have not modified. 😳 |
|
Its hard to review with 90% formatting changes. |
I don’t know much about the formatting method of C++. I used the script in the project to restore it, but with little success. I plan to adjust it manually tomorrow. |
| for (int i = 0; i < params.batch_count; i++) { | ||
| if (results[i].data == NULL) { | ||
| continue; | ||
| auto instance = new CliInstance(params); |
There was a problem hiding this comment.
dont allocate on the heap. (you should never use new/delete directly, when not absolutely necessary)
CliInstance instance{params};
There was a problem hiding this comment.
dont allocate on the heap. (you should never use new/delete directly, when not absolutely necessary)
CliInstance instance{params};
Hey, can you elaborate on why?
| results[i].data = NULL; | ||
| } | ||
| free(results); | ||
| free_sd_ctx(sd_ctx); |
There was a problem hiding this comment.
also, dont call exit(), so you can call all the cleanup functions after (free_sd_ctx(), free(), etc)
There was a problem hiding this comment.
I don’t quite understand what’s wrong with heap allocation. Does it affect performance?My understanding is declared destructor to release the memory automatically.
There was a problem hiding this comment.
only if freed manually using delete.
|
Thank you for your comment, I will adjust these issues. |
|
I removed the first IndentCaseLabels in the latest master branch, which should be a legacy configuration. I recommend that you use clang-format's command line tool to format your code for consistency. |
Thank you very much, I don't have time now. |
# Conflicts: # examples/cli/main.cpp # stable-diffusion.cpp # stable-diffusion.h # unet.hpp
This is the draft. Implementing this PR means that we can have greater expansion capabilities in the future, such as easier implementation of CLIP interrogators. At present, this PR has not been completed. I still need to test and complete the logic of the cli. Since the changes are relatively large, I thought I would release them for everyone to see.
cc @leejet @Green-Sky @FSSRepo