model

package
v0.0.0-...-0e0034f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtBotLorasResponse

type ArtBotLorasResponse struct {
	SDResponse
	Loras []*model.Lora
}

type ArtBotModel

type ArtBotModel struct {
	Title     string `json:"title"`
	ModelName string `json:"model_name"`
	Hash      string `json:"hash"`
	FileName  string `json:"filename"`
	Config    string `json:"config"`
}

type ArtBotModelsResponse

type ArtBotModelsResponse struct {
	SDResponse
	Models []*ArtBotModel
}

type ArtBotSamplersResponse

type ArtBotSamplersResponse struct {
	SDResponse
	Samplers []*Sampler
}

type Image2Image

type Image2Image struct {
	InitImages        []string `json:"init_images,omitempty"`        // List of base64-encoded images to send as base/original
	ResizeMode        int      `json:"resize_mode,omitempty"`        // I don't know If I got it right or not. See: webui-api/img2img RESIZE_MODE helper package
	DenoisingStrength float64  `json:"denoising_strength,omitempty"` // Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image.
	ImageCFGScale     float64  `json:"image_cfg_scale"`
	Mask              string   `json:"mask,omitempty"`            // base64-encoded mask image. What to put inside the masked area before processing it with Stable Diffusion.
	MaskBlur          int      `json:"mask_blur,omitempty"`       // How much to blur the mask before processing, in pixels.
	InpaintingFill    int      `json:"inpainting_fill,omitempty"` // I don't know If I got it right or not. See: webui-api/img2img INPAINT_MASK_CONENT helper package

	// Upscale masked region to target resolution, do inpainting, downscale back and paste into original image
	//
	// Original field was `InpaintFullRes` but since the default value is `true`. it's quite tricky to do this in GO
	//
	//  So I decided to reverse it. This set to true and "inpaint_full_res": false and vice versa
	DoNotInpaintFullRes bool `json:"inpaint_full_res,omitempty"`

	InpaintFullResPadding  int            `json:"inpaint_full_res_padding,omitempty"` // Amount of pixels to take as sample around the inpaint areas
	InpaintingMaskInvert   int            `json:"inpainting_mask_invert,omitempty"`   // I don't know If I got it right or not. See: webui-api/img2img INPAINT_MODE helper package
	InitialNoiseMultiplier int            `json:"initial_noise_multiplier,omitempty"` // I don't even see this on the UI itself. Please, if you know, tell me about it.
	Prompt                 string         `json:"prompt,omitempty"`
	NegativePrompt         string         `json:"negative_prompt,omitempty"`
	Styles                 []string       `json:"styles,omitempty"`
	Seed                   int            `json:"seed,omitempty"` // A value that determines the output of random number generator - if you create an image with same parameters and seed as another image, you'll get the same result
	Subseed                int            `json:"subseed,omitempty"`
	SubseedStrength        int            `json:"subseed_strength,omitempty"`
	SeedResizeFromH        int            `json:"seed_resize_from_h,omitempty"`
	SeedResizeFromW        int            `json:"seed_resize_from_w,omitempty"`
	SamplerName            string         `json:"sampler_name,omitempty"`  // Either SamplerName or SamplerIndex will be used.
	SamplerIndex           string         `json:"sampler_index,omitempty"` // Either SamplerName or SamplerIndex will be used.
	BatchSize              int            `json:"batch_size,omitempty"`    // How many do you want to simultaneously generate.
	BatchCount             int            `json:"n_iter,omitempty"`        // How many times do you want to generate.
	Steps                  int            `json:"steps,omitempty"`         // How many times to improve the generated image iteratively; higher values take longer; very low values can produce bad results
	CFGScale               float64        `json:"cfg_scale,omitempty"`     // Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results
	Width                  int            `json:"width,omitempty"`
	Height                 int            `json:"height,omitempty"`
	RestoreFaces           bool           `json:"restore_faces,omitempty"`
	Tiling                 bool           `json:"tiling,omitempty"`
	DoNotSaveSamples       bool           `json:"do_not_save_samples,omitempty"`
	DoNotSaveGrid          bool           `json:"do_not_save_grid,omitempty"`
	Eta                    float64        `json:"eta,omitempty"`
	SChurn                 float64        `json:"s_churn,omitempty"`
	STmax                  float64        `json:"s_tmax,omitempty"`
	STmin                  float64        `json:"s_tmin,omitempty"`
	SNoise                 float64        `json:"s_noise,omitempty"`
	OverrideSettings       map[string]any `json:"override_settings,omitempty"`

	// Original field was `OverrideSettingsRestoreAfterwards` but since the default value is `true`. it's quite tricky to do this in GO
	//
	//  So I decided to reverse it. This set to true and "override_settings_restore_afterwards": false and vice versa
	DoNotOverrideSettingsRestoreAfterwards bool `json:"override_settings_restore_afterwards"`

	ScriptName string   `json:"script_name,omitempty"`
	ScriptArgs []string `json:"script_args,omitempty"`

	IncludeInitImages bool `json:"include_init_images,omitempty"` // I don't even know what this is. But it has just a little impact on the result images

	// Original field was `SendImages` but since the default value is `true`. it's quite tricky to do this in GO
	//
	//  So I decided to reverse it. This set to true and "send_images": false and vice versa
	DoNotSendImages bool `json:"send_images"`

	SaveImages bool `json:"save_iamges,omitempty"`

	SdModelHash string `json:"sd_model_hash"  binding:"required"`

	AlwaysOnScripts map[string]any `json:"alwayson_scripts,omitempty"`

	// If true, Will Decode Images after received response from API
	DecodeAfterResult bool `json:"-"`
}

