File size: 2,987 Bytes
967928f
0258e61
967928f
 
 
 
 
 
 
0d1bbfb
075d26a
1b27768
0d1bbfb
075d26a
1b27768
0d1bbfb
075d26a
 
 
0258e61
0d1bbfb
0258e61
 
 
 
0d1bbfb
075d26a
 
0d1bbfb
 
075d26a
 
 
 
 
0d1bbfb
 
 
075d26a
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
36
37
38
39
40
import gradio as gr
import subprocess

def greet(name):
    return "Hello " + name + "!!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()

# - Dependencies - #
subprocess.run(["pip", "install", "xformers", "pyngrok"])  # Instalamos las dependencias necesarias

# - Stable Diffusion WebUI - #
subprocess.run(["git", "clone", "https://github.com/AUTOMATIC1111/stable-diffusion-webui"])

# --- MODELS, LORAS, VAE --- #
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/Stable-diffusion/absolutereality_v181.safetensors", "https://civitai.com/api/download/models/132760"])
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.safetensors", "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors"])
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/VAE/kl-f8-anime2.ckpt", "https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt"])

# --- UPSCALERS --- #
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/ESRGAN/4x-UltraSharp.pth", "https://huggingface.co/Zabin/Resizers/resolve/main/4x-UltraSharp.pth"])
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/ESRGAN/4x_foolhardy_Remacri.pth", "https://huggingface.co/Zabin/Resizers/resolve/main/4x_foolhardy_Remacri.pth"])
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/models/ESRGAN/4x_NMKD-Superscale-SP_178000_G.pth", "https://huggingface.co/gemasai/4x_NMKD-Superscale-SP_178000_G/resolve/main/4x_NMKD-Superscale-SP_178000_G.pth"])

# --- EMBEDDINGS --- #
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/embeddings/Negative/EasyNegative.pt", "https://huggingface.co/embed/negative/resolve/main/EasyNegative.pt"])
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/embeddings/Negative/EasyNegativeV2.safetensors", "https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/embedding/EasyNegativeV2.safetensors"])
# Descarga de otros archivos de embeddings...

# --- UI Config - #
subprocess.run(["wget", "-O", "/content/stable-diffusion-webui/ui-config.json", "https://huggingface.co/TNitro/ui-config/resolve/main/ui-config.json"])
subprocess.run(["cp", "/content/stable-diffusion-webui/ui-config.json", "/content/stable-diffusion-webui/config.json"])
subprocess.run(["sed", "-i", "-e", 's/\["sd_model_checkpoint"\],/\["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"\],/g', "/content/stable-diffusion-webui/modules/shared_options.py"])
subprocess.run(["sed", "-i", "-e", 's/"\[seed\]"/"\[model_name\],\[seed\]"/g', "/content/stable-diffusion-webui/modules/images.py"])
# Otras modificaciones en la configuración de la interfaz de usuario...

# - Run - #
subprocess.run(["python", "/content/stable-diffusion-webui/launch.py", "--theme", "dark", "--enable-insecure-extension-access", "--disable-safe-unpickle", "--no-hashing", "--xformers"])