summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-11-21 14:28:25 +0100
committerlassulus <lassulus@lassul.us>2022-11-21 14:44:38 +0100
commit6db1863a27857f92303322c3502505d541b6241f (patch)
treec2bf270e0ace15dade0f761fa180603b1c2d4ae1
parent0ee566ac97846e5b67d705882dac9ad24d8db75d (diff)
init pkgs.stable-generate
-rw-r--r--krebs/5pkgs/simple/stable-generate/default.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/stable-generate/default.nix b/krebs/5pkgs/simple/stable-generate/default.nix
new file mode 100644
index 000000000..495007397
--- /dev/null
+++ b/krebs/5pkgs/simple/stable-generate/default.nix
@@ -0,0 +1,20 @@
+{ pkgs, ... }:
+
+pkgs.writers.writeDashBin "stable-generate" ''
+ set -efu
+
+ STABLE_URL=''${STABLE_URL:-http://stable-confusion.r}
+
+ PAYLOAD=$(jq -cn --arg query "$*" '{fn_index: 51, data: [$query,"","None","None",20,"Euler a",false,false,1,1,7,-1,-1,0,0,0,false,512,512,false,0.7,0,0,"None","",false,false,false,"","Seed","","Nothing","",true,false,false,null,"",""], session_hash: "hello_this_is_dog"}')
+
+ data=$(curl -Ssf "$STABLE_URL/run/predict/" \
+ -X POST \
+ --Header 'Content-Type: application/json' \
+ --data "$PAYLOAD"
+ )
+ export data
+
+ filename=$(jq -rn 'env.data | fromjson.data[0][0].name')
+
+ echo "$STABLE_URL/file=$filename"
+''