type Image2ImageRequest

type Image2ImageRequest struct {
	*Image2Image
}

type Image2ImageResponse

type Image2ImageResponse struct {
	SDResponse
	Images        []string `json:"images"`
	DecodedImages [][]byte
	Parameters    Image2Image `json:"parameters"`
	Info          string      `json:"info"`
}

type Option

type Option struct {
	UsesEnSD               string `json:"uses_ensd,omitempty"`
	SecondOrder            string `json:"second_order,omitempty"`
	BrownianNoise          string `json:"brownian_noise,omitempty"`
	Scheduler              string `json:"scheduler,omitempty"`
	DiscardNextToLastSigma string `json:"discard_next_to_last_sigma,omitempty"`
}

type Options

type Options struct {
	SamplesSave                        bool     `json:"samples_save,omitempty"`
	SamplesFormat                      string   `json:"samples_format,omitempty"`
	SamplesFilenamePattern             string   `json:"samples_filename_pattern,omitempty"`
	SaveImagesAddNumber                bool     `json:"save_images_add_number,omitempty"`
	GridSave                           bool     `json:"grid_save,omitempty"`
	GridFormat                         string   `json:"grid_format,omitempty"`
	GridExtendedFilename               bool     `json:"grid_extended_filename,omitempty"`
	GridOnlyIfMultiple                 bool     `json:"grid_only_if_multiple,omitempty"`
	GridPreventEmptySpots              bool     `json:"grid_prevent_empty_spots,omitempty"`
	NRows                              float64  `json:"n_rows,omitempty"`
	EnablePnginfo                      bool     `json:"enable_pnginfo,omitempty"`
	SaveTxt                            bool     `json:"save_txt,omitempty"`
	SaveImagesBeforeFaceRestoration    bool     `json:"save_images_before_face_restoration,omitempty"`
	SaveImagesBeforeHighresFix         bool     `json:"save_images_before_highres_fix,omitempty"`
	SaveImagesBeforeColorCorrection    bool     `json:"save_images_before_color_correction,omitempty"`
	JpegQuality                        float64  `json:"jpeg_quality,omitempty"`
	WebpLossless                       bool     `json:"webp_lossless,omitempty"`
	ExportFor4Chan                     bool     `json:"export_for_4chan,omitempty"`
	ImgDownscaleThreshold              float64  `json:"img_downscale_threshold,omitempty"`
	TargetSideLength                   float64  `json:"target_side_length,omitempty"`
	ImgMaxSizeMp                       float64  `json:"img_max_size_mp,omitempty"`
	UseOriginalNameBatch               bool     `json:"use_original_name_batch,omitempty"`
	UseUpscalerNameAsSuffix            bool     `json:"use_upscaler_name_as_suffix,omitempty"`
	SaveSelectedOnly                   bool     `json:"save_selected_only,omitempty"`
	DoNotAddWatermark                  bool     `json:"do_not_add_watermark,omitempty"`
	TempDir                            string   `json:"temp_dir,omitempty"`
	CleanTempDirAtStart                bool     `json:"clean_temp_dir_at_start,omitempty"`
	OutdirSamples                      string   `json:"outdir_samples,omitempty"`
	OutdirTxt2ImgSamples               string   `json:"outdir_txt2img_samples,omitempty"`
	OutdirImg2ImgSamples               string   `json:"outdir_img2img_samples,omitempty"`
	OutdirExtrasSamples                string   `json:"outdir_extras_samples,omitempty"`
	OutdirGrids                        string   `json:"outdir_grids,omitempty"`
	OutdirTxt2ImgGrids                 string   `json:"outdir_txt2img_grids,omitempty"`
	OutdirImg2ImgGrids                 string   `json:"outdir_img2img_grids,omitempty"`
	OutdirSave                         string   `json:"outdir_save,omitempty"`
	SaveToDirs                         bool     `json:"save_to_dirs,omitempty"`
	GridSaveToDirs                     bool     `json:"grid_save_to_dirs,omitempty"`
	UseSaveToDirsForUI                 bool     `json:"use_save_to_dirs_for_ui,omitempty"`
	DirectoriesFilenamePattern         string   `json:"directories_filename_pattern,omitempty"`
	DirectoriesMaxPromptWords          float64  `json:"directories_max_prompt_words,omitempty"`
	ESRGANTile                         float64  `json:"ESRGAN_tile,omitempty"`
	ESRGANTileOverlap                  float64  `json:"ESRGAN_tile_overlap,omitempty"`
	RealESRGanEnabledModels            []string `json:"realesrgan_enabled_models,omitempty"`
	UpscalerForImg2Img                 string   `json:"upscaler_for_img2img,omitempty"`
	LDSRSteps                          float64  `json:"ldsr_steps,omitempty"`
	LDSRCache                          bool     `json:"ldsr_cached,omitempty"`
	SWINTile                           float64  `json:"SWIN_tile"`
	SWINTileOverlap                    float64  `json:"SWIN_tile_overlap"`
	FaceRestorationModel               string   `json:"face_restoration_model,omitempty"`
	CodeFormerWeight                   float64  `json:"code_former_weight,omitempty"`
	FaceRestorationUnload              bool     `json:"face_restoration_unload,omitempty"`
	ShowWarnings                       bool     `json:"show_warnings,omitempty"`
	MemmonPollRate                     float64  `json:"memmon_poll_rate,omitempty"`
	SamplesLogStdout                   bool     `json:"samples_log_stdout,omitempty"`
	MultipleTqdm                       bool     `json:"multiple_tqdm,omitempty"`
	PrintHypernetExtra                 bool     `json:"print_hypernet_extra,omitempty"`
	UnloadModelsWhenTraining           bool     `json:"unload_models_when_training,omitempty"`
	PinMemory                          bool     `json:"pin_memory,omitempty"`
	SaveOptimizerState                 bool     `json:"save_optimizer_state,omitempty"`
	SaveTrainingSettingsToTxt          bool     `json:"save_training_settings_to_txt,omitempty"`
	DatasetFilenameWordRegex           string   `json:"dataset_filename_word_regex,omitempty"`
	DatasetFilenameJoinString          string   `json:"dataset_filename_join_string,omitempty"`
	TrainingImageRepeatsPerEpoch       float64  `json:"training_image_repeats_per_epoch,omitempty"`
	TrainingWriteCsvEvery              float64  `json:"training_write_csv_every,omitempty"`
	TrainingXattentionOptimizations    bool     `json:"training_xattention_optimizations,omitempty"`
	TrainingEnableTensorboard          bool     `json:"training_enable_tensorboard,omitempty"`
	TrainingTensorboardSaveImages      bool     `json:"training_tensorboard_save_images,omitempty"`
	TrainingTensorboardFlushEvery      float64  `json:"training_tensorboard_flush_every,omitempty"`
	SdModelCheckpoint                  string   `json:"sd_model_checkpoint,omitempty"`
	SdCheckpointCache                  float64  `json:"sd_checkpoint_cache,omitempty"`
	SdVaeCheckpointCache               float64  `json:"sd_vae_checkpoint_cache,omitempty"`
	SdVae                              string   `json:"sd_vae,omitempty"`
	SdVaeAsDefault                     bool     `json:"sd_vae_as_default,omitempty"`
	InpaintingMaskWeight               float64  `json:"inpainting_mask_weight,omitempty"`
	InitialNoiseMultiplier             float64  `json:"initial_noise_multiplier,omitempty"`
	Img2ImgColorCorrection             bool     `json:"img2img_color_correction,omitempty"`
	Img2ImgFixSteps                    bool     `json:"img2img_fix_steps,omitempty"`
	Img2ImgBackgroundColor             string   `json:"img2img_background_color,omitempty"`
	EnableQuantization                 bool     `json:"enable_quantization,omitempty"`
	EnableEmphasis                     bool     `json:"enable_emphasis,omitempty"`
	EnableBatchSeeds                   bool     `json:"enable_batch_seeds,omitempty"`
	CommaPaddingBacktrack              float64  `json:"comma_padding_backtrack,omitempty"`
	CLIPStopAtLastLayers               float64  `json:"CLIP_stop_at_last_layers,omitempty"`
	UpcastAttn                         bool     `json:"upcast_attn,omitempty"`
	UseOldEmphasisImplementation       bool     `json:"use_old_emphasis_implementation,omitempty"`
	UseOldKarrasSchedulerSigmas        bool     `json:"use_old_karras_scheduler_sigmas,omitempty"`
	NoDpmppSdeBatchDeterminism         bool     `json:"no_dpmpp_sde_batch_determinism,omitempty"`
	UseOldHiresFixWidthHeight          bool     `json:"use_old_hires_fix_width_height,omitempty"`
	InterrogateKeepModelsInMemory      bool     `json:"interrogate_keep_models_in_memory,omitempty"`
	InterrogateReturnRanks             bool     `json:"interrogate_return_ranks,omitempty"`
	InterrogateClipNumBeams            float64  `json:"interrogate_clip_num_beams,omitempty"`
	InterrogateClipMinLength           float64  `json:"interrogate_clip_min_length,omitempty"`
	InterrogateClipMaxLength           float64  `json:"interrogate_clip_max_length,omitempty"`
	InterrogateClipDictLimit           float64  `json:"interrogate_clip_dict_limit,omitempty"`
	InterrogateClipSkipCategories      []any    `json:"interrogate_clip_skip_categories,omitempty"`
	InterrogateDeepbooruScoreThreshold float64  `json:"interrogate_deepbooru_score_threshold,omitempty"`
	DeepbooruSortAlpha                 bool     `json:"deepbooru_sort_alpha,omitempty"`
	DeepbooruUseSpaces                 bool     `json:"deepbooru_use_spaces,omitempty"`
	DeepbooruEscape                    bool     `json:"deepbooru_escape,omitempty"`
	DeepbooruFilterTags                string   `json:"deepbooru_filter_tags,omitempty"`
	ExtraNetworksDefaultView           string   `json:"extra_networks_default_view,omitempty"`
	ExtraNetworksDefaultMultiplier     float64  `json:"extra_networks_default_multiplier,omitempty"`
	ExtraNetworksAddTextSeparator      string   `json:"extra_networks_add_text_separator,omitempty"`
	SdHypernetwork                     string   `json:"sd_hypernetwork,omitempty"`
	SdLora                             string   `json:"sd_lora,omitempty"`
	LoraApplyToOutputs                 bool     `json:"lora_apply_to_outputs,omitempty"`
	ReturnGrid                         bool     `json:"return_grid,omitempty"`
	DoNotShowImages                    bool     `json:"do_not_show_images,omitempty"`
	AddModelHashToInfo                 bool     `json:"add_model_hash_to_info,omitempty"`
	AddModelNameToInfo                 bool     `json:"add_model_name_to_info,omitempty"`
	DisableWeightsAutoSwap             bool     `json:"disable_weights_auto_swap,omitempty"`
	SendSeed                           bool     `json:"send_seed,omitempty"`
	SendSize                           bool     `json:"send_size,omitempty"`
	Font                               string   `json:"font,omitempty"`
	JsModalLightbox                    bool     `json:"js_modal_lightbox,omitempty"`
	JsModalLightboxInitiallyZoomed     bool     `json:"js_modal_lightbox_initially_zoomed,omitempty"`
	ShowProgressInTitle                bool     `json:"show_progress_in_title,omitempty"`
	SamplersInDropdown                 bool     `json:"samplers_in_dropdown,omitempty"`
	DimensionsAndBatchTogether         bool     `json:"dimensions_and_batch_together,omitempty"`
	KeyeditPrecisionAttention          float64  `json:"keyedit_precision_attention,omitempty"`
	KeyeditPrecisionExtra              float64  `json:"keyedit_precision_extra,omitempty"`
	Quicksettings                      string   `json:"quicksettings,omitempty"`
	HiddenTabs                         []any    `json:"hidden_tabs,omitempty"`
	UIReorder                          string   `json:"ui_reorder,omitempty"`
	UIExtraNetworksTabReorder          string   `json:"ui_extra_networks_tab_reorder,omitempty"`
	Localization                       string   `json:"localization,omitempty"`
	ShowProgressbar                    bool     `json:"show_progressbar,omitempty"`
	LivePreviewsEnable                 bool     `json:"live_previews_enable,omitempty"`
	ShowProgressGrid                   bool     `json:"show_progress_grid,omitempty"`
	ShowProgressEveryNSteps            float64  `json:"show_progress_every_n_steps,omitempty"`
	ShowProgressType                   string   `json:"show_progress_type,omitempty"`
	LivePreviewContent                 string   `json:"live_preview_content,omitempty"`
	LivePreviewRefreshPeriod           float64  `json:"live_preview_refresh_period,omitempty"`
	HideSamplers                       []any    `json:"hide_samplers,omitempty"`
	EtaDdim                            float64  `json:"eta_ddim,omitempty"`
	EtaAncestral                       float64  `json:"eta_ancestral,omitempty"`
	DdimDiscretize                     string   `json:"ddim_discretize,omitempty"`
	SChurn                             float64  `json:"s_churn,omitempty"`
	STmin                              float64  `json:"s_tmin,omitempty"`
	SNoise                             float64  `json:"s_noise,omitempty"`
	EtaNoiseSeedDelta                  float64  `json:"eta_noise_seed_delta,omitempty"`
	AlwaysDiscardNextToLastSigma       bool     `json:"always_discard_next_to_last_sigma,omitempty"`
	UniPcVariant                       string   `json:"uni_pc_variant,omitempty"`
	UniPcSkipType                      string   `json:"uni_pc_skip_type,omitempty"`
	UniPcOrder                         float64  `json:"uni_pc_order,omitempty"`
	UniPcLowerOrderFinal               bool     `json:"uni_pc_lower_order_final,omitempty"`
	PostprocessingEnableInMainUI       []any    `json:"postprocessing_enable_in_main_ui,omitempty"`
	PostprocessingOperationOrder       []any    `json:"postprocessing_operation_order,omitempty"`
	UpscalingMaxImagesInCache          float64  `json:"upscaling_max_images_in_cache,omitempty"`
	DisabledExtensions                 []string `json:"disabled_extensions,omitempty"`
	SdCheckpointHash                   string   `json:"sd_checkpoint_hash,omitempty"`
}

