DiffusionCapabilities constructor

DiffusionCapabilities({
  1. Iterable<DiffusionModelVariant>? supportedVariants,
  2. Iterable<DiffusionScheduler>? supportedSchedulers,
  3. int? maxResolutionPx,
  4. Iterable<DiffusionMode>? supportedModes,
  5. int? maxWidthPx,
  6. int? maxHeightPx,
  7. bool? supportsIntermediateImages,
  8. bool? supportsSafetyChecker,
  9. bool? isReady,
  10. String? currentModel,
  11. bool? safetyCheckerEnabled,
  12. bool? supportsBatchGeneration,
  13. Iterable<String>? supportedOutputMediaTypes,
})

Implementation

factory DiffusionCapabilities({
  $core.Iterable<DiffusionModelVariant>? supportedVariants,
  $core.Iterable<DiffusionScheduler>? supportedSchedulers,
  $core.int? maxResolutionPx,
  $core.Iterable<DiffusionMode>? supportedModes,
  $core.int? maxWidthPx,
  $core.int? maxHeightPx,
  $core.bool? supportsIntermediateImages,
  $core.bool? supportsSafetyChecker,
  $core.bool? isReady,
  $core.String? currentModel,
  $core.bool? safetyCheckerEnabled,
  $core.bool? supportsBatchGeneration,
  $core.Iterable<$core.String>? supportedOutputMediaTypes,
}) {
  final result = create();
  if (supportedVariants != null)
    result.supportedVariants.addAll(supportedVariants);
  if (supportedSchedulers != null)
    result.supportedSchedulers.addAll(supportedSchedulers);
  if (maxResolutionPx != null) result.maxResolutionPx = maxResolutionPx;
  if (supportedModes != null) result.supportedModes.addAll(supportedModes);
  if (maxWidthPx != null) result.maxWidthPx = maxWidthPx;
  if (maxHeightPx != null) result.maxHeightPx = maxHeightPx;
  if (supportsIntermediateImages != null)
    result.supportsIntermediateImages = supportsIntermediateImages;
  if (supportsSafetyChecker != null)
    result.supportsSafetyChecker = supportsSafetyChecker;
  if (isReady != null) result.isReady = isReady;
  if (currentModel != null) result.currentModel = currentModel;
  if (safetyCheckerEnabled != null)
    result.safetyCheckerEnabled = safetyCheckerEnabled;
  if (supportsBatchGeneration != null)
    result.supportsBatchGeneration = supportsBatchGeneration;
  if (supportedOutputMediaTypes != null)
    result.supportedOutputMediaTypes.addAll(supportedOutputMediaTypes);
  return result;
}