Comments (3)
please add a reproducible code, probably there is a mistake about rgb conversion?
from ip-adapter.
please add a reproducible code, probably there is a mistake about rgb conversion?
thanks! Here is the transform code:
- image:
self.transform = transforms.Compose([
transforms.Resize(self.size, interpolation=transforms.InterpolationMode.BILINEAR),
transforms.CenterCrop(self.size),
transforms.ToTensor(),
# transforms.Normalize([-1], [1]),
transforms.Normalize([0.5], [0.5]),
# transforms.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5]),
])
raw_image = Image.open(os.path.join(self.image_root_path, image_file))
image = self.transform(raw_image.convert("RGB"))
2: faceid_embeds:
image = cv2.imread(img_path)
faces = app.get(image)
if len(faces) == 1:
faceid_embeds = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
torch.save(faceid_embeds, bin_path)
- encode:
images = torch.stack([example["image"] for example in data])
face_id_embed = torch.stack([example["face_id_embed"] for example in data])
latents = vae.encode(batch["images"].to(accelerator.device, dtype=weight_dtype)).latent_dist.sample()
latents = latents * vae.config.scaling_factor
image_embeds = batch["face_id_embed"].to(accelerator.device, dtype=weight_dtype)
with torch.no_grad():
encoder_hidden_states = text_encoder(batch["text_input_ids"].to(accelerator.device))[0]
noise_pred = ip_adapter(noisy_latents, timesteps, encoder_hidden_states, image_embeds)
from ip-adapter.
it has to do with the convertion between cv2 and PIL. the color mapping is different
from ip-adapter.
Related Issues (20)
- ImportError: cannot import name 'ValidationInfo' from 'pydantic' HOT 1
- Traning Code for SD2.1
- How should I go about training the ip adapter plus sdxl for inpainting by providing it a reference image ?
- How to use ip-adapter-faceid-portrait_sdxl.bin
- 一些训练增强方式细节的请教~ HOT 2
- hunyuan-dit version of the ip adapter
- Question about "ip-adapter_sd15_light.safetensors"
- Question - How to generate depth map image
- How to generate side view human accurately
- A preprocessor ip adapter clip sd15 is missing HOT 1
- Question on adding IP-Adapter on SD3
- How should I resolve an error when I reach this step? HOT 1
- is it" ipadapter mad scientist "does not work in 1.5model?
- question about cross attention
- questions about training
- Generating undersaturated images
- train IP-Adapter with Kolors?
- train IP-Adapter based on Kolors ?
- Question about the [Scale] Parameter
- Custom Foreground in Custom Background using 'SD-XL Inpaint'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ip-adapter.