replicate / cog-sdxl

Stable Diffusion XL training and inference as a cog model
https://replicate.com/stability-ai/sdxl
Apache License 2.0
203 stars 106 forks source link

Fine-tuned versions fail setup runs #26

Closed philandstuff closed 11 months ago

philandstuff commented 11 months ago

On replicate.com, fine-tuned cog-sdxl versions result in a version which will fail setup with error:

cog.server.exceptions.FatalWorkerException: Predictor errored during setup: 'URLPath' object has no attribute 'encode'

this has no effect on replicate.com, where we can run fine-tuned versions against the base model by hotswapping weights, but I suspect that it might have broken cog predict for fine-tuned models?

Full setup run log below:

Loading safety checker...
downloading url:  https://weights.replicate.delivery/default/sdxl/safety-1.0.tar
downloading to:  ./safety-cache
downloading took:  1.6426427364349365
downloading url:  https://weights.replicate.delivery/default/sdxl/sdxl-vae-fix-1.0.tar
downloading to:  ./sdxl-cache
downloading took:  8.76220154762268
Loading sdxl txt2img pipeline...
Loading pipeline components...:   0%|          | 0/7 [00:00<?, ?it/s]
Loading pipeline components...:  14%|█▍        | 1/7 [00:00<00:05,  1.17it/s]
Loading pipeline components...:  43%|████▎     | 3/7 [00:01<00:01,  2.75it/s]
Loading pipeline components...:  71%|███████▏  | 5/7 [00:01<00:00,  4.76it/s]
Loading pipeline components...: 100%|██████████| 7/7 [00:01<00:00,  5.79it/s]
Loading pipeline components...: 100%|██████████| 7/7 [00:01<00:00,  4.35it/s]
Traceback (most recent call last):
File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/cog/server/worker.py", line 185, in _setup
run_setup(self._predictor)
File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/cog/predictor.py", line 98, in run_setup
predictor.setup(weights=weights)
File "predict.py", line 184, in setup
self.load_trained_weights(weights, self.txt2img_pipe)
File "predict.py", line 77, in load_trained_weights
local_weights_cache = self.weights_cache.ensure(weights)
File "/src/weights.py", line 78, in ensure
path = self.weights_path(url)
File "/src/weights.py", line 98, in weights_path
hashed_url = hashlib.sha256(url.encode()).hexdigest()
AttributeError: 'URLPath' object has no attribute 'encode'
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/cog/server/runner.py", line 292, in setup
    for event in worker.setup():
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/cog/server/worker.py", line 126, in _wait
    raise FatalWorkerException(raise_on_error + ": " + done.error_detail)
cog.server.exceptions.FatalWorkerException: Predictor errored during setup: 'URLPath' object has no attribute 'encode'