
sergeishapovalov/refaopt
Run sergeishapovalov/refaopt with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
Field | Type | Default value | Description |
---|---|---|---|
prompt |
string
|
Prompt
|
|
width |
integer
|
0
Max: 1280 |
Width of output image
|
height |
integer
|
0
Max: 1280 |
Height of output image
|
num_outputs |
integer
|
1
Min: 1 Max: 4 |
Number of images to output
|
sampler |
None
|
Euler
|
Sampling method для Flux моделей
|
scheduler |
None
|
Simple
|
Schedule type для Flux моделей
|
num_inference_steps |
integer
|
8
Min: 1 Max: 200 |
Number of denoising steps
|
guidance_scale |
number
|
1
Min: 1 Max: 50 |
CFG Scale (для Flux рекомендуется значение 1.0)
|
distilled_guidance_scale |
number
|
3.5
Max: 30 |
Distilled CFG Scale (основной параметр для Flux, рекомендуется 3.5)
|
seed |
integer
|
-1
|
Random seed. Leave blank to randomize the seed
|
enable_hr |
boolean
|
True
|
Hires. fix
|
hr_upscaler |
None
|
4x-UltraSharp
|
Upscaler for Hires. fix
|
hr_steps |
integer
|
8
Max: 100 |
Inference steps for Hires. fix
|
hr_scale |
number
|
1.3
Min: 1 Max: 4 |
Factor to scale image by
|
denoising_strength |
number
|
0.3
Max: 1 |
Denoising strength. 1.0 corresponds to full destruction of information in init image
|
debug_flux_checkpoint_url |
string
|
|
Flux checkpoint URL. UPDATE 18.05.2025 BREAKS IT BECAUSE OF NEW def calculate_shorthash(self):
|
enable_clip_l |
boolean
|
False
|
Enable encoder
|
enable_t5xxl_fp16 |
boolean
|
False
|
t5xxl_fp16
|
enable_ae |
boolean
|
False
|
Enable ae
|
force_model_reload |
boolean
|
False
|
Load Flux model from scratch
|
forge_unet_storage_dtype |
None
|
Automatic (fp16 LoRA)
|
forge_unet_storage_dtype
|
image |
string
|
|
Input image for image to image mode. The aspect ratio of your output will match this image
|
prompt_strength |
number
|
0.8
Max: 1 |
Prompt strength (or denoising strength) when using image to image. 1.0 corresponds to full destruction of information in image.
|
aspect_ratio |
None
|
9:16
|
Aspect ratio for the generated image
|
output_format |
None
|
webp
|
Format of the output images
|
lora_urls |
array
|
[]
|
Ссылки на LoRA файлы
|
lora_scales |
array
|
[1]
|
Lora scales
|
ad_prompt |
string
|
|
None
|
ad_hands_prompt |
string
|
|
None
|
postback_url |
string
|
|
None
|
adetailer |
boolean
|
False
|
Enable adetailer
|
adetailer_args |
string
|
{}
|
Adetailer arguments
|
adetailer_args_hands |
string
|
{}
|
Adetailer arguments for hands
|
{
"type": "object",
"title": "Input",
"required": [
"prompt"
],
"properties": {
"seed": {
"type": "integer",
"title": "Seed",
"default": -1,
"x-order": 9,
"description": "Random seed. Leave blank to randomize the seed"
},
"image": {
"type": "string",
"title": "Image",
"default": "",
"x-order": 21,
"description": "Input image for image to image mode. The aspect ratio of your output will match this image"
},
"width": {
"type": "integer",
"title": "Width",
"default": 0,
"maximum": 1280,
"minimum": 0,
"x-order": 1,
"description": "Width of output image"
},
"height": {
"type": "integer",
"title": "Height",
"default": 0,
"maximum": 1280,
"minimum": 0,
"x-order": 2,
"description": "Height of output image"
},
"prompt": {
"type": "string",
"title": "Prompt",
"x-order": 0,
"description": "Prompt"
},
"sampler": {
"enum": [
"Euler",
"DEIS",
"Euler a",
"DPM++ 2M",
"DPM++ SDE",
"DPM++ 2M SDE",
"DPM++ 2M SDE Karras",
"DPM++ 2M SDE Exponential",
"DPM++ 3M SDE",
"DPM++ 3M SDE Karras",
"DPM++ 3M SDE Exponential"
],
"type": "string",
"title": "sampler",
"description": "Sampling method \u0434\u043b\u044f Flux \u043c\u043e\u0434\u0435\u043b\u0435\u0439",
"default": "Euler",
"x-order": 4
},
"hr_scale": {
"type": "number",
"title": "Hr Scale",
"default": 1.3,
"maximum": 4,
"minimum": 1,
"x-order": 13,
"description": "Factor to scale image by"
},
"hr_steps": {
"type": "integer",
"title": "Hr Steps",
"default": 8,
"maximum": 100,
"minimum": 0,
"x-order": 12,
"description": "Inference steps for Hires. fix"
},
"ad_prompt": {
"type": "string",
"title": "Ad Prompt",
"default": "",
"x-order": 27
},
"adetailer": {
"type": "boolean",
"title": "Adetailer",
"default": false,
"x-order": 30,
"description": "Enable adetailer"
},
"enable_ae": {
"type": "boolean",
"title": "Enable Ae",
"default": false,
"x-order": 18,
"description": "Enable ae"
},
"enable_hr": {
"type": "boolean",
"title": "Enable Hr",
"default": true,
"x-order": 10,
"description": "Hires. fix"
},
"lora_urls": {
"type": "array",
"items": {
"type": "string"
},
"title": "Lora Urls",
"default": [],
"x-order": 25,
"description": "\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 LoRA \u0444\u0430\u0439\u043b\u044b"
},
"scheduler": {
"enum": [
"Simple",
"Karras",
"Exponential",
"SGM Uniform",
"SGM Karras",
"SGM Exponential",
"KL Optimal",
"Normal",
"DDIM",
"Beta",
"Turbo"
],
"type": "string",
"title": "scheduler",
"description": "Schedule type \u0434\u043b\u044f Flux \u043c\u043e\u0434\u0435\u043b\u0435\u0439",
"default": "Simple",
"x-order": 5
},
"hr_upscaler": {
"enum": [
"Latent",
"Latent (antialiased)",
"Latent (bicubic)",
"Latent (bicubic antialiased)",
"Latent (nearest)",
"Latent (nearest-exact)",
"None",
"Lanczos",
"Nearest",
"ESRGAN_4x",
"4x-UltraSharp",
"LDSR",
"R-ESRGAN 4x+",
"R-ESRGAN 4x+ Anime6B",
"ScuNET GAN",
"ScuNET PSNR",
"SwinIR 4x",
"debug"
],
"type": "string",
"title": "hr_upscaler",
"description": "Upscaler for Hires. fix",
"default": "4x-UltraSharp",
"x-order": 11
},
"lora_scales": {
"type": "array",
"items": {
"type": "number"
},
"title": "Lora Scales",
"default": [
1
],
"x-order": 26,
"description": "Lora scales"
},
"num_outputs": {
"type": "integer",
"title": "Num Outputs",
"default": 1,
"maximum": 4,
"minimum": 1,
"x-order": 3,
"description": "Number of images to output"
},
"aspect_ratio": {
"enum": [
"1:1",
"16:9",
"21:9",
"3:2",
"2:3",
"4:5",
"5:4",
"3:4",
"4:3",
"9:16",
"9:21"
],
"type": "string",
"title": "aspect_ratio",
"description": "Aspect ratio for the generated image",
"default": "9:16",
"x-order": 23
},
"postback_url": {
"type": "string",
"title": "Postback Url",
"default": "",
"x-order": 29
},
"enable_clip_l": {
"type": "boolean",
"title": "Enable Clip L",
"default": false,
"x-order": 16,
"description": "Enable encoder"
},
"output_format": {
"enum": [
"webp",
"jpg",
"png"
],
"type": "string",
"title": "output_format",
"description": "Format of the output images",
"default": "webp",
"x-order": 24
},
"adetailer_args": {
"type": "string",
"title": "Adetailer Args",
"default": "{}",
"x-order": 31,
"description": "Adetailer arguments"
},
"guidance_scale": {
"type": "number",
"title": "Guidance Scale",
"default": 1,
"maximum": 50,
"minimum": 1,
"x-order": 7,
"description": "CFG Scale (\u0434\u043b\u044f Flux \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1.0)"
},
"ad_hands_prompt": {
"type": "string",
"title": "Ad Hands Prompt",
"default": "",
"x-order": 28
},
"prompt_strength": {
"type": "number",
"title": "Prompt Strength",
"default": 0.8,
"maximum": 1,
"minimum": 0,
"x-order": 22,
"description": "Prompt strength (or denoising strength) when using image to image. 1.0 corresponds to full destruction of information in image."
},
"enable_t5xxl_fp16": {
"type": "boolean",
"title": "Enable T5Xxl Fp16",
"default": false,
"x-order": 17,
"description": "t5xxl_fp16"
},
"denoising_strength": {
"type": "number",
"title": "Denoising Strength",
"default": 0.3,
"maximum": 1,
"minimum": 0,
"x-order": 14,
"description": "Denoising strength. 1.0 corresponds to full destruction of information in init image"
},
"force_model_reload": {
"type": "boolean",
"title": "Force Model Reload",
"default": false,
"x-order": 19,
"description": "Load Flux model from scratch"
},
"num_inference_steps": {
"type": "integer",
"title": "Num Inference Steps",
"default": 8,
"maximum": 200,
"minimum": 1,
"x-order": 6,
"description": "Number of denoising steps"
},
"adetailer_args_hands": {
"type": "string",
"title": "Adetailer Args Hands",
"default": "{}",
"x-order": 32,
"description": "Adetailer arguments for hands"
},
"distilled_guidance_scale": {
"type": "number",
"title": "Distilled Guidance Scale",
"default": 3.5,
"maximum": 30,
"minimum": 0,
"x-order": 8,
"description": "Distilled CFG Scale (\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f Flux, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f 3.5)"
},
"forge_unet_storage_dtype": {
"enum": [
"Automatic",
"Automatic (fp16 LoRA)",
"FP16",
"FP16 (fp16 LoRA)",
"FP32",
"FP32 (fp16 LoRA)",
"bnb-nf4",
"bnb-nf4 (fp16 LoRA)",
"float8-e4m3fn",
"float8-e4m3fn (fp16 LoRA)",
"bnb-fp4",
"bnb-fp4 (fp16 LoRA)",
"float8-e5m2",
"float8-e5m2 (fp16 LoRA)"
],
"type": "string",
"title": "forge_unet_storage_dtype",
"description": "forge_unet_storage_dtype",
"default": "Automatic (fp16 LoRA)",
"x-order": 20
},
"debug_flux_checkpoint_url": {
"type": "string",
"title": "Debug Flux Checkpoint Url",
"default": "",
"x-order": 15,
"description": "Flux checkpoint URL. UPDATE 18.05.2025 BREAKS IT BECAUSE OF NEW def calculate_shorthash(self):"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"title": "Output"
}