TextToImageRequestBody class final

Constructors

TextToImageRequestBody.new({int height = 512, int width = 512, List<TextPrompt> textPrompts = const [], num cfgScale = 7, ClipGuidancePreset? clipGuidancePreset, Sampler? sampler, int samples = 1, int seed = 0, int steps = 50, StylePreset? stylePreset, Object? extras})
Returns a new TextToImageRequestBody instance.

Properties

cfgScale num
How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt)
getter/setter pair
clipGuidancePreset ClipGuidancePreset?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
extras Object?
Extra parameters passed to the engine. These parameters are used for in-development or experimental features and may change without warning, so please use with caution.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
height int
Height of the image in pixels. Must be in increments of 64 and pass the following validation: - For 768 engines: 589,824 height * width 1,048,576 - All other engines: 262,144 height * width 1,048,576
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampler Sampler?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
samples int
Number of images to generate
getter/setter pair
seed int
Random noise seed (omit this option or use 0 for a random seed)
getter/setter pair
steps int
Number of diffusion steps to run
getter/setter pair
stylePreset StylePreset?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
textPrompts List<TextPrompt>
An array of text prompts to use for generation. Given a text prompt with the text A lighthouse on a cliff and a weight of 0.5, it would be represented as:
getter/setter pair
width int
Width of the image in pixels. Must be in increments of 64 and pass the following validation: - For 768 engines: 589,824 height * width 1,048,576 - All other engines: 262,144 height * width 1,048,576
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(dynamic value) TextToImageRequestBody?
Returns a new TextToImageRequestBody instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) List<TextToImageRequestBody>
mapFromJson(dynamic json) Map<String, TextToImageRequestBody>
mapListFromJson(dynamic json, {bool growable = false}) Map<String, List<TextToImageRequestBody>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.