Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,7 @@ pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
|
|
| 37 |
# Load lora (giving it a name makes it active when using the name in the prompt)
|
| 38 |
pipe.load_lora_weights("ostris/ikea-instructions-lora-sdxl", weight_name="ikea_instructions_xl_v1_5.safetensors", adapter_name="ikea")
|
| 39 |
pipe.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel")
|
|
|
|
| 40 |
pipe.disable_lora()
|
| 41 |
|
| 42 |
def activate_ikea_lora():
|
|
@@ -51,6 +52,12 @@ def activate_pixel_lora():
|
|
| 51 |
pipe.set_adapters("pixel")
|
| 52 |
print("PixelArt LoRa active!")
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
def disable_loras():
|
| 55 |
print("Deactivating LoRas")
|
| 56 |
pipe.disable_lora()
|
|
@@ -104,6 +111,7 @@ with gr.Blocks() as demo:
|
|
| 104 |
with gr.Row():
|
| 105 |
ikea_lora_button = gr.Button("IKEA Instructions")
|
| 106 |
pixel_lora_button = gr.Button("Pixel Art")
|
|
|
|
| 107 |
disable_lora_button = gr.Button("Disable LoRas")
|
| 108 |
|
| 109 |
generate_button = gr.Button("Generate Styled Image")
|
|
@@ -127,6 +135,10 @@ with gr.Blocks() as demo:
|
|
| 127 |
fn = activate_pixel_lora,
|
| 128 |
)
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
disable_lora_button.click(
|
| 131 |
fn = disable_loras,
|
| 132 |
)
|
|
|
|
| 37 |
# Load lora (giving it a name makes it active when using the name in the prompt)
|
| 38 |
pipe.load_lora_weights("ostris/ikea-instructions-lora-sdxl", weight_name="ikea_instructions_xl_v1_5.safetensors", adapter_name="ikea")
|
| 39 |
pipe.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel")
|
| 40 |
+
pipeline.load_lora_weights('e-n-v-y/envy-junkworld-xl-01', weight_name='EnvyJunkworldXL01.safetensors', adapter_name="junkworld")
|
| 41 |
pipe.disable_lora()
|
| 42 |
|
| 43 |
def activate_ikea_lora():
|
|
|
|
| 52 |
pipe.set_adapters("pixel")
|
| 53 |
print("PixelArt LoRa active!")
|
| 54 |
|
| 55 |
+
def activate_junkworld_lora():
|
| 56 |
+
print("Activating JunkWorld LoRa")
|
| 57 |
+
pipe.enable_lora()
|
| 58 |
+
pipe.set_adapters("junkworld")
|
| 59 |
+
print("PixelArt LoRa active!")
|
| 60 |
+
|
| 61 |
def disable_loras():
|
| 62 |
print("Deactivating LoRas")
|
| 63 |
pipe.disable_lora()
|
|
|
|
| 111 |
with gr.Row():
|
| 112 |
ikea_lora_button = gr.Button("IKEA Instructions")
|
| 113 |
pixel_lora_button = gr.Button("Pixel Art")
|
| 114 |
+
junkworld_lora_button = gr.Button("Junk World")
|
| 115 |
disable_lora_button = gr.Button("Disable LoRas")
|
| 116 |
|
| 117 |
generate_button = gr.Button("Generate Styled Image")
|
|
|
|
| 135 |
fn = activate_pixel_lora,
|
| 136 |
)
|
| 137 |
|
| 138 |
+
junkworld_lora_button.click(
|
| 139 |
+
fn = activate_junkworld_lora,
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
disable_lora_button.click(
|
| 143 |
fn = disable_loras,
|
| 144 |
)
|