Skip to content

Commit 4fd698c

Browse files
authored
Merge pull request #64 from stackhpc/feat/flux-image-gen
Flux image gen chart improvements
2 parents f8d17e0 + ee82539 commit 4fd698c

File tree

7 files changed

+34
-12
lines changed

7 files changed

+34
-12
lines changed

charts/flux-image-gen/templates/ui/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ data:
1313
address: {{ printf "http://%s.%s.svc:%v" ( printf "%s-%s-api" (include "flux-image-gen.fullname" $) . ) $.Release.Namespace $.Values.api.service.port }}
1414
{{- end }}
1515
example_prompt: |
16-
{{- .Values.examplePrompt | nindent 6 -}}
16+
{{- .Values.examplePrompt | trimSuffix "\n" | nindent 6 -}}

charts/flux-image-gen/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ api:
8585
deploymentStrategy:
8686
type: Recreate
8787

88-
# Downloading 100GB+ of model weights can take a long time so
89-
# it's difficult to give these probes sensible default values...
88+
# Downloading model weights can take a long time so it's
89+
# difficult to give these probes sensible default values
90+
# Is 30 minutes long enough...?
9091
startupProbe:
9192
# httpGet:
9293
# path: /
9394
# port: http
94-
# Is 30 minutes long enough...?
9595
# failureThreshold: 180
9696
# periodSeconds: 10
9797
livenessProbe:

web-apps/chat/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gradio<5
1+
gradio==4.21 # v4.41 breaks custom JS query param parsing
22
gradio_client
33
openai
44
langchain

web-apps/flux-image-gen/api_server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class ImageGenInput(BaseModel):
3131
prompt: str
3232
add_sampling_metadata: bool
3333

34+
@app.get("/")
35+
def health_check():
36+
return "Server is running"
3437

3538
@app.get("/model")
3639
async def get_model():

web-apps/flux-image-gen/gradio_ui.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class Model(BaseModel):
1818

1919
class AppSettings(BaseModel):
2020
models: List[Model]
21-
example_prompt: str
21+
example_prompt: str = "Yoda riding a skateboard."
22+
title: str = "Flux Image Generation Demo"
23+
2224

2325

2426
settings_path = pathlib.Path("/etc/gradio-app/gradio_config.yaml")
@@ -93,9 +95,8 @@ async def generate_image(
9395

9496
return image, seed, filename, None
9597

96-
97-
with gr.Blocks() as demo:
98-
gr.Markdown("# Flux Image Generation Demo")
98+
with gr.Blocks(title=settings.title) as demo:
99+
gr.Markdown(f"# {settings.title}")
99100

100101
with gr.Row():
101102
with gr.Column():

web-apps/image-analysis/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pillow
22
requests
3-
gradio<5
3+
gradio==4.21 # v4.41 breaks custom JS query param parsing
44
gradio_client
55
pydantic
66
structlog

web-apps/kind-images.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,32 @@ if [[ -z $1 ]]; then
77
exit 1
88
fi
99

10+
# Work around storage limits in GH runners
11+
if [[ $CI == "true" ]]; then
12+
DIR=/mnt/gimme-more-space
13+
sudo mkdir -p $DIR
14+
sudo chown -R $USER:$USER $DIR
15+
TAR_PATH=$DIR/image.tar
16+
else
17+
TAR_PATH="./image.tar"
18+
fi
19+
1020
REMOTE_TAG=$1
1121
CLUSTER_NAME=${2:-kind}
1222
echo Kind cluster name: $CLUSTER_NAME
1323
KIND_TAG=local
1424
for image in $(find_images .); do
1525
full_name=ghcr.io/stackhpc/azimuth-llm-$image-ui
16-
echo $full_name
26+
echo $full_name:{$REMOTE_TAG,$KIND_TAG}
1727
docker pull $full_name:$REMOTE_TAG
1828
docker image tag $full_name:$REMOTE_TAG $full_name:$KIND_TAG
19-
kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG
29+
# NOTE(scott): The 'load docker-image' command saves the
30+
# intermediate tar archive to /tmp which has limited space
31+
# inside a GH runner so do each step manually here instead.
32+
# kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG
33+
# Apparently there's a separate 75G disk at /mnt so try using it.
34+
docker image save -o $TAR_PATH $full_name:$KIND_TAG
35+
docker image rm $full_name:{$REMOTE_TAG,$KIND_TAG}
36+
kind load image-archive -n $CLUSTER_NAME $TAR_PATH
37+
rm $TAR_PATH
2038
done

0 commit comments

Comments
 (0)