Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,20 +18,17 @@ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype
|
|
| 18 |
repo = "fluently/Fluently-XL-Final"
|
| 19 |
|
| 20 |
pipe_best = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
| 21 |
-
pipe_best.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_best.scheduler.config)
|
| 22 |
pipe_best.load_lora_weights("ehristoforu/dalle-3-xl-v2", weight_name="dalle-3-xl-lora-v2.safetensors", adapter_name="dalle")
|
| 23 |
pipe_best.load_lora_weights("KingNish/Better-Image-XL-Lora", weight_name="example-03.safetensors", adapter_name="lora")
|
| 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.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_3D.scheduler.config)
|
| 29 |
pipe_3D.load_lora_weights("artificialguybr/3DRedmond-V1", weight_name="3DRedmond-3DRenderStyle-3DRenderAF.safetensors", adapter_name="3D")
|
| 30 |
pipe_3D.set_adapters(["3D"])
|
| 31 |
pipe_3D.to("cuda")
|
| 32 |
|
| 33 |
pipe_logo = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
| 34 |
-
pipe_logo.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_logo.scheduler.config)
|
| 35 |
pipe_logo.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="logo")
|
| 36 |
pipe_logo.set_adapters(["logo"])
|
| 37 |
pipe_logo.to("cuda")
|
|
@@ -104,12 +101,12 @@ def king(type ,
|
|
| 104 |
generator = torch.Generator().manual_seed(seed)
|
| 105 |
if style=="3D":
|
| 106 |
instruction = f"3DRenderAF, 3D Render, {instruction}"
|
| 107 |
-
image = pipe_3D( prompt = instruction, guidance_scale =
|
| 108 |
elif style=="Logo":
|
| 109 |
instruction = f"LogoRedAF, {instruction}"
|
| 110 |
-
image = pipe_logo( prompt = instruction, guidance_scale =
|
| 111 |
else:
|
| 112 |
-
image = pipe_best( prompt = instruction, guidance_scale =
|
| 113 |
return seed, image
|
| 114 |
|
| 115 |
client = InferenceClient()
|
|
|
|
| 18 |
repo = "fluently/Fluently-XL-Final"
|
| 19 |
|
| 20 |
pipe_best = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
|
|
|
| 21 |
pipe_best.load_lora_weights("ehristoforu/dalle-3-xl-v2", weight_name="dalle-3-xl-lora-v2.safetensors", adapter_name="dalle")
|
| 22 |
pipe_best.load_lora_weights("KingNish/Better-Image-XL-Lora", weight_name="example-03.safetensors", adapter_name="lora")
|
| 23 |
pipe_best.set_adapters(["lora","dalle"], adapter_weights=[1.5, 0.7])
|
| 24 |
pipe_best.to("cuda")
|
| 25 |
|
| 26 |
pipe_3D = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
|
|
|
| 27 |
pipe_3D.load_lora_weights("artificialguybr/3DRedmond-V1", weight_name="3DRedmond-3DRenderStyle-3DRenderAF.safetensors", adapter_name="3D")
|
| 28 |
pipe_3D.set_adapters(["3D"])
|
| 29 |
pipe_3D.to("cuda")
|
| 30 |
|
| 31 |
pipe_logo = StableDiffusionXLPipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae)
|
|
|
|
| 32 |
pipe_logo.load_lora_weights("artificialguybr/LogoRedmond-LogoLoraForSDXL", weight_name="LogoRedmond_LogoRedAF.safetensors", adapter_name="logo")
|
| 33 |
pipe_logo.set_adapters(["logo"])
|
| 34 |
pipe_logo.to("cuda")
|
|
|
|
| 101 |
generator = torch.Generator().manual_seed(seed)
|
| 102 |
if style=="3D":
|
| 103 |
instruction = f"3DRenderAF, 3D Render, {instruction}"
|
| 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 |
instruction = f"LogoRedAF, {instruction}"
|
| 107 |
+
image = pipe_logo( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
| 108 |
else:
|
| 109 |
+
image = pipe_best( prompt = instruction, guidance_scale = 5, num_inference_steps = steps, width = width, height = height, generator = generator).images[0]
|
| 110 |
return seed, image
|
| 111 |
|
| 112 |
client = InferenceClient()
|