| 261 | return x |
| 262 | |
| 263 | class SamplerDistanceBase: |
| 264 | _DISTANCE_OPTIONS = None # All options by default. |
| 265 | _DISTANCE_PARAMS = { |
| 266 | "resample": ("INT", { |
| 267 | "default": 3, "min": -1, "max": 32, "step": 1, |
| 268 | "tooltip": "0 all along gives Euler. 1 gives Heun.\nAnything starting from 2 will use the distance method.\n-1 will do remaining steps + 1 as the resample value. This can be pretty slow.", |
| 269 | }), |
| 270 | "resample_end": ("INT", { |
| 271 | "default": -1, "min": -1, "max": 32, "step": 1, |
| 272 | "tooltip": "How many resamples for the end. -1 means constant.", |
| 273 | }), |
| 274 | "cfgpp": ("BOOLEAN", { |
| 275 | "default": True, |
| 276 | "tooltip": "Controls whether to use CFG++ sampling. When enabled, you should set CFG to a fairly low value.", |
| 277 | }), |
| 278 | "eta": ("FLOAT", { |
| 279 | "default": 0.0, "min": 0.0, "max": 32.0, "step": 0.01, |
| 280 | "tooltip": "Controls the ancestralness of the main sampler steps. 0.0 means to use non-ancestral sampling. Note: May not work well with some of the other options.", |
| 281 | }), |
| 282 | "s_noise": ("FLOAT", { |
| 283 | "default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, |
| 284 | "tooltip": "Scale factor for ancestral noise added during sampling. Generally should be left at 1.0 and only has an effect when ancestral sampling is used.", |
| 285 | }), |
| 286 | "distance_step_eta": ("FLOAT", { |
| 287 | "default": 0.0, "min": 0.0, "max": 32.0, "step": 0.01, |
| 288 | "tooltip": "Experimental option that allows using ancestral sampling for the internal distance steps. When used, should generally be a fairly low value such as 0.25. 0.0 means to use non-ancestral sampling for the internal distance steps.", |
| 289 | }), |
| 290 | "distance_step_s_noise": ("FLOAT", { |
| 291 | "default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, |
| 292 | "tooltip": "Scale factor for ancestral noise added in the internal distance steps. Generally should be left at 1.0 and only has an effect when distance_step_eta is non-zero.", |
| 293 | }), |
| 294 | "use_softmax": ("BOOLEAN", { |
| 295 | "default": False, |
| 296 | "tooltip": "Rather than using a min/max normalization and an exponent will use a softmax instead.", |
| 297 | }), |
| 298 | "use_slerp": ("BOOLEAN", { |
| 299 | "default": False, |
| 300 | "tooltip": "Will SLERP the predictions instead of doing a weighted average. The difference is more obvious when using use_negative.", |
| 301 | }), |
| 302 | "perp_step": ("BOOLEAN", { |
| 303 | "default": False, |
| 304 | "tooltip": "Experimental, not yet recommended.", |
| 305 | }), |
| 306 | "use_negative": ("BOOLEAN", { |
| 307 | "default": False, |
| 308 | "tooltip": "Will use the negative prediction to prepare the distance scores. This tends to give images with less errors from my testing.", |
| 309 | }), |
| 310 | "smooth": ("BOOLEAN", { |
| 311 | "default": False, |
| 312 | "tooltip": "Not recommended, will make everything brighter. Not smoother.", |
| 313 | }), |
| 314 | "sharpen": ("BOOLEAN", { |
| 315 | "default": False, |
| 316 | "tooltip": "Not recommended, attempts to sharpen the results but instead tends to make things fuzzy.", |
| 317 | }), |
| 318 | "distance_first": ("INT", { |
| 319 | "default": 0, "min": -10000, "max": 10000, "step": 1, |
| 320 | "tooltip": "First step to use distance sampling. You can use negative values to count from the end. Note: Steps are zero-based.", |
nothing calls this directly
no outgoing calls
no test coverage detected