Enable WITH_LAYER_crop for NCNN for tiled VAE decode#29
Merged
nihui merged 1 commit intonihui:masterfrom Feb 14, 2026
Merged
Conversation
The program consistently segfaulted when attempting to run tiled VAE decode at the end of inference because it tried to copy_cut_border which tried to create_layer(LayerType::Crop) which returned NULL because layer_to_index did not find the type in the layer_registry which was defined by these build-time flags and - as we now see it - this required type is not even enabled at build time. This commit addresses that and the program flow now runs successfully. This may also reveal a broader lack of graceful error handling in this repo, for the failure to catch the null pointer before it is dereference, however that will not be detailed in the scope of this PR. I do not rule out the possibility of this setting being intentional and a better fix than this being available. There may also be other missing layer types that should be enabled and included in the registry but are not.
nihui
approved these changes
Feb 14, 2026
Owner
|
good catch! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
The program consistently segfaulted when attempting to run tiled VAE decode at the end of inference because it tried to copy_cut_border which tried to create_layer(LayerType::Crop) which returned NULL because layer_to_index did not find the type in the layer_registry which was defined by these build-time flags and - as we now see it - this required type is not even enabled at build time.
This commit addresses that and the program flow now runs successfully.
This may also reveal a broader lack of graceful error handling in this repo, for the failure to catch the null pointer before it is dereference, however that will not be detailed in the scope of this PR.
I do not rule out the possibility of this setting being intentional and a better fix than this being available.
There may also be other missing layer types that should be enabled and included in the registry but are not.
This resolves #28 .