lora-inference
lora-inference copied to clipboard
gradual degrading of imagery?
This issue is investigating the gradual change in generated imagery as loras are loaded/unloaded through normal use:
First, the assumption:
Using the same inputs (seed / prompt / lora URL / lora scale) should always result in the same output.
If this assumption is accurate, then:
steps:
- setup an instance of lora-inference as a stand-alone cog HTTP server
- use it to generate images using patterns of inputs (alternating between two different lora_urls)
- evaluate if there is any change over time
Expectation:
We would expect the 1st and the 1000th generation of an image with the same inputs to be the same.
To test this, I'm running inference on my dev machine with:
docker run -ti -p 5000:5000 --gpus=all r8.im/cloneofsimo/lora@sha256:fce477182f407ffd66b94b08e761424cabd13b82b518754b83080bc75ad32466
alternatively I could run a dev version using cog + checkout:
cog run python -m cog.server.http
And then alternating between 1000 andreas/zeke to generate images:
import base64
import requests
import sys
def gen(output_fn, **kwargs):
print("Generating", output_fn)
url = "http://localhost:5000/predictions"
response = requests.post(url, json={"input": kwargs})
data = response.json()
try:
datauri = data["output"][0]
base64_encoded_data = datauri.split(",")[1]
data = base64.b64decode(base64_encoded_data)
except:
print("Error!")
print("input:", kwargs)
print(data['logs'])
sys.exit(1)
with open(output_fn, "wb") as f:
f.write(data)
def main():
for i in range(1000):
for name, url in {'zeke':'https://replicate.delivery/pbxt/IzbeguwVsW3PcC1gbiLy5SeALwk4sGgWroHagcYIn9I960bQA/tmpjlodd7vazekezip.safetensors',
'andreas': 'https://replicate.delivery/pbxt/tLNfiG3fK2jZo0CrBG4cNTJNhEi7r117ANUBjWrLTkQRMraQA/tmpg9tq4is5me.safetensors'}.items():
gen(
"%04d.%s.png" % (i, name),
prompt="photo of <1>, detailed faces, highres, RAW photo 8k uhd, dslr",
lora_urls=url,
lora_scales='0.5',
seed=42
)
if __name__ == "__main__":
main()
Andreas 0:

Andreas 100:

Andreas 999:

Zeke 0:

Zeke 100:

Zeke 999:

@cloneofsimo I have all 1000 pngs of zeke/andreas if this is useful.