File size: 3,238 Bytes
c5935ae
 
 
 
 
 
 
286e4fb
c5935ae
 
 
 
 
286e4fb
c5935ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        with gr.Box(visible=os.environ.get("SPACE_ID")):
            is_shared_ui = str(os.environ.get("IS_SHARED_UI", "") or "").strip().lower() not in ("", "0", "false", "none", "no")
            if is_shared_ui:
                import torch
                if not torch.cuda.is_available():
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 12px; line-height: 20px; font-family: monospace;">
                      <p>▲ 我的網站<a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"=""></p>
                    </div>
                    """)
                else:
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 12px; line-height: 20px; font-family: monospace;">
                     <p>▲ 我的網站<a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"=""></p>
                    </div>
                    """)
            elif os.environ.get("SPACE_ID"):
                import torch
                if not torch.cuda.is_available():
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 12px; line-height: 20px; font-family: monospace;">
                        <p>▲ Docker build from <a href="https://github.com/kalaspuff/stable-diffusion-webui-controlnet-docker" style="target=" _blank"="">🐙 GitHub ➔ kalaspuff/stable-diffusion-webui-controlnet-docker</a> / <a href="https://huggingface.co/spaces/carloscar/stable-diffusion-webui-controlnet-docker" style="target=" _blank"="">🤗 Hugging Face ➔ carloscar/stable-diffusion-webui-controlnet-docker</a></p>
                        <p>▲ Load additional checkpoints, VAE, LoRA models, etc. Read more on the README at the GitHub link above.</p>
                        <p>▲ This Space is currently running on CPU, which may yield very slow results - you can upgrade for a GPU <a href="https://huggingface.co/spaces/{os.environ["SPACE_ID"]}/settings" style="text-decoration: underline" target="_blank">in the Settings tab</a></p>
                    </div>
                    """)
                else:
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 12px; line-height: 20px; font-family: monospace;">
                        <p>▲ Docker build from <a href="https://github.com/kalaspuff/stable-diffusion-webui-controlnet-docker" style="target=" _blank"="">🐙 GitHub ➔ kalaspuff/stable-diffusion-webui-controlnet-docker</a> / <a href="https://huggingface.co/spaces/carloscar/stable-diffusion-webui-controlnet-docker" style="target=" _blank"="">🤗 Hugging Face ➔ carloscar/stable-diffusion-webui-controlnet-docker</a></p>
                        <p>▲ Load additional checkpoints, VAE, LoRA models, etc. Read more on the README at the GitHub link above.</p>
                        <p>▲ This Space has GPU enabled - remember to remove the GPU from the space <a href="https://huggingface.co/spaces/{os.environ["SPACE_ID"]}/settings" style="text-decoration: underline" target="_blank">in the Settings tab</a> when you're done.</p>
                    </div>
                    """)