rename client program to just 'jigs'

This commit is contained in:
Jeff Epler 2024-03-06 08:46:32 -06:00
parent 46044a8843
commit 032b54e42b
3 changed files with 13 additions and 3 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@
*.egg-info
__pycache__
jigs/__version__.py
dist

View file

@ -9,6 +9,7 @@ import io
import json
import re
import subprocess
import urllib
import httpx
from PIL import Image
@ -59,8 +60,16 @@ unsafe_chars = re.compile(r"[^a-zA-Z0-9-_]+")
default="firefox",
help="Executable program to run on each image (e.g., open, firefox)",
)
@click.option(
"--url",
type=str,
envvar="JIGS_URL",
metavar="URL",
default="http://localhost:8072",
help="The URL of the server. Defaults to the content of the environment variable JIGS_URL. If JIGS_URL is unset, defaults to http://localhost:8072",
)
@click.argument("qstr", nargs=-1, required=False)
def main(size, steps, action, negative_prompt, elaborate_instruction, qstr=[]):
def main(size, steps, action, negative_prompt, elaborate_instruction, url, qstr=[]):
if qstr:
prompt = " ".join(qstr)
else:
@ -69,7 +78,7 @@ def main(size, steps, action, negative_prompt, elaborate_instruction, qstr=[]):
width, height = map(int, size.split("x"))
response = httpx.post(
"http://eric:8072/generate",
urllib.parse.urljoin(url, "generate"),
data={
"prompt": prompt,
"negative_prompt": negative_prompt,

View file

@ -37,7 +37,7 @@ repository = "https://github.com/jepler/jigs"
[project.scripts]
jigs-server = "jigs.server:main"
jigs-client = "jigs.client:main"
jigs = "jigs.client:main"
[tool.setuptools_scm]
write_to = "jigs/__version__.py"