mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 11:26:34 +00:00
feat(server): add recipe constraints and update generation workspace (#2217)
This commit is contained in:
1 parent
012c7f8866
commit
e41fbcf455
88 files changed
+339
-24
No files matched your search
@@ -185,7 +185,7 @@ namespace MOSSImage {
|
||||
ggml_build_forward_expand(ctx->graph, parts[i]);
|
||||
}
|
||||
}
|
||||
x = ggml_concat(c, x, text, 1);
|
||||
x = ggml_concat(c, x, text, 1);
|
||||
for (int64_t i = 0; i < config.depth; ++i) {
|
||||
if (std::find(skip.begin(), skip.end(), i) == skip.end()) {
|
||||
x = std::dynamic_pointer_cast<Block>(blocks["layers." + std::to_string(i)])->forward(ctx, x, pe, parts);
|
||||
|
||||
@@ -314,8 +314,8 @@ namespace sd::pipeline {
|
||||
}
|
||||
|
||||
bool skip_vae_encoding = (sd->version == VERSION_HIDREAM_O1) || !(
|
||||
ref_image_params.pass_to_dit || ref_image_params.vlm_use_vae_input ||
|
||||
sd_version_is_unet_edit(sd->version) || sd_version_is_pid(sd->version));
|
||||
ref_image_params.pass_to_dit || ref_image_params.vlm_use_vae_input ||
|
||||
sd_version_is_unet_edit(sd->version) || sd_version_is_pid(sd->version));
|
||||
|
||||
std::vector<sd::Tensor<float>> ref_latents;
|
||||
for (size_t i = 0; i < ref_images.size(); i++) {
|
||||
|
||||
@@ -379,8 +379,13 @@ namespace sd {
|
||||
if (target == ImageTarget::Mask && has_init_transform_) {
|
||||
auto options = resolve_options(target, index);
|
||||
if (image.width != init_transform_.source_width || image.height != init_transform_.source_height) {
|
||||
fail("mask and init source dimensions must match");
|
||||
return {};
|
||||
ImagePreprocessor alignment;
|
||||
tensor = alignment.apply_geometry(tensor, target, index, init_transform_.source_width, init_transform_.source_height,
|
||||
ImageResizeMode::CropResize, ops::InterpolateMode::NearestExact);
|
||||
if (tensor.empty()) {
|
||||
fail("could not align mask to init source dimensions");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
bool geometry_override = options.count("width") || options.count("anchor") ||
|
||||
(options.count("mode") && options.at("mode") != "auto");
|
||||
|
||||
Reference in new issue
Block a user