lianglv commited on
Commit
a933294
·
verified ·
1 Parent(s): 949d786

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -28
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://localhost:8091/v1/chat/completions \
25
  -H "Content-Type: application/json" \
26
  -d '{
27
- "messages": [{"role": "user", "content": [{"type": "text", "text": "<|im_start|>A beautiful sunset over mountains<|im_end|>"}]}],
28
- "modalities": ["image"],
29
- "height": 512,
30
- "width": 512,
31
- "num_inference_steps": 50,
32
- "seed": 42
33
- }'
34
-
35
- IMAGE_BASE64=$(base64 -w 0 cat.jpg)
36
-
37
- cat <<EOF > payload.json
 
 
 
 
 
 
38
  {
39
- "messages": [{
40
- "role": "user",
41
- "content": [
42
- {"type": "text", "text": "<|im_start|>Make the cat stand up<|im_end|>"},
43
- {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,${IMAGE_BASE64}"}}
44
- ]
45
- }],
46
- "modalities": ["image"],
47
- "height": 512,
48
- "width": 512,
49
- "num_inference_steps": 50,
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