mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-09-30 18:08:29 -05:00
feat: optimize cfg special cases with guidance schdeule (#2033)
This commit is contained in:
@@ -275,6 +275,26 @@ namespace sd_sample {
|
||||
}
|
||||
}
|
||||
|
||||
void SampleStepCacheDispatcher::invalidate_condition(const void* condition) {
|
||||
if (condition == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (runtime.mode) {
|
||||
case SampleCacheMode::EASYCACHE:
|
||||
runtime.easycache.cache_diffs.erase(condition);
|
||||
break;
|
||||
case SampleCacheMode::UCACHE:
|
||||
runtime.ucache.cache_diffs.erase(condition);
|
||||
break;
|
||||
case SampleCacheMode::CACHEDIT:
|
||||
runtime.cachedit.cache_diffs.erase(condition);
|
||||
break;
|
||||
case SampleCacheMode::NONE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SampleStepCacheDispatcher::is_step_skipped() const {
|
||||
switch (runtime.mode) {
|
||||
case SampleCacheMode::EASYCACHE:
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace sd_sample {
|
||||
|
||||
bool before_condition(const void* condition, const sd::Tensor<float>& input, sd::Tensor<float>* output);
|
||||
void after_condition(const void* condition, const sd::Tensor<float>& input, const sd::Tensor<float>& output);
|
||||
void invalidate_condition(const void* condition);
|
||||
bool is_step_skipped() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user