api update default sampler

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-06-28 09:36:33 -04:00
parent 69f71cc32a
commit 7fbac675fe
5 changed files with 7 additions and 6 deletions
+1
View File
@@ -55,6 +55,7 @@
- **API**
- Add `/sdapi/v1/lora?lora=<lora_name>` endpoint that returns full lora info and metadata
- Add `/sdapi/v1/controlnets?model_type=<model_type|all|None>` endpoints that returns list of available controlnets for specific model type
- Set default sampler to `Default`
- **Fixes**
- IPEX with DPM2++ FlowMatch samplers
- Invalid attention processor with ControlNet
+1 -1
View File
@@ -22,7 +22,7 @@ ReqControl = models.create_model_from_signature(
func = run.control_run,
model_name = "StableDiffusionProcessingControl",
additional_fields = [
{"key": "sampler_name", "type": str, "default": "UniPC"},
{"key": "sampler_name", "type": str, "default": "Default"},
{"key": "script_name", "type": Optional[str], "default": None},
{"key": "script_args", "type": list, "default": []},
{"key": "send_images", "type": bool, "default": True},
+1 -1
View File
@@ -198,7 +198,7 @@ ReqTxt2Img = PydanticModelGenerator(
StableDiffusionProcessingTxt2Img,
[
{"key": "sampler_index", "type": Union[int, str], "default": 0},
{"key": "sampler_name", "type": str, "default": "UniPC"},
{"key": "sampler_name", "type": str, "default": "Default"},
{"key": "hr_sampler_name", "type": str, "default": "Same as primary"},
{"key": "script_name", "type": Optional[str], "default": "none"},
{"key": "script_args", "type": list, "default": []},
+2 -2
View File
@@ -463,8 +463,8 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
if all_subseeds is not None:
self.all_subseeds = all_subseeds
if self.sampler_name == "PLMS":
self.sampler_name = 'UniPC'
if self.sampler_name == 'PLMS':
self.sampler_name = 'Default'
if not shared.native:
self.sampler = sd_samplers.create_sampler(self.sampler_name, self.sd_model)
if hasattr(self.sampler, "initialize"):
+2 -2
View File
@@ -97,10 +97,10 @@ def get_sampler_name(sampler_index: int, img: bool = False) -> str:
if len(sd_samplers.samplers) > sampler_index:
sampler_name = sd_samplers.samplers[sampler_index].name
else:
sampler_name = "UniPC"
sampler_name = "Default"
shared.log.warning(f'Sampler not found: index={sampler_index} available={[s.name for s in sd_samplers.samplers]} fallback={sampler_name}')
if img and sampler_name == "PLMS":
sampler_name = "UniPC"
sampler_name = "Default"
shared.log.warning(f'Sampler not compatible: name=PLMS fallback={sampler_name}')
return sampler_name