Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,26 +24,14 @@ pipe_best.load_lora_weights("KingNish/Better-Image-XL-Lora", weight_name="exampl
|
|
24 |
pipe_best.set_adapters(["lora","dalle"], adapter_weights=[1.5, 0.7])
|
25 |
pipe_best.to("cuda")
|
26 |
|
27 |
-
pipe_ori = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
28 |
-
pipe_ori.load_lora_weights("RalFinger/origami-style-sdxl-lora", weight_name="ral-orgmi-sdxl.safetensors", adapter_name="origami")
|
29 |
-
pipe_ori.set_adapters(["origami"])
|
30 |
-
pipe_ori.to("cuda")
|
31 |
-
|
32 |
pipe_3D = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
33 |
pipe_3D.load_lora_weights("artificialguybr/3DRedmond-V1", weight_name="3DRedmond-3DRenderStyle-3DRenderAF.safetensors", adapter_name="3D")
|
34 |
pipe_3D.set_adapters(["3D"])
|
35 |
pipe_3D.to("cuda")
|
36 |
|
37 |
-
pipe_pixel = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
38 |
-
pipe_pixel.load_lora_weights("artificialguybr/PixelArtRedmond", weight_name="PixelArtRedmond-Lite64.safetensors", adapter_name="pixel1")
|
39 |
-
pipe_pixel.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel2")
|
40 |
-
pipe_pixel.set_adapters(["pixel1", "pixel2"], adapter_weights=[1.0, 1.2])
|
41 |
-
pipe_pixel.to("cuda")
|
42 |
-
|
43 |
pipe_logo = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
44 |
-
pipe_logo.load_lora_weights("artificialguybr/StickersRedmond", weight_name="StickersRedmond.safetensors", adapter_name="sticker")
|
45 |
pipe_logo.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="logo")
|
46 |
-
pipe_logo.set_adapters(["
|
47 |
pipe_logo.to("cuda")
|
48 |
|
49 |
help_text = """
|
@@ -114,12 +102,8 @@ def king(type ,
|
|
114 |
generator = torch.Generator().manual_seed(seed)
|
115 |
if style=="3D":
|
116 |
image = pipe_3D( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
117 |
-
elif style=="PixelArt":
|
118 |
-
image = pipe_pixel( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
119 |
elif style=="Logo":
|
120 |
image = pipe_logo( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
121 |
-
elif style=="Origami":
|
122 |
-
image = pipe_ori( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
123 |
else:
|
124 |
image = pipe_best( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
125 |
return seed, image
|
@@ -192,7 +176,7 @@ with gr.Blocks(css=css) as demo:
|
|
192 |
with gr.Column(scale=1):
|
193 |
generate_button = gr.Button("Generate")
|
194 |
with gr.Row():
|
195 |
-
style = gr.Radio(choices=["BEST","3D",
|
196 |
with gr.Row():
|
197 |
input_image = gr.Image(label="Image", type="pil", interactive=True)
|
198 |
|
|
|
24 |
pipe_best.set_adapters(["lora","dalle"], adapter_weights=[1.5, 0.7])
|
25 |
pipe_best.to("cuda")
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
pipe_3D = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
28 |
pipe_3D.load_lora_weights("artificialguybr/3DRedmond-V1", weight_name="3DRedmond-3DRenderStyle-3DRenderAF.safetensors", adapter_name="3D")
|
29 |
pipe_3D.set_adapters(["3D"])
|
30 |
pipe_3D.to("cuda")
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
pipe_logo = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
|
|
33 |
pipe_logo.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="logo")
|
34 |
+
pipe_logo.set_adapters(["logo"])
|
35 |
pipe_logo.to("cuda")
|
36 |
|
37 |
help_text = """
|
|
|
102 |
generator = torch.Generator().manual_seed(seed)
|
103 |
if style=="3D":
|
104 |
image = pipe_3D( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
|
|
|
|
105 |
elif style=="Logo":
|
106 |
image = pipe_logo( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
|
|
|
|
107 |
else:
|
108 |
image = pipe_best( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
109 |
return seed, image
|
|
|
176 |
with gr.Column(scale=1):
|
177 |
generate_button = gr.Button("Generate")
|
178 |
with gr.Row():
|
179 |
+
style = gr.Radio(choices=["BEST","3D","Logo"],label="Style", value="BEST", interactive=True)
|
180 |
with gr.Row():
|
181 |
input_image = gr.Image(label="Image", type="pil", interactive=True)
|
182 |
|