Update README.md
Browse files
README.md
CHANGED
|
@@ -21,39 +21,40 @@ pip install git+https://github.com/huggingface/transformers.git
|
|
| 21 |
~~~bash
|
| 22 |
CUDA_VISIBLE_DEVICES=0 vllm serve Intel/GLM-Image-int4-AutoRound --omni --stage-configs-path <your_vllm_omni_path>/vllm_omni/model_executor/stage_configs/glm_image.yaml --port 8091
|
| 23 |
|
| 24 |
-
curl http://
|
| 25 |
-H "Content-Type: application/json" \
|
| 26 |
-d '{
|
| 27 |
-
"messages": [
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
"
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
{
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
"height":
|
| 48 |
-
"width":
|
| 49 |
-
|
| 50 |
-
"seed": 42
|
| 51 |
}
|
| 52 |
EOF
|
| 53 |
-
|
| 54 |
-
curl http://localhost:8091/v1/chat/completions \
|
| 55 |
-
-H "Content-Type: application/json" \
|
| 56 |
-
-d @payload.json
|
| 57 |
~~~
|
| 58 |
|
| 59 |
|
|
|
|
| 21 |
~~~bash
|
| 22 |
CUDA_VISIBLE_DEVICES=0 vllm serve Intel/GLM-Image-int4-AutoRound --omni --stage-configs-path <your_vllm_omni_path>/vllm_omni/model_executor/stage_configs/glm_image.yaml --port 8091
|
| 23 |
|
| 24 |
+
curl -s http://127.0.0.1:8091/v1/chat/completions \
|
| 25 |
-H "Content-Type: application/json" \
|
| 26 |
-d '{
|
| 27 |
+
"messages": [
|
| 28 |
+
{"role": "user", "content": "A beautiful sunset over the ocean with sailing boats"}
|
| 29 |
+
],
|
| 30 |
+
"extra_body": {
|
| 31 |
+
"height": 1024,
|
| 32 |
+
"width": 1024,
|
| 33 |
+
"num_inference_steps": 50,
|
| 34 |
+
"guidance_scale": 1.5,
|
| 35 |
+
"seed": 42
|
| 36 |
+
}
|
| 37 |
+
}' | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > sunset.png
|
| 38 |
+
|
| 39 |
+
IMG_B64=$(base64 -w0 sunset.png)
|
| 40 |
+
|
| 41 |
+
curl -s http://localhost:8091/v1/chat/completions \
|
| 42 |
+
-H "Content-Type: application/json" \
|
| 43 |
+
-d @- <<EOF | jq -r '.choices[0].message.content[0].image_url.url' | cut -d',' -f2- | base64 -d > watercolor.png
|
| 44 |
{
|
| 45 |
+
"messages": [{
|
| 46 |
+
"role": "user",
|
| 47 |
+
"content": [
|
| 48 |
+
{"type": "text", "text": "Convert this image to watercolor style"},
|
| 49 |
+
{"type": "image_url", "image_url": {"url": "data:image/png;base64,$IMG_B64"}}
|
| 50 |
+
]
|
| 51 |
+
}],
|
| 52 |
+
"extra_body": {
|
| 53 |
+
"height": 1024,
|
| 54 |
+
"width": 1024
|
| 55 |
+
}
|
|
|
|
| 56 |
}
|
| 57 |
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
~~~
|
| 59 |
|
| 60 |
|