type OptionsRequest

type OptionsRequest struct {
	*Options
}

type OptionsResponse

type OptionsResponse struct {
	*Options
}

type ProgressRequest

type ProgressRequest struct {
	SkipCurrentImage bool `json:"skip_current_image"`
}

type ProgressResponse

type ProgressResponse struct {
	SDResponse
	Progress     float64 `json:"progress"`
	ETA          float64 `json:"eta_relative"`
	State        State   `json:"state"`
	CurrentImage string  `json:"current_image"`
}

type SDResponse

type SDResponse struct {
	Error  string `json:"error,omitempty"`
	Detail string `json:"detail,omitempty"`
	Body   string `json:"body,omitempty"`
	Errors string `json:"errors,omitempty"`
}

type Sampler

type Sampler struct {
	Name    string   `json:"name"`
	Aliases []string `json:"aliases"`
	Options *Option  `json:"options"`
}

type State

type State struct {
	Skipped             bool   `json:"skipped"`
	Interrupted         bool   `json:"interrupted"`
	Job                 string `json:"job"`
	JobCount            int    `json:"job_count"`
	JobNo               int    `json:"job_no"`
	CurrentStep         int    `json:"sampling_step"`
	TargetSamplingSteps int    `json:"sampling_steps"`
}

type Text2Image

