Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Capability Not Existing #242

Open
freelancer2000 opened this issue Mar 28, 2024 · 0 comments
Open

Offline Capability Not Existing #242

freelancer2000 opened this issue Mar 28, 2024 · 0 comments

Comments

@freelancer2000
Copy link

When trying to use Animtediff without being connected to the internet, the whole script fails when getting at the pipeline conversion section which mandates to grab from the internet mandatory, without it will not start generating (staying online works, but it kinda circumvents the whole idea of having this locally)

───────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connection.p │
│ y:203 in _new_conn │
│ │
│ 200 │ │ :return: New socket connection. │
│ 201 │ │ """ │
│ 202 │ │ try: │
│ ❱ 203 │ │ │ sock = connection.create_connection( │
│ 204 │ │ │ │ (self._dns_host, self.port), │
│ 205 │ │ │ │ self.timeout, │
│ 206 │ │ │ │ source_address=self.source_address, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\util\connect │
│ ion.py:60 in create_connection │
│ │
│ 57 │ except UnicodeError: │
│ 58 │ │ raise LocationParseError(f"'{host}', label empty or too long") from None │
│ 59 │ │
│ ❱ 60 │ for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): │
│ 61 │ │ af, socktype, proto, canonname, sa = res │
│ 62 │ │ sock = None │
│ 63 │ │ try: │
│ │
│ C:\Python3\lib\socket.py:955 in getaddrinfo │
│ │
│ 952 │ # We override this function since we want to translate the numeric family │
│ 953 │ # and socket type values to enum constants. │
│ 954 │ addrlist = [] │
│ ❱ 955 │ for res in _socket.getaddrinfo(host, port, family, type, proto, flags): │
│ 956 │ │ af, socktype, proto, canonname, sa = res │
│ 957 │ │ addrlist.append((_intenum_converter(af, AddressFamily), │
│ 958 │ │ │ │ │ │ _intenum_converter(socktype, SocketKind), │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
gaierror: [Errno 11001] getaddrinfo failed

The above exception was the direct cause of the following exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connectionpo │
│ ol.py:790 in urlopen │
│ │
│ 787 │ │ │ response_conn = conn if not release_conn else None │
│ 788 │ │ │ │
│ 789 │ │ │ # Make the request on the HTTPConnection object │
│ ❱ 790 │ │ │ response = self._make_request( │
│ 791 │ │ │ │ conn, │
│ 792 │ │ │ │ method, │
│ 793 │ │ │ │ url, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connectionpo │
│ ol.py:491 in _make_request │
│ │
│ 488 │ │ │ │ new_e, (OSError, NewConnectionError, TimeoutError, SSLError) │
│ 489 │ │ │ ) and (conn and conn.proxy and not conn.has_connected_to_proxy): │
│ 490 │ │ │ │ new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) │
│ ❱ 491 │ │ │ raise new_e │
│ 492 │ │ │
│ 493 │ │ # conn.request() calls http.client.*.request, not the method in │
│ 494 │ │ # urllib3.request. It also calls makefile (recv) on the socket. │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connectionpo │
│ ol.py:467 in _make_request │
│ │
│ 464 │ │ try: │
│ 465 │ │ │ # Trigger any extra validation we need to do. │
│ 466 │ │ │ try: │
│ ❱ 467 │ │ │ │ self._validate_conn(conn) │
│ 468 │ │ │ except (SocketTimeout, BaseSSLError) as e: │
│ 469 │ │ │ │ self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) │
│ 470 │ │ │ │ raise │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connectionpo │
│ ol.py:1096 in _validate_conn │
│ │
│ 1093 │ │ │
│ 1094 │ │ # Force connect early to allow us to validate the connection. │
│ 1095 │ │ if conn.is_closed: │
│ ❱ 1096 │ │ │ conn.connect() │
│ 1097 │ │ │
│ 1098 │ │ if not conn.is_verified: │
│ 1099 │ │ │ warnings.warn( │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connection.p │
│ y:611 in connect │
│ │
│ 608 │ │
│ 609 │ def connect(self) -> None: │
│ 610 │ │ sock: socket.socket | ssl.SSLSocket │
│ ❱ 611 │ │ self.sock = sock = self._new_conn() │
│ 612 │ │ server_hostname: str = self.host │
│ 613 │ │ tls_in_tls = False │
│ 614 │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connection.p │
│ y:210 in _new_conn │
│ │
│ 207 │ │ │ │ socket_options=self.socket_options, │
│ 208 │ │ │ ) │
│ 209 │ │ except socket.gaierror as e: │
│ ❱ 210 │ │ │ raise NameResolutionError(self.host, self, e) from e │
│ 211 │ │ except SocketTimeout as e: │
│ 212 │ │ │ raise ConnectTimeoutError( │
│ 213 │ │ │ │ self, │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x000001CA49C24490>: Failed to resolve 'raw.githubusercontent.com' ([Errno 11001] getaddrinfo failed)

The above exception was the direct cause of the following exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\adapters.py │
│ :486 in send │
│ │
│ 483 │ │ │ timeout = TimeoutSauce(connect=timeout, read=timeout) │
│ 484 │ │ │
│ 485 │ │ try: │
│ ❱ 486 │ │ │ resp = conn.urlopen( │
│ 487 │ │ │ │ method=request.method, │
│ 488 │ │ │ │ url=url, │
│ 489 │ │ │ │ body=request.body, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\connectionpo │
│ ol.py:844 in urlopen │
│ │
│ 841 │ │ │ elif isinstance(new_e, (OSError, HTTPException)): │
│ 842 │ │ │ │ new_e = ProtocolError("Connection aborted.", new_e) │
│ 843 │ │ │ │
│ ❱ 844 │ │ │ retries = retries.increment( │
│ 845 │ │ │ │ method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] │
│ 846 │ │ │ ) │
│ 847 │ │ │ retries.sleep() │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\urllib3\util\retry.p │
│ y:515 in increment │
│ │
│ 512 │ │ │
│ 513 │ │ if new_retry.is_exhausted(): │
│ 514 │ │ │ reason = error or ResponseError(cause) │
│ ❱ 515 │ │ │ raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type │
│ 516 │ │ │
│ 517 │ │ log.debug("Incremented Retry for (url='%s'): %r", url, new_retry) │
│ 518 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001CA49C24490>: Failed to resolve
'raw.githubusercontent.com' ([Errno 11001] getaddrinfo failed)"))

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\freel\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\AnimateDiff Prompt │
│ Travel\animatediff-cli-prompt-travel\src\animatediff\cli.py:323 in generate │
│ │
│ 320 │ global g_pipeline │
│ 321 │ global last_model_path │
│ 322 │ if g_pipeline is None or last_model_path != model_config.path.resolve(): │
│ ❱ 323 │ │ g_pipeline = create_pipeline( │
│ 324 │ │ │ base_model=base_model_path, │
│ 325 │ │ │ model_config=model_config, │
│ 326 │ │ │ infer_config=infer_config, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\AnimateDiff Prompt │
│ Travel\animatediff-cli-prompt-travel\src\animatediff\generate.py:368 in create_pipeline │
│ │
│ 365 │ │ logger.info(f"Loading weights from {model_path}") │
│ 366 │ │ if model_path.is_file(): │
│ 367 │ │ │ logger.debug("Loading from single checkpoint file") │
│ ❱ 368 │ │ │ unet_state_dict, tenc_state_dict, vae_state_dict = get_checkpoint_weights(mo │
│ 369 │ │ elif model_path.is_dir(): │
│ 370 │ │ │ logger.debug("Loading from Diffusers model directory") │
│ 371 │ │ │ temp_pipeline = StableDiffusionPipeline.from_pretrained(model_path) │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\AnimateDiff Prompt │
│ Travel\animatediff-cli-prompt-travel\src\animatediff\utils\model.py:139 in │
│ get_checkpoint_weights │
│ │
│ 136 │
│ 137 def get_checkpoint_weights(checkpoint: Path): │
│ 138 │ temp_pipeline: StableDiffusionPipeline │
│ ❱ 139 │ temp_pipeline, _ = checkpoint_to_pipeline(checkpoint, save=False) │
│ 140 │ unet_state_dict = temp_pipeline.unet.state_dict() │
│ 141 │ tenc_state_dict = temp_pipeline.text_encoder.state_dict() │
│ 142 │ vae_state_dict = temp_pipeline.vae.state_dict() │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\AnimateDiff Prompt │
│ Travel\animatediff-cli-prompt-travel\src\animatediff\utils\model.py:124 in │
│ checkpoint_to_pipeline │
│ │
│ 121 │ if target_dir is None: │
│ 122 │ │ target_dir = pipeline_dir.joinpath(checkpoint.stem) │
│ 123 │ │
│ ❱ 124 │ pipeline = StableDiffusionPipeline.from_single_file( │
│ 125 │ │ pretrained_model_link_or_path=str(checkpoint.absolute()), │
│ 126 │ │ local_files_only=True, │
│ 127 │ │ load_safety_checker=False, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\diffusers\loaders.py │
│ :1471 in from_single_file │
│ │
│ 1468 │ │ │ │ force_download=force_download, │
│ 1469 │ │ │ ) │
│ 1470 │ │ │
│ ❱ 1471 │ │ pipe = download_from_original_stable_diffusion_ckpt( │
│ 1472 │ │ │ pretrained_model_link_or_path, │
│ 1473 │ │ │ pipeline_class=cls, │
│ 1474 │ │ │ model_type=model_type, │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\diffusers\pipelines\ │
│ stable_diffusion\convert_from_ckpt.py:1234 in download_from_original_stable_diffusion_ckpt │
│ │
│ 1231 │ │ │ # only refiner xl has embedder and one text embedders │
│ 1232 │ │ │ config_url = "https://raw.githubusercontent.com/Stability-AI/generative-mode
│ 1233 │ │ │
│ ❱ 1234 │ │ original_config_file = BytesIO(requests.get(config_url).content) │
│ 1235 │ │
│ 1236 │ original_config = OmegaConf.load(original_config_file) │
│ 1237 │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\api.py:73 │
│ in get │
│ │
│ 70 │ :rtype: requests.Response │
│ 71 │ """ │
│ 72 │ │
│ ❱ 73 │ return request("get", url, params=params, **kwargs) │
│ 74 │
│ 75 │
│ 76 def options(url, **kwargs): │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\api.py:59 │
│ in request │
│ │
│ 56 │ # avoid leaving sockets open which can trigger a ResourceWarning in some │
│ 57 │ # cases, and look like a memory leak in others. │
│ 58 │ with sessions.Session() as session: │
│ ❱ 59 │ │ return session.request(method=method, url=url, **kwargs) │
│ 60 │
│ 61 │
│ 62 def get(url, params=None, **kwargs): │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\sessions.py │
│ :589 in request │
│ │
│ 586 │ │ │ "allow_redirects": allow_redirects, │
│ 587 │ │ } │
│ 588 │ │ send_kwargs.update(settings) │
│ ❱ 589 │ │ resp = self.send(prep, **send_kwargs) │
│ 590 │ │ │
│ 591 │ │ return resp │
│ 592 │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\sessions.py │
│ :703 in send │
│ │
│ 700 │ │ start = preferred_clock() │
│ 701 │ │ │
│ 702 │ │ # Send the request │
│ ❱ 703 │ │ r = adapter.send(request, **kwargs) │
│ 704 │ │ │
│ 705 │ │ # Total elapsed time of the request (approximately) │
│ 706 │ │ elapsed = preferred_clock() - start │
│ │
│ C:\Users\freel\AppData\Roaming\Visions of │
│ Chaos\Examples\MachineLearning\venv\voc_animatediffprompt\lib\site-packages\requests\adapters.py │
│ :519 in send │
│ │
│ 516 │ │ │ │ # This branch is for urllib3 v1.22 and later. │
│ 517 │ │ │ │ raise SSLError(e, request=request) │
│ 518 │ │ │ │
│ ❱ 519 │ │ │ raise ConnectionError(e, request=request) │
│ 520 │ │ │
│ 521 │ │ except ClosedPoolError as e: │
│ 522 │ │ │ raise ConnectionError(e, request=request) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001CA49C24490>: Failed to resolve
'raw.githubusercontent.com' ([Errno 11001] getaddrinfo failed)"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant