Get model's StableDiffusionVersion.
(model: ModelPatcher)
| 352 | |
| 353 | |
| 354 | def get_model_sd_version(model: ModelPatcher) -> StableDiffusionVersion: |
| 355 | """Get model's StableDiffusionVersion.""" |
| 356 | base: comfy.model_base.BaseModel = model.model |
| 357 | model_config: comfy.supported_models.supported_models_base.BASE = base.model_config |
| 358 | if isinstance(model_config, comfy.supported_models.SDXL): |
| 359 | return StableDiffusionVersion.SDXL |
| 360 | elif isinstance( |
| 361 | model_config, (comfy.supported_models.SD15, comfy.supported_models.SD20) |
| 362 | ): |
| 363 | # SD15 and SD20 are compatible with each other. |
| 364 | return StableDiffusionVersion.SD1x |
| 365 | else: |
| 366 | raise Exception(f"Unsupported SD Version: {type(model_config)}.") |
| 367 | |
| 368 | |
| 369 | class LayeredDiffusionFG: |
no outgoing calls
no test coverage detected