From 95b59cbf4dc120b7828453dfd65913bca006bce7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 24 May 2025 19:46:10 -0700 Subject: [PATCH] docs image edits --- docs/my-website/docs/image_edits.md | 38 ++++++----------------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/docs/my-website/docs/image_edits.md b/docs/my-website/docs/image_edits.md index c8959e4c56..8e71764c09 100644 --- a/docs/my-website/docs/image_edits.md +++ b/docs/my-website/docs/image_edits.md @@ -106,13 +106,6 @@ for i, image_data in enumerate(response.data): ### LiteLLM Proxy with OpenAI SDK -First, set up and start your LiteLLM proxy server. - -```bash showLineNumbers title="Start LiteLLM Proxy Server" -litellm --config /path/to/config.yaml - -# RUNNING on http://0.0.0.0:4000 -``` @@ -126,6 +119,14 @@ model_list: api_key: os.environ/OPENAI_API_KEY ``` +Start the LiteLLM proxy server: + +```bash showLineNumbers title="Start LiteLLM Proxy Server" +litellm --config /path/to/config.yaml + +# RUNNING on http://0.0.0.0:4000 +``` + #### Basic Image Edit via Proxy ```python showLineNumbers title="OpenAI Proxy Image Edit" from openai import OpenAI @@ -148,29 +149,6 @@ response = client.images.edit( print(response) ``` -#### Image Edit with Mask via Proxy -```python showLineNumbers title="OpenAI Proxy Image Edit with Mask" -from openai import OpenAI - -# Initialize client with your proxy URL -client = OpenAI( - base_url="http://localhost:4000", # Your proxy URL - api_key="your-api-key" # Your proxy API key -) - -# Edit an image with a mask -response = client.images.edit( - model="gpt-image-1", - image=open("original_image.png", "rb"), - mask=open("mask_image.png", "rb"), - prompt="Replace the background with a mountain landscape", - n=2, - size="512x512" -) - -print(response) -``` - #### cURL Example ```bash showLineNumbers title="cURL Image Edit Request" curl -X POST "http://localhost:4000/v1/images/edits" \