Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

StableDiffusionCppResource

Handle
📦 CommunityToolkit.Aspire.Hosting.StableDiffusionCpp v13.6.1

Represents a stable-diffusion.cpp HTTP server container.

type StableDiffusionCppResource interface {
ExpressionValue
IComputeResource
Resource
ResourceWithArgs
ResourceWithConnectionString
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the ConnectionStringExpression property
ConnectionStringExpression() *ReferenceExpression
propertyImageVariantStableDiffusionCppImageVariantget
Gets the selected official container image variant.
ImageVariant() (StableDiffusionCppImageVariant, error)
propertyModelStableDiffusionCppModelResourceget · set
Gets the configured Hugging Face model.
Model() StableDiffusionCppModelResource
SetModel(value StableDiffusionCppModelResource) StableDiffusionCppResource
propertyPrimaryEndpointEndpointReferenceget
Gets the primary HTTP endpoint.
PrimaryEndpoint() EndpointReference
propertyUriExpression*ReferenceExpressionget
Gets the HTTP server URI.
UriExpression() *ReferenceExpression

Methods

methodAddHuggingFaceModelbuilder
Adds a Hugging Face model that is downloaded before the container starts.
AddHuggingFaceModel(
repository string,
fileName string,
options ...*AddHuggingFaceModelOptions,
) StableDiffusionCppModelResource
repositorystringThe Hugging Face repository identifier.
fileNamestringThe model file path within the repository.
options...*AddHuggingFaceModelOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddHuggingFaceModelOptions argument.

Revision*stringThe repository revision. Defaults to main.
StableDiffusionCppModelResource

A builder for the child model resource.

Returns a handle; failures surface later via Err().

Adds a named Hugging Face model that is downloaded before the container starts.
AddNamedHuggingFaceModel(
name string,
repository string,
fileName string,
options ...*AddNamedHuggingFaceModelOptions,
) StableDiffusionCppModelResource
namestringThe child model resource name.
repositorystringThe Hugging Face repository identifier.
fileNamestringThe model file path within the repository.
options...*AddNamedHuggingFaceModelOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddNamedHuggingFaceModelOptions argument.

Revision*stringThe repository revision. Defaults to main.
StableDiffusionCppModelResource

A builder for the child model resource.

Returns a handle; failures surface later via Err().

methodWithGPUSupportbuilder
Adds the container runtime arguments required by the selected GPU backend.
WithGPUSupport() StableDiffusionCppResource
StableDiffusionCppResource

The resource builder.

Returns a handle; failures surface later via Err().

Supplies a Hugging Face access token for gated or private repositories.
WithHuggingFaceToken(token ParameterResource) StableDiffusionCppResource
tokenParameterResourceA secret parameter containing the Hugging Face token.
StableDiffusionCppResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithVaeTilingbuilder
Processes VAE images in tiles to reduce peak memory usage during image decoding.
WithVaeTiling() StableDiffusionCppResource
StableDiffusionCppResource

The resource builder.

Returns a handle; failures surface later via Err().