Implement the API in my python script:
Choose a language to see the code snippets for interacting with the API.

1. Install the python client (docs) if you don't already have it installed.

copy
$ pip install gradio_client
2. Find the API endpoint below corresponding to your desired function in the app. Copy the code snippet, replacing the placeholder values with your own input data. If this is a private Space, you may need to pass your Hugging Face token as well (read more). Or use the 
API Recorder

 to automatically generate your API requests.

api_name: /flip_text
copy
from gradio_client import Client

client = Client("prodia/sdxl-stable-diffusion-xl")
result = client.predict(
		prompt="space warrior, beautiful, female, ultrarealistic, soft lighting, 8k",
		negative_prompt="3d, cartoon, anime, (deformed eyes, nose, ears, nose), bad anatomy, ugly",
		model="sd_xl_base_1.0.safetensors [be9edd61]",
		steps=20,
		sampler="DPM++ 2M Karras",
		cfg_scale=7,
		resolution="1024x1024",
		seed=-1,
		api_name="/flip_text"
)
print(result)
Accepts 8 parameters:
prompt str Default: "space warrior, beautiful, female, ultrarealistic, soft lighting, 8k"

The input value that is provided in the "parameter_10" Textbox component.

negative_prompt str Default: "3d, cartoon, anime, (deformed eyes, nose, ears, nose), bad anatomy, ugly"

The input value that is provided in the "parameter_11" Textbox component.

model Literal['animagineXLV3_v30.safetensors [75f2f05b]', 'devlishphotorealism_sdxl15.safetensors [77cba69f]', 'dreamshaperXL10_alpha2.safetensors [c8afe2ef]', 'dynavisionXL_0411.safetensors [c39cc051]', 'juggernautXL_v45.safetensors [e75f5471]', 'realismEngineSDXL_v10.safetensors [af771c3f]', 'realvisxlV40.safetensors [f7fdcb51]', 'sd_xl_base_1.0.safetensors [be9edd61]', 'sd_xl_base_1.0_inpainting_0.1.safetensors [5679a81a]', 'turbovisionXL_v431.safetensors [78890989]'] Default: "sd_xl_base_1.0.safetensors [be9edd61]"

The input value that is provided in the "Stable Diffusion Checkpoint" Dropdown component.

steps float Default: 20

The input value that is provided in the "Sampling Steps" Slider component.

sampler Literal['DPM++ 2M Karras', 'DPM++ SDE Karras', 'DPM++ 2M SDE Exponential', 'DPM++ 2M SDE Karras', 'Euler a', 'Euler', 'LMS', 'Heun', 'DPM2', 'DPM2 a', 'DPM++ 2S a', 'DPM++ 2M', 'DPM++ SDE', 'DPM++ 2M SDE', 'DPM++ 2M SDE Heun', 'DPM++ 2M SDE Heun Karras', 'DPM++ 2M SDE Heun Exponential', 'DPM++ 3M SDE', 'DPM++ 3M SDE Karras', 'DPM++ 3M SDE Exponential', 'DPM fast', 'DPM adaptive', 'LMS Karras', 'DPM2 Karras', 'DPM2 a Karras', 'DPM++ 2S a Karras', 'Restart', 'DDIM', 'PLMS', 'UniPC'] Default: "DPM++ 2M Karras"

The input value that is provided in the "Sampling Method" Dropdown component.

cfg_scale float Default: 7

The input value that is provided in the "CFG Scale" Slider component.

resolution Literal['1024x1024', '1152x896', '1216x832', '1344x768', '1536x640', '640x1536', '768x1344', '832x1216'] Default: "1024x1024"

The input value that is provided in the "Resolution" Dropdown component.

seed float Default: -1

The input value that is provided in the "Seed" Number component.

Returns 1 element
filepath

The output value that appears in the "value_38" Image component.

Use the CSS for smooth design (libraries)