mirror of
https://github.com/vladmandic/automatic
synced 2026-08-26 15:16:01 +02:00
api update default sampler
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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": []},
|
||||
|
||||
@@ -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"):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user