type Text2Image struct {
	EnableHR          bool    `json:"enable_hr,omitempty"`          // Hi-res fix.
	DenoisingStrength float64 `json:"denoising_strength,omitempty"` // Hi-res fix option. Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image.
	FirstphaseWidth   int     `json:"firstphase_width,omitempty"`   // Hi-res fix option. Might not work anymore
	FirstphaseHeight  int     `json:"firstphase_height,omitempty"`  // Hi-res fix option. Might not work anymore

	// Hi-res fix option. Multiplier to original width and height.
	//
	// HRScale = 2 will work like this: 384x512 will result in 768x1024
	//
	//  Only HRScale or HRResizeX / HRResizeY will be used
	HRScale float64 `json:"hr_scale,omitempty"`

	// Hi-res fix option. Which Hi-res upscale model will be used.
	//
	//  See: `upscaler` helper package (github.com/Meonako/webui-api/upscaler)
	HRUpscaler string `json:"hr_upscaler,omitempty"`

	// Hi-res fix option. After denoising and upscale, use this amount of steps instead of the amount before denoise and upscale.
	HRSecondPassSteps int `json:"hr_second_pass_steps,omitempty"`

	// Hi-res fix option. The width of the result image
	//
	//  Only HRScale or HRResizeX / HRResizeY will be used
	HRResizeX int `json:"hr_resize_x,omitempty"`

	// Hi-res fix option. The height of the result image
	//
	//  Only HRScale or HRResizeX / HRResizeY will be used
	HRResizeY int `json:"hr_resize_y,omitempty"`

	Prompt           string         `json:"prompt"`
	NegativePrompt   string         `json:"negative_prompt,omitempty"`
	Styles           []string       `json:"styles,omitempty"`
	Seed             int64          `json:"seed,omitempty"` // A value that determines the output of random number generator - if you create an image with same parameters and seed as another image, you'll get the same result
	Subseed          int            `json:"subseed,omitempty"`
	SubseedStrength  int            `json:"subseed_strength,omitempty"`
	SeedResizeFromH  int            `json:"seed_resize_from_h,omitempty"`
	SeedResizeFromW  int            `json:"seed_resize_from_w,omitempty"`
	SamplerName      string         `json:"sampler_name,omitempty"`  // Either SamplerName or SamplerIndex will be used.
	SamplerIndex     string         `json:"sampler_index,omitempty"` // Either SamplerName or SamplerIndex will be used.
	BatchSize        int            `json:"batch_size,omitempty"`    // How many do you want to simultaneously generate.
	BatchCount       int            `json:"n_iter,omitempty"`        // How many times do you want to generate.
	Steps            int            `json:"steps,omitempty"`         // How many times to improve the generated image iteratively; higher values take longer; very low values can produce bad results
	CFGScale         float64        `json:"cfg_scale,omitempty"`     // Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results
	Width            int            `json:"width,omitempty"`
	Height           int            `json:"height,omitempty"`
	RestoreFaces     bool           `json:"restore_faces,omitempty"`
	Tiling           bool           `json:"tiling,omitempty"`
	DoNotSaveSamples bool           `json:"do_not_save_samples,omitempty"`
	DoNotSaveGrid    bool           `json:"do_not_save_grid,omitempty"`
	Eta              float64        `json:"eta,omitempty"`
	SChurn           float64        `json:"s_churn,omitempty"`
	STmax            int            `json:"s_tmax,omitempty"`
	STmin            float64        `json:"s_tmin,omitempty"`
	SNoise           float64        `json:"s_noise,omitempty"`
	OverrideSettings map[string]any `json:"override_settings,omitempty"`

	// Original field was `OverrideSettingsRestoreAfterwards` but since the default value is `true`. it's quite tricky to do this in GO
	//
	//  So I decided to reverse it. This set to true and "override_settings_restore_afterwards": false and vice versa
	DoNotOverrideSettingsRestoreAfterwards bool `json:"override_settings_restore_afterwards"`

	ScriptName string   `json:"script_name,omitempty"`
	ScriptArgs []string `json:"script_args,omitempty"`

	// Original field was `SendImages` but since the default value is `true`. it's quite tricky to do this in GO
	//
	//  So I decided to reverse it. This set to true and "send_images": false and vice versa
	DoNotSendImages bool `json:"send_images"`

	// Save image(s) to `outputs` folder where Stable Diffusion Web UI is running
	SaveImages bool `json:"save_images,omitempty"`

	AlwaysOnScripts map[string]any `json:"alwayson_scripts,omitempty"`

	// If true, Will Decode Images after received response from API
	DecodeAfterResult bool `json:"-"`

	SdModelHash string `json:"sd_model_hash" binding:"required"`
}

type Text2ImageRequest

type Text2ImageRequest struct {
	*Text2Image
}

type Text2ImageResponse

type Text2ImageResponse struct {
	SDResponse
	Images        []string   `json:"images"`     // Base64-encoded Images Data
	DecodedImages [][]byte   `json:"-"`          // Base64-decoded Images Data store here after "DecodeAllImages()" called
	Parameters    Text2Image `json:"parameters"` // Generation Parameters. Should be the same value as the one you pass to generate.
	Info          string     `json:"info"`       // Info field contains generation parameters like "parameters" field but in long string instead.

}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL