Comments (5)
The outputs you shared look amazing! Its absolutely possible to use compel just as you would use it with diffusers, here is an example
For SDXL based SegMoEs:
from compel import Compel, ReturnedEmbeddingsType
from segmoe import SegMoEPipeline
t2i = SegMoEPipeline("segmind/SegMoE-4x2-v0", device = "cuda")
compel = Compel(tokenizer=[t2i.pipe.tokenizer, t2i.pipe.tokenizer_2] , text_encoder=[t2i.pipe.text_encoder, t2i.pipe.text_encoder_2], returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, requires_pooled=[False, True])
prompt = "Milky Way. Night sky with stars and silhouette of a standing happy man with yellow light. Space background, (sharp focus:1.2), extremely detailed, (photorealistic:1.4), (RAW image, 8k high resolution:1.2), RAW candid cinema, 16mm, color graded Portra 400 film, ultra realistic, subsurface scattering, ray tracing, (volumetric lighting), extreme contrast, intricate details, reflections on ice, reflections on water, water pouring down"
conditioning, pooled = compel(prompt)
img = t2i(
prompt_embeds=conditioning,
pooled_prompt_embeds=pooled,
height=1024,
width=1024,
num_inference_steps=25,
guidance_scale=7.5,
).images[0]
img.save(f"image.png")
For SD Based SegMoEs
from segmoe import SegMoEPipeline
from compel import Compel
t2i = SegMoEPipeline("segmind/SegMoE-SD-4x2-v0", device = "cuda")
compel = Compel(tokenizer=t2i.pipe.tokenizer, text_encoder=t2i.pipe.text_encoder)
prompt = "Milky Way. Night sky with stars and silhouette of a standing happy man with yellow light. Space background, (sharp focus:1.2), extremely detailed, (photorealistic:1.4), (RAW image, 8k high resolution:1.2), RAW candid cinema, 16mm, color graded Portra 400 film, ultra realistic, subsurface scattering, ray tracing, (volumetric lighting), extreme contrast, intricate details, reflections on ice, reflections on water, water pouring down"
prompt_embeds = compel(prompt)
img = t2i(
prompt_embeds=prompt_embeds,
height=1024,
width=1024,
num_inference_steps=25,
guidance_scale=7.5,
).images[0]
img.save(f"image.png")
I hope this helps!
from segmoe.
I hope this helps!
Thank you, it started, I will test it.
from segmoe.
Tested it very quickly, it seemed to me that the quality had decreased, the accuracy of long prompts had increased, I took very long prompts for testing, perhaps they were initially “crooked”.
Tried to add - truncate_long_prompts = False
self.compel = Compel(
tokenizer=[self.pipeline.pipe.tokenizer, self.pipeline.pipe.tokenizer_2],
text_encoder=[self.pipeline.pipe.text_encoder, self.pipeline.pipe.text_encoder_2],
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED,
requires_pooled=[False, True],
truncate_long_prompts = False
)
And - max_embeddings_multiples=3
img = self.pipeline(
prompt_embeds=conditioning,
pooled_prompt_embeds=pooled,
height=int(height),
width=int(width),
num_inference_steps=int(num_inference_steps),
guidance_scale=float(guidance_scale),
max_embeddings_multiples=3
).images[0]
from segmoe.
(found footage DOF, Aperture, character, hypermaximalist, slutty, beautiful, exotic, rev
ealing, appealing,:1.3), (provocative legwear:1.3), (full body photo:1.3), dynamic scene, action packed, solo, headdress, (v
oluminous petticoat:1.2 skirt black shiny satin), grand interior, baroque elements, elegant, detailed, 8k resolution, (Royal
ty:1.3), she is feeling furious, Fighter, subtle cheeks and Pouty lips and Symmetrical shaped face, in Mysterious Chaotic Tr
ansparent Unique Neon Lighting, The Chaotic Transparent Unique Neon Lighting is inspired by fantasy, pointe pose, Gray hair
styled as Bald, Cluttered Colorful Ruff, Funny Glasses, Sun in the sky, horizon-centered, Vivid (best quality, masterpiece:1
.2), photorealistic
from segmoe.
It might be an effect of compel, having more tokens might be having a negative impact on the quality.
from segmoe.
Related Issues (20)
- Multi-GPU support HOT 5
- Minor mistake in readme HOT 1
- Thank you! + model suggestion HOT 2
- TypeError: SparseMoeBlock.forward() missing 1 required positional argument: 'scale' HOT 5
- Issue with Civitai downloads HOT 2
- Any benefit to implementing this with lycoris/lora instead of full models? HOT 2
- Support local safetensors file HOT 1
- Support Colab and Local Storage HOT 1
- TypeError: no_grad.__init__() on import HOT 3
- positive and negative keywords in .yaml files HOT 2
- Is torch 2.0 mandatory? HOT 2
- [feature] Support StableDiffusionImg2ImgPipeline HOT 1
- Does this work for Stable Cascade? HOT 1
- Why using negative prompt hidden states as gate weight? HOT 2
- Could you explain the effect of Pos and Neg prompts of each experts? HOT 2
- How to choose the positive prompt and negative prompt? HOT 2
- How to finetune the segmoe and train lora HOT 1
- Got noise image sample
- MoE in the attn heads
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 segmoe.