Van_Gogh_lora
63
2
1 language
—
by
Kontext-Style
Image Model
OTHER
New
63 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
Van Gogh Style LoRA for FLUX.
Code Examples
Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Inference Examplepythonpytorch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
# Load the base pipeline
pipeline = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to('cuda')
# Load the LoRA adapter for the Van Gogh style directly from the Hub
pipeline.load_lora_weights("Kontext-Style/Van_Gogh_lora", weight_name="Van_Gogh_lora_weights.safetensors", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt
# The style_name is used in the prompt and for the output filename.
style_name = "Van Gogh"
prompt = f"Turn this image into the Van_Gogh style."
# Run inference
result_image = pipeline(
image=image,
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=24
).images[0]
# Save the result
output_filename = f"{style_name.replace(' ', '_')}.png"
result_image.save(output_filename)
print(f"Image saved as {output_filename}")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.