GithubHelp home page GithubHelp logo

77 token limit about segmoe HOT 5 OPEN

imba-pericia avatar imba-pericia commented on August 16, 2024
77 token limit

from segmoe.

Comments (5)

Warlord-K avatar Warlord-K commented on August 16, 2024 1

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.

imba-pericia avatar imba-pericia commented on August 16, 2024

I hope this helps!

Thank you, it started, I will test it.

from segmoe.

imba-pericia avatar imba-pericia commented on August 16, 2024

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.

imba-pericia avatar imba-pericia commented on August 16, 2024
(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
Before:
After:

from segmoe.

Warlord-K avatar Warlord-K commented on August 16, 2024

It might be an effect of compel, having more tokens might be having a negative impact on the quality.

from segmoe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.