Skip to content

Commit 9a89eee

Browse files
committed
sync main clean up code
1 parent fb34c23 commit 9a89eee

File tree

4 files changed

+45
-20
lines changed

4 files changed

+45
-20
lines changed

.idea/workspace.xml

Lines changed: 30 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ option(SD_AVX2 "sd: enable AVX2" ON)
2626
option(SD_AVX512 "sd: enable AVX512" OFF)
2727
option(SD_FMA "sd: enable FMA" ON)
2828

29-
30-
set(GGML_AVX512 OFF)
31-
set(GGML_AVX2 OFF)
32-
set(GGML_AVX OFF)
33-
3429
if (SD_AVX512)
3530
set(GGML_AVX512 ON)
3631
elseif (SD_AVX2)

cmake/sd.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.14)
44
include(add_FetchContent_MakeAvailable.cmake)
55
endif()
66

7-
set(SD_GIT_TAG 1ac4ad2ba21c7f1c96c061f452bde129522a85c1)
7+
set(SD_GIT_TAG 70d2919decdf8f5fcd4956d1da60594c9e7b03ac)
88
set(SD_GIT_URL https://github.com/Cyberhan123/stable-diffusion.cpp)
99
set(BUILD_SHARED_LIBS OFF)
1010

@@ -14,3 +14,7 @@ FetchContent_Declare(
1414
GIT_TAG ${SD_GIT_TAG}
1515
)
1616
FetchContent_MakeAvailable(sd)
17+
18+
set(GGML_AVX512 OFF)
19+
set(GGML_AVX2 OFF)
20+
set(GGML_AVX OFF)

stable-diffusion-abi.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,16 @@ const char* img2img(void* sd, const sd_img2img_options* opt) {
219219
if (it != SampleMethodMap.end()) {
220220
const auto s = static_cast<StableDiffusion *>(sd);
221221
const auto result = s->img2img(
222-
/* const std::vector<uint8_t>& init_img */ opt->init_img,
223-
/* const std::string &prompt */ std::string(opt->prompt),
224-
/* const std::string &negative_prompt */
225-
std::string(opt->negative_prompt),
226-
/* float cfg_scale */ opt->cfg_scale,
227-
/* int width */ opt->width,
228-
/* int height */ opt->height,
229-
/* SampleMethod sample_method */ it->second,
230-
/* int sample_steps */ opt->sample_steps,
231-
/* float strength */ opt->strength,
232-
/* int64_t seed */ opt->seed
222+
opt->init_img,
223+
std::string(opt->prompt),
224+
std::string(opt->negative_prompt),
225+
opt->cfg_scale,
226+
opt->width,
227+
opt->height,
228+
it->second,
229+
opt->sample_steps,
230+
opt->strength,
231+
opt->seed
233232
);
234233
const auto str = code::base64_encode<std::string, std::vector<uint8_t *>>(result, false);
235234
const auto buffer = new char[str.size()];

0 commit comments

Comments
 (0)