Buckets:

download
raw
1.97 kB
import modal
aquiles_image = (
modal.Image.from_registry("nvidia/cuda:12.8.0-devel-ubuntu22.04", add_python="3.12")
.apt_install("git", "curl", "build-essential",)
.entrypoint([])
.run_commands(
"python -m pip install --upgrade pip",
"python -m pip install --upgrade setuptools wheel"
)
.uv_pip_install(
"torch==2.9",
"git+https://github.com/huggingface/diffusers.git",
"transformers==5.10.2",
"git+https://github.com/Aquiles-ai/Aquiles-Image.git",
"bitsandbytes",
)
.env({"HF_XET_HIGH_PERFORMANCE": "1"})
)
MODEL_NAME = "ideogram-ai/ideogram-4-nf4-diffusers"
hf_cache_vol = modal.Volume.from_name("huggingface-cache", create_if_missing=True)
aquiles_config_vol = modal.Volume.from_name("aquiles-cache", create_if_missing=True)
app = modal.App("aquiles-image-server")
N_GPU = 1
MINUTES = 60
AQUILES_PORT = 5500
@app.function(
image=aquiles_image,
gpu=f"RTX-PRO-6000:{N_GPU}",
secrets=[modal.Secret.from_name("huggingface-secret")],
scaledown_window=6 * MINUTES,
timeout=20 * MINUTES,
volumes={
"/root/.cache/huggingface": hf_cache_vol,
"/root/.local/share": aquiles_config_vol,
},
)
@modal.concurrent(max_inputs=100)
@modal.web_server(port=AQUILES_PORT, startup_timeout=20 * MINUTES)
def serve():
import subprocess
cmd = [
"aquiles-image",
"serve",
"--host",
"0.0.0.0",
"--port",
str(AQUILES_PORT),
"--model",
MODEL_NAME,
# For Ideogram 4: 12 steps - Turbo, 20 steps - Default, 48 steps - Quality
"--set-steps", "20",
"--api-key", "dummy-api-key",
"--device-map", "cuda",
"--guidance-scale", "4.0",
"--username", "root",
"--password", "root"
]
print(f"Starting Aquiles-Image with the model:{MODEL_NAME}")
print(f"Command {' '.join(cmd)}")
subprocess.Popen(" ".join(cmd), shell=True)

Xet Storage Details

Size:
1.97 kB
·
Xet hash:
cd8cb0bea46d63ef21c9ff5f3862825d2509e4a89667d3a739b5a356616f59d1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.