liuliu / swift-diffusion

BSD 3-Clause "New" or "Revised" License
429 stars 33 forks source link

Bazel or Swift command with "input parameters" #8

Closed enzyme69 closed 2 years ago

enzyme69 commented 2 years ago

Liuliu, if I want to do Bazel command but wanting to add parameters such as --prompt "a cat who lives a million times" --steps 30 etc how do actually do this? Can you help me to lead to the right direction?

So far I have been modifying the main.swift file using textpad.

liuliu commented 2 years ago

It requires to write some code in examples/txt2img/main.swift to support arguments (the de-facto way is to use Swift Argument Parser), this is the Swift code thing, not Bazel thing (Bazel is used to build the binary and then run it, since it detects which file changed and how, it can recompile source code if needed, thus the bazel run turns the use of a compiled language such as Swift to something like a scripting language such as Python).

This is pretty low on the list of my things to do, probably will not in examples/txt2img, but create a new CLI tool to do this, as batching processing is a valid use case.

FYI, the thing on my list of the highest priority is the iOS app, which will be another week before beta testing, and then iPad app. Before macOS app, I probably should work on the CLI tool since it is a natural extension (and the CLI tool should be done in this repo).

That's why I am very interested in fix any crashes / nan bugs. Thanks for these reports so far!

enzyme69 commented 2 years ago

Ok thanks for the useful info. I have very basic coding knowledge, but this is interesting. I remember python has something similar.