Instructions to use RobbyDalmonts/DDPM_uwall_67fields_only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use RobbyDalmonts/DDPM_uwall_67fields_only with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("RobbyDalmonts/DDPM_uwall_67fields_only", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
This model is a diffusion model for unconditional image generation of uwall velocity field in a turbulent channel flow with Retau = 1000. This model is trained using just 67 fields which are very few since in the most of case DDPM are trained with thousands of images.
Usage
from diffusers import DDPMPipeline
import torch
import torchvision
from torchvision import transforms
import numpy as np
from matplotlib import pyplot as plt
from huggingface_hub import hf_hub_download
import joblib
pipeline = DDPMPipeline.from_pretrained('RobbyDalmonts/DDPM_uwall_67fields_only')
image = pipeline().images[0]
to_tensor = transforms.ToTensor()
tensor_output_normalized = to_tensor(image)
tensor_output_normalized = tensor_output_normalized *2 -1
fig,ax = plt.subplots()
ax.imshow(tensor_output_normalized[0], cmap ='coolwarm')
ax.set_title('normalized sample')
plt.show()
plt.close()
scaler_path = hf_hub_download(repo_id='RobbyDalmonts/DDPM_uwall_67fields_only', filename="scaler.pkl", repo_type='model')
scaler = joblib.load(scaler_path)
tensor_output = scaler.inverse_transform(tensor_output_normalized.squeeze(0).numpy().reshape(-1,1)).reshape(128,64)
fig,ax = plt.subplots()
ax.imshow(tensor_output, cmap='coolwarm')
ax.set_title('sample')
plt.show()
plt.close()
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support