okaris
/
omni-zero
Omni-Zero: A diffusion pipeline for zero-shot stylized portrait creation.
Prediction
okaris/omni-zero:036947f1IDp28rjd4ws9rgm0cg4rbr23fhdmStatusSucceededSourceWebHardwareA100 (80GB)Total durationCreatedInput
- seed
- 42
- prompt
- A person
- base_image
- https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f
- style_image
- 64dc150b-f683-41b1-be23-b6a52c771584
- guidance_scale
- 3
- identity_image
- ba193a3a-f90e-4461-848a-560454531c58
- negative_prompt
- blurry, out of focus
- number_of_steps
- 10
- number_of_images
- 1
- composition_image
- 2ca63443-c7f3-4ba6-95c1-2a341414865f
- base_image_strength
- 0.15
- depth_image_strength
- 0.5
- style_image_strength
- 1
- identity_image_strength
- 1
- composition_image_strength
- 1
{ "seed": 42, "prompt": "A person", "base_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f", "style_image": "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "guidance_scale": 3, "identity_image": "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f", "base_image_strength": 0.15, "depth_image_strength": 0.5, "style_image_strength": 1, "identity_image_strength": 1, "composition_image_strength": 1 }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run okaris/omni-zero using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "okaris/omni-zero:036947f1e1961875eef47a561293978528bf3a847e79fedb20600c9ad25d0c59", { input: { seed: 42, prompt: "A person", style_image: "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", guidance_scale: 3, identity_image: "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", negative_prompt: "blurry, out of focus", number_of_steps: 10, number_of_images: 1, composition_image: "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport replicate
Run okaris/omni-zero using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "okaris/omni-zero:036947f1e1961875eef47a561293978528bf3a847e79fedb20600c9ad25d0c59", input={ "seed": 42, "prompt": "A person", "style_image": "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "guidance_scale": 3, "identity_image": "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run okaris/omni-zero using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "036947f1e1961875eef47a561293978528bf3a847e79fedb20600c9ad25d0c59", "input": { "seed": 42, "prompt": "A person", "style_image": "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "guidance_scale": 3, "identity_image": "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run okaris/omni-zero using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/okaris/omni-zero@sha256:036947f1e1961875eef47a561293978528bf3a847e79fedb20600c9ad25d0c59 \ -i 'seed=42' \ -i 'prompt="A person"' \ -i 'style_image="https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584"' \ -i 'guidance_scale=3' \ -i 'identity_image="https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58"' \ -i 'negative_prompt="blurry, out of focus"' \ -i 'number_of_steps=10' \ -i 'number_of_images=1' \ -i 'composition_image="https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f"'
To learn more, take a look at the Cog documentation.
Pull and run okaris/omni-zero using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/okaris/omni-zero@sha256:036947f1e1961875eef47a561293978528bf3a847e79fedb20600c9ad25d0c59
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "seed": 42, "prompt": "A person", "style_image": "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "guidance_scale": 3, "identity_image": "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f" } }' \ http://localhost:5000/predictions
Output
{ "completed_at": "2024-06-17T12:07:52.013887Z", "created_at": "2024-06-17T12:06:40.074000Z", "data_removed": false, "error": null, "id": "p28rjd4ws9rgm0cg4rbr23fhdm", "input": { "seed": 42, "prompt": "A person", "base_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f", "style_image": "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "guidance_scale": 3, "identity_image": "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f", "base_image_strength": 0.15, "depth_image_strength": 0.5, "style_image_strength": 1, "identity_image_strength": 1, "composition_image_strength": 1 }, "logs": "/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/insightface/utils/transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\nTo use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\nP = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4\n 0%| | 0/10 [00:00<?, ?it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:608: UserWarning: Should have tb<=t1 but got tb=6.818950160602679 and t1=6.81895.\nwarnings.warn(f\"Should have {tb_name}<=t1 but got {tb_name}={tb} and t1={self._end}.\")\n 10%|█ | 1/10 [00:00<00:02, 3.90it/s]\n 20%|██ | 2/10 [00:00<00:01, 4.58it/s]\n 30%|███ | 3/10 [00:00<00:01, 4.52it/s]\n 40%|████ | 4/10 [00:00<00:01, 4.55it/s]\n 50%|█████ | 5/10 [00:01<00:01, 4.53it/s]\n 60%|██████ | 6/10 [00:01<00:00, 4.50it/s]\n 70%|███████ | 7/10 [00:01<00:00, 4.54it/s]\n 80%|████████ | 8/10 [00:01<00:00, 4.54it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:599: UserWarning: Should have ta>=t0 but got ta=0.09863785005758784 and t0=0.098638.\nwarnings.warn(f\"Should have ta>=t0 but got ta={ta} and t0={self._start}.\")\n 90%|█████████ | 9/10 [00:01<00:00, 4.53it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:599: UserWarning: Should have ta>=t0 but got ta=0.0 and t0=0.098638.\nwarnings.warn(f\"Should have ta>=t0 but got ta={ta} and t0={self._start}.\")\n/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:602: UserWarning: Should have tb>=t0 but got tb=0.09863785005758784 and t0=0.098638.\nwarnings.warn(f\"Should have {tb_name}>=t0 but got {tb_name}={tb} and t0={self._start}.\")\n100%|██████████| 10/10 [00:02<00:00, 4.54it/s]\n100%|██████████| 10/10 [00:02<00:00, 4.51it/s]", "metrics": { "predict_time": 7.063468107, "total_time": 71.939887 }, "output": [ "https://replicate.delivery/pbxt/MEDNlRywhva7O9sO5P439PTbhZ5qHJZfd7eqVPCITJlXkdflA/oz_output_0.jpg" ], "started_at": "2024-06-17T12:07:44.950419Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/p28rjd4ws9rgm0cg4rbr23fhdm", "cancel": "https://api.replicate.com/v1/predictions/p28rjd4ws9rgm0cg4rbr23fhdm/cancel" }, "version": "63ae60eb91f6d09acc0ec5bb9892b330e63150cc50ee87d48e93ad73d25291f6" }
Generated in/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/insightface/utils/transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`. P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4 0%| | 0/10 [00:00<?, ?it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:608: UserWarning: Should have tb<=t1 but got tb=6.818950160602679 and t1=6.81895. warnings.warn(f"Should have {tb_name}<=t1 but got {tb_name}={tb} and t1={self._end}.") 10%|█ | 1/10 [00:00<00:02, 3.90it/s] 20%|██ | 2/10 [00:00<00:01, 4.58it/s] 30%|███ | 3/10 [00:00<00:01, 4.52it/s] 40%|████ | 4/10 [00:00<00:01, 4.55it/s] 50%|█████ | 5/10 [00:01<00:01, 4.53it/s] 60%|██████ | 6/10 [00:01<00:00, 4.50it/s] 70%|███████ | 7/10 [00:01<00:00, 4.54it/s] 80%|████████ | 8/10 [00:01<00:00, 4.54it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:599: UserWarning: Should have ta>=t0 but got ta=0.09863785005758784 and t0=0.098638. warnings.warn(f"Should have ta>=t0 but got ta={ta} and t0={self._start}.") 90%|█████████ | 9/10 [00:01<00:00, 4.53it/s]/root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:599: UserWarning: Should have ta>=t0 but got ta=0.0 and t0=0.098638. warnings.warn(f"Should have ta>=t0 but got ta={ta} and t0={self._start}.") /root/.pyenv/versions/3.11.9/lib/python3.11/site-packages/torchsde/_brownian/brownian_interval.py:602: UserWarning: Should have tb>=t0 but got tb=0.09863785005758784 and t0=0.098638. warnings.warn(f"Should have {tb_name}>=t0 but got {tb_name}={tb} and t0={self._start}.") 100%|██████████| 10/10 [00:02<00:00, 4.54it/s] 100%|██████████| 10/10 [00:02<00:00, 4.51it/s]
Want to make some of these yourself?
Run this model