lllyasviel / Paints-UNDO

Understand Human Behavior to Align True Needs
Apache License 2.0
3.25k stars 287 forks source link

Unable to running step 1 generate prompt #46

Open zzc0208 opened 1 month ago

zzc0208 commented 1 month ago

I am located in mainland China and cannot directly access huggingface. I used a mirror source to download the 19 required files. The download has been completed and read from the local, but I cannot running step 1 image

(sd) linjl@bme-server:~/Paints-UNDO$ python gradio_app.py
/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
The config attributes {'shift_factor': None, 'use_post_quant_conv': True, 'use_quant_conv': True} were passed to AutoencoderKL, but are not expected and will be ignored. Please verify your config.json configuration file.
Fetching 19 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19/19 [00:00<00:00, 90972.35it/s]
Loading weights from local directory
Loading weights from local directory
Loading weights from local directory
Unload to CPU: AutoencoderKL
Unload to CPU: UNet3DModel
Unload to CPU: CLIPTextModel
Unload to CPU: ModifiedUNet
Unload to CPU: ImprovedCLIPVisionModelWithProjection
Unload to CPU: VideoAutoencoderKL
Unload to CPU: CLIPTextModel
Unload to CPU: Resampler
/home/linjl/Paints-UNDO/diffusers_helper/k_diffusion.py:43: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  alphas_cumprod = torch.tensor(np.cumprod(alphas, axis=0), dtype=torch.float32)
Running on local URL:  http://0.0.0.0:7861

To create a public link, set `share=True` in `launch()`.
IMPORTANT: You are using gradio version 4.27.0, however version 4.29.0 is available, please upgrade.
--------
Traceback (most recent call last):
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 1448, in connect
    super().connect()
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/http/client.py", line 942, in connect
    self.sock = self._create_connection(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/gradio/queueing.py", line 527, in process_events
    response = await route_utils.call_process_api(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/gradio/route_utils.py", line 261, in call_process_api
    output = await app.get_blocks().process_api(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/gradio/blocks.py", line 1788, in process_api
    result = await self.call_function(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/gradio/blocks.py", line 1340, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/gradio/utils.py", line 759, in wrapper
    response = f(*args, **kwargs)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/linjl/Paints-UNDO/gradio_app.py", line 115, in interrogator_process
    return wd14tagger.default_interrogator(x)
  File "/home/linjl/Paints-UNDO/wd14tagger.py", line 33, in default_interrogator
    model_onnx_filename = download_model(
  File "/home/linjl/Paints-UNDO/wd14tagger.py", line 23, in download_model
    download_url_to_file(url=url, dst=temp_path)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/site-packages/torch/hub.py", line 622, in download_url_to_file
    u = urlopen(req)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/home/linjl/anaconda3/envs/sd/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>
victorca25 commented 1 month ago

Can you try something similar to: https://github.com/lllyasviel/Paints-UNDO/issues/44 ?

Seems to be related with wd14tagger

KiedaTamashi commented 1 month ago

i have the some problem. Have u solved it?

urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

lllrj commented 1 month ago

我遇到了一些问题。你解决了吗?

urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

I think the reasion is you are in China. wd14tagger.py will help you download these file by huggingface. You can't download smoothly the onnx and csv. My solution is that manually download these files by youself like